com.google.common.util.concurrent
Class DaemonThreadFactory

java.lang.Object
  extended by 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

Constructor Summary
DaemonThreadFactory(ThreadFactory factory)
           
 
Method Summary
 Thread newThread(Runnable r)
          Constructs a new Thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DaemonThreadFactory

public DaemonThreadFactory(ThreadFactory factory)
Method Detail

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