Package nl.vpro.util
Class ThreadPools
- java.lang.Object
-
- nl.vpro.util.ThreadPools
-
public final class ThreadPools extends Object
Utilities related to ThreadPools Perhaps this can be deprecated in favour ofForkJoinPool.commonPool()
?- Since:
- 1.5
- Author:
- Michiel Meeuwissen
-
-
Field Summary
Fields Modifier and Type Field Description static ScheduledExecutorService
backgroundExecutor
A scheduled executor service with fixed pool size, so should be used to schedule short-lived background tasks only.static ThreadPoolExecutor
copyExecutor
An executor service used for 'copy' threads.static ThreadPoolExecutor
longBackgroundExecutor
An executor service used for relatively long-lived background jobs.static ThreadPoolExecutor
startUpExecutor
An executor service used for threads running during bootstrap of the application.static ThreadGroup
THREAD_GROUP
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ThreadFactory
createThreadFactory(String namePrefix, boolean daemon, int priority)
static ThreadFactory
createThreadFactory(ThreadGroup threadGroup, String namePrefix, boolean daemon, int priority)
static void
shutdown()
-
-
-
Field Detail
-
THREAD_GROUP
public static final ThreadGroup THREAD_GROUP
-
copyExecutor
public static final ThreadPoolExecutor copyExecutor
An executor service used for 'copy' threads. Mainly inCopier
, but it can be used for similar processes.These may be quite long-lived thread, performing simple jobs like copying streams.
-
longBackgroundExecutor
public static final ThreadPoolExecutor longBackgroundExecutor
An executor service used for relatively long-lived background jobs.These may be quite long-lived thread, performing more complex jobs like complicated SQL queries.
- Since:
- 3.0
-
backgroundExecutor
public static final ScheduledExecutorService backgroundExecutor
A scheduled executor service with fixed pool size, so should be used to schedule short-lived background tasks only.
-
startUpExecutor
public static final ThreadPoolExecutor startUpExecutor
An executor service used for threads running during bootstrap of the application. Core size is 0, so that after a few minutes (when all is up) all threads will be shut down.
-
-
Method Detail
-
createThreadFactory
public static ThreadFactory createThreadFactory(String namePrefix, boolean daemon, int priority)
-
createThreadFactory
public static ThreadFactory createThreadFactory(ThreadGroup threadGroup, String namePrefix, boolean daemon, int priority)
-
shutdown
public static void shutdown()
-
-