public final class SharedExecutors
extends java.lang.Object
Whenever possible, use of these shared resources is encouraged over creating separate ones.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_POOL_SIZE |
Modifier and Type | Method and Description |
---|---|
static java.util.concurrent.ExecutorService |
getPoolThreadExecutor()
Returns the shared thread pool executor.
|
static java.util.concurrent.ExecutorService |
getSingleThreadExecutor()
Returns the shared single thread executor.
|
static java.util.Timer |
getTimer()
Returns the shared timer.
|
static void |
setMetricsService(MetricsService metricsService)
Enables or disables calculation of the pool performance metrics.
|
static void |
setPoolSize(int poolSize)
Sets the shared thread pool size.
|
static void |
shutdown()
Shuts down all shared timers and executors and therefore should be
called only by the framework.
|
public static final int DEFAULT_POOL_SIZE
public static java.util.concurrent.ExecutorService getSingleThreadExecutor()
public static java.util.concurrent.ExecutorService getPoolThreadExecutor()
public static java.util.Timer getTimer()
public static void setPoolSize(int poolSize)
poolSize
- new pool sizepublic static void setMetricsService(MetricsService metricsService)
metricsService
- optional metric servicepublic static void shutdown()