public final class Executors extends Object
Use this instead of Executors
, because
it ensures that the returned Executor uses a ThreadFactory
that is
named, has a logging UncaughtExceptionHandler, and returns (Guava's) ListenableFuture.
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_TIMEOUT_FOR_SHUTDOWN |
static TimeUnit |
DEFAULT_TIMEOUT_UNIT_FOR_SHUTDOWN |
Modifier and Type | Method and Description |
---|---|
static ExecutorService |
newCachedThreadPool(String namePrefix,
org.slf4j.Logger logger)
Deprecated.
|
static com.google.common.util.concurrent.ListeningExecutorService |
newListeningCachedThreadPool(String namePrefix,
org.slf4j.Logger logger) |
static com.google.common.util.concurrent.ListeningScheduledExecutorService |
newListeningScheduledThreadPool(int corePoolSize,
String namePrefix,
org.slf4j.Logger logger) |
static com.google.common.util.concurrent.ListeningExecutorService |
newListeningSingleThreadExecutor(String namePrefix,
org.slf4j.Logger logger)
Creates a single thread executor with a
ThreadFactory that uses
the provided prefix for its thread names and logs uncaught exceptions
with the specified Logger . |
static com.google.common.util.concurrent.ListeningScheduledExecutorService |
newListeningSingleThreadScheduledExecutor(String namePrefix,
org.slf4j.Logger logger) |
static ScheduledExecutorService |
newScheduledThreadPool(int corePoolSize,
String namePrefix,
org.slf4j.Logger logger)
Deprecated.
|
static ExecutorService |
newSingleThreadExecutor(String namePrefix,
org.slf4j.Logger logger)
Deprecated.
Use
newListeningSingleThreadExecutor(String, Logger) instead. |
static ScheduledExecutorService |
newSingleThreadScheduledExecutor(String namePrefix,
org.slf4j.Logger logger)
Deprecated.
|
static void |
shutdownAndAwaitTermination(ExecutorService executorService) |
public static final long DEFAULT_TIMEOUT_FOR_SHUTDOWN
public static final TimeUnit DEFAULT_TIMEOUT_UNIT_FOR_SHUTDOWN
public static com.google.common.util.concurrent.ListeningExecutorService newListeningSingleThreadExecutor(String namePrefix, org.slf4j.Logger logger)
ThreadFactory
that uses
the provided prefix for its thread names and logs uncaught exceptions
with the specified Logger
.namePrefix
- Prefix for this executor thread nameslogger
- Logger used to log uncaught exceptions@Deprecated public static ExecutorService newSingleThreadExecutor(String namePrefix, org.slf4j.Logger logger)
newListeningSingleThreadExecutor(String, Logger)
instead.public static com.google.common.util.concurrent.ListeningExecutorService newListeningCachedThreadPool(String namePrefix, org.slf4j.Logger logger)
@Deprecated public static ExecutorService newCachedThreadPool(String namePrefix, org.slf4j.Logger logger)
public static com.google.common.util.concurrent.ListeningScheduledExecutorService newListeningSingleThreadScheduledExecutor(String namePrefix, org.slf4j.Logger logger)
@Deprecated public static ScheduledExecutorService newSingleThreadScheduledExecutor(String namePrefix, org.slf4j.Logger logger)
public static com.google.common.util.concurrent.ListeningScheduledExecutorService newListeningScheduledThreadPool(int corePoolSize, String namePrefix, org.slf4j.Logger logger)
@Deprecated public static ScheduledExecutorService newScheduledThreadPool(int corePoolSize, String namePrefix, org.slf4j.Logger logger)
public static void shutdownAndAwaitTermination(ExecutorService executorService)
Copyright © 2019 OpenDaylight. All rights reserved.