com.google.common.util.concurrent
Class DaemonThreadFactory
java.lang.Object
com.google.common.util.concurrent.DaemonThreadFactory
- All Implemented Interfaces:
- ThreadFactory
@Beta
public class DaemonThreadFactory
- extends Object
- implements ThreadFactory
Wraps another ThreadFactory
, making all new threads daemon threads.
- Since:
- 1
- Author:
- Charles Fry, Harendra Verma
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DaemonThreadFactory
public DaemonThreadFactory(ThreadFactory factory)
newThread
public Thread newThread(Runnable r)
- Description copied from interface:
java.util.concurrent.ThreadFactory
- Constructs a new
Thread
. Implementations may also initialize
priority, name, daemon status, ThreadGroup
, etc.
- Specified by:
newThread
in interface ThreadFactory
- Parameters:
r
- a runnable to be executed by new thread instance
- Returns:
- constructed thread, or
null
if the request to
create a thread is rejected