Package com.yahoo.concurrent
Class DaemonThreadFactory
- java.lang.Object
-
- com.yahoo.concurrent.DaemonThreadFactory
-
- All Implemented Interfaces:
java.util.concurrent.ThreadFactory
public class DaemonThreadFactory extends java.lang.Object implements java.util.concurrent.ThreadFactory
A simple thread factory that decoratesExecutors.defaultThreadFactory()
and sets all created threads to be daemon threads.- Author:
- Einar M R Rosenvinge
-
-
Constructor Summary
Constructors Constructor Description DaemonThreadFactory()
Creates a deamon thread factory that creates threads with the default names provided byExecutors.defaultThreadFactory()
.DaemonThreadFactory(java.lang.String prefix)
Creates a deamon thread factory that creates threads with the default names provided byExecutors.defaultThreadFactory()
prepended by the specified prefix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getPrefix()
java.lang.Thread
newThread(java.lang.Runnable runnable)
-
-
-
Constructor Detail
-
DaemonThreadFactory
public DaemonThreadFactory()
Creates a deamon thread factory that creates threads with the default names provided byExecutors.defaultThreadFactory()
.
-
DaemonThreadFactory
public DaemonThreadFactory(java.lang.String prefix)
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
-
-