java.lang.Object
org.rrd4j.core.RrdSyncThreadPool.DaemonThreadFactory
- All Implemented Interfaces:
ThreadFactory
- Enclosing class:
RrdSyncThreadPool
Daemon thread factory used by the monitor executors.
This factory creates all new threads used by an Executor in the same ThreadGroup. If there is a SecurityManager, it uses the group of System.getSecurityManager(), else the group of the thread instantiating this DaemonThreadFactory. Each new thread is created as a daemon thread with priority Thread.NORM_PRIORITY. New threads have names accessible via Thread.getName() of "<pool-name> Pool [Thread-M]", where M is the sequence number of the thread created by this factory.
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ThreadGroupThread group(package private) final StringPool name(package private) final AtomicIntegerThread numberConstructor Summary
ConstructorsConstructorDescriptionDaemonThreadFactory(String poolName) Create a factory naming the threads it produces.Method Summary
All Methods
Field Details
group
Thread groupthreadNumber
Thread numberpoolName
Pool name
Constructor Details
DaemonThreadFactory
DaemonThreadFactory(String poolName) Create a factory naming the threads it produces.- Parameters:
poolName- the name prefixed to each created thread's name
Method Details
newThread
Create a daemon thread in this factory's group, with the next number in sequence.- Specified by:
newThreadin interfaceThreadFactory- Parameters:
r- the task the new thread will run- Returns:
- the created thread, not yet started