Package com.yahoo.concurrent
Class DaemonThreadFactory
java.lang.Object
com.yahoo.concurrent.DaemonThreadFactory
- All Implemented Interfaces:
ThreadFactory
A simple thread factory that decorates
Executors.defaultThreadFactory()
and sets all created threads to be daemon threads.- Author:
- Einar M R Rosenvinge
-
Constructor Summary
ConstructorDescriptionCreates a deamon thread factory that creates threads with the default names provided byExecutors.defaultThreadFactory()
.DaemonThreadFactory
(String prefix) Creates a deamon thread factory that creates threads with the default names provided byExecutors.defaultThreadFactory()
prepended by the specified prefix. -
Method Summary
-
Constructor Details
-
DaemonThreadFactory
public DaemonThreadFactory()Creates a deamon thread factory that creates threads with the default names provided byExecutors.defaultThreadFactory()
. -
DaemonThreadFactory
Creates a deamon thread factory that creates threads with the default names provided byExecutors.defaultThreadFactory()
prepended by the specified prefix.- Parameters:
prefix
- the thread name prefix to use
-
-
Method Details
-
getPrefix
-
newThread
- Specified by:
newThread
in interfaceThreadFactory
-