Interface AMExecutorServiceFactory
-
- All Known Implementing Classes:
AuditRequestContextPropagatingExecutorServiceFactory
public interface AMExecutorServiceFactoryResponsible for filtering the API ofExecutorServiceFactoryto exclude any methods that do not offer a means of setting thread names and to ensure that new methods added toExecutorServiceFactoryare always called viaAuditRequestContextPropagatingExecutorServiceFactory.- Since:
- 14.0.0
- See Also:
ExecutorServiceFactory,AuditRequestContextPropagatingExecutorServiceFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecutorServicecreateCachedThreadPool(String threadNamePrefix)Generates a Cached Thread Pool ExecutorService using the provided name as a prefix of the thread names.ExecutorServicecreateCachedThreadPool(ThreadFactory factory)Generates a Cached Thread Pool ExecutorService which has been pre-registered with the ShutdownManager.ExecutorServicecreateFixedThreadPool(int pool, String threadNamePrefix)Create a fixed size Thread Pool ExecutorService using the provided name as the prefix of the thread names.ExecutorServicecreateFixedThreadPool(int pool, ThreadFactory factory)Creates a fixed size Thread Pool ExecutorService which has been pre-registered with theShutdownManager.ScheduledExecutorServicecreateScheduledService(int poolSize, String threadNamePrefix)Generates a ScheduledExecutorService which has been pre-registered with the ShutdownManager.ExecutorServicecreateThreadPool(int coreSize, int maxSize, long idleTimeout, TimeUnit timeoutTimeunit, BlockingQueue<Runnable> runnables, String threadNamePrefix)Generates a ThreadPoolExecutor with the provided values, and registers that executor as listening for shutdown messages.
-
-
-
Method Detail
-
createScheduledService
ScheduledExecutorService createScheduledService(int poolSize, String threadNamePrefix)
Generates a ScheduledExecutorService which has been pre-registered with the ShutdownManager.- Parameters:
poolSize- The size of the ScheduledExecutorService thread pool.threadNamePrefix- The thread name prefix to use when generating new threads.- Returns:
- A non null ScheduledExecutorService
- See Also:
Executors.newScheduledThreadPool(int)
-
createFixedThreadPool
ExecutorService createFixedThreadPool(int pool, ThreadFactory factory)
Creates a fixed size Thread Pool ExecutorService which has been pre-registered with theShutdownManager.- Parameters:
pool- The size of the pool to create.factory- TheThreadFactoryused to generate new threads.- Returns:
- Non null.
-
createFixedThreadPool
ExecutorService createFixedThreadPool(int pool, String threadNamePrefix)
Create a fixed size Thread Pool ExecutorService using the provided name as the prefix of the thread names.- Parameters:
pool- Size of the fixed pool.threadNamePrefix- The thread name prefix to use when generating new threads.- Returns:
- Non null.
- See Also:
createFixedThreadPool(int, java.util.concurrent.ThreadFactory)
-
createCachedThreadPool
ExecutorService createCachedThreadPool(ThreadFactory factory)
Generates a Cached Thread Pool ExecutorService which has been pre-registered with the ShutdownManager. The provided ThreadFactory is used by the service when creating Threads.- Parameters:
factory- The ThreadFactory that will be used when generating threads. May not be null.- Returns:
- A non null ExecutorService.
- See Also:
Executors.newCachedThreadPool(java.util.concurrent.ThreadFactory)
-
createCachedThreadPool
ExecutorService createCachedThreadPool(String threadNamePrefix)
Generates a Cached Thread Pool ExecutorService using the provided name as a prefix of the thread names.- Parameters:
threadNamePrefix- The thread name prefix to use when generating new threads.- Returns:
- Non null.
- See Also:
createCachedThreadPool(java.util.concurrent.ThreadFactory)
-
createThreadPool
ExecutorService createThreadPool(int coreSize, int maxSize, long idleTimeout, TimeUnit timeoutTimeunit, BlockingQueue<Runnable> runnables, String threadNamePrefix)
Generates a ThreadPoolExecutor with the provided values, and registers that executor as listening for shutdown messages.- Parameters:
coreSize- the number of threads to keep in the pool, even if they are idlemaxSize- Max number of threads in the poolidleTimeout- When the number of threads is greater than core, maximum time that excess idle threads will wait before terminatingtimeoutTimeunit- The time unit for the idleTimeout argumentrunnables- Queue of threads to be runthreadNamePrefix- The thread name prefix to use when generating new threads.- Returns:
- a configured ExecutorService, registered to listen to shutdown messages.
-
-