Package nl.vpro.util
Class ThreadPools
java.lang.Object
nl.vpro.util.ThreadPools
Utilities related to ThreadPools
Perhaps this can be deprecated in favour of
ForkJoinPool.commonPool()
?- Since:
- 1.5
- Author:
- Michiel Meeuwissen
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ScheduledExecutorService
A scheduled executor service with fixed pool size, so should be used to schedule short-lived background tasks only.static final ThreadPoolExecutor
An executor service used for 'copy' threads.static final ThreadPoolExecutor
An executor service used for relatively long-lived background jobs.static final ThreadPoolExecutor
An executor service used for threads running during bootstrap of the application.static final ThreadGroup
-
Method Summary
Modifier and TypeMethodDescriptionstatic ThreadFactory
createThreadFactory
(String namePrefix, boolean daemon, int priority) static ThreadFactory
createThreadFactory
(ThreadGroup threadGroup, String namePrefix, boolean daemon, int priority) static void
shutdown()
-
Field Details
-
THREAD_GROUP
-
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
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
A scheduled executor service with fixed pool size, so should be used to schedule short-lived background tasks only. -
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 Details
-
createThreadFactory
-
createThreadFactory
public static ThreadFactory createThreadFactory(ThreadGroup threadGroup, String namePrefix, boolean daemon, int priority) -
shutdown
public static void shutdown()
-