Package org.gbif.utils.concurrent
Class NamedThreadFactory
java.lang.Object
org.gbif.utils.concurrent.NamedThreadFactory
- All Implemented Interfaces:
ThreadFactory
Modified Executors DefaultThreadFactory to allow custom named thread pools.
Otherwise, this factory yields the same semantics as the thread factory returned by
Executors.defaultThreadFactory().
Optionally a priority or daemon flag can be provided.-
Constructor Summary
ConstructorsConstructorDescriptionNamedThreadFactory(String poolName) Creates a new named user thread factory using a normal priority.NamedThreadFactory(String poolName, int priority, boolean daemon) Creates a new named thread factory using explicit priority and daemon settings. -
Method Summary
-
Constructor Details
-
NamedThreadFactory
Creates a new named user thread factory using a normal priority.- Parameters:
poolName- the name prefix of the thread pool which will be appended -number for the individual thread
-
NamedThreadFactory
Creates a new named thread factory using explicit priority and daemon settings.
-
-
Method Details
-
newThread
- Specified by:
newThreadin interfaceThreadFactory
-