ThreadFactory


ThreadFactory java.util.concurrent

Java 5.0

An instance of this interface is an object that creates Thread objects to run Runnable objects. You might define a THReadFactory if you want to set the priority, name , or ThreadGroup of the threads used by a ThreadPoolExecutor , for example. A number of the factory methods of the Executors utility class rely on THReadPoolExecutor and accept a ThreadFactory argument.

 public interface  ThreadFactory  {  // Public Instance Methods  Thread  newThread  (Runnable  r  );   } 

Passed To

Executors.{newCachedThreadPool( ) , newFixedThreadPool( ) , newScheduledThreadPool( ) , newSingleThreadExecutor( ) , newSingleThreadScheduledExecutor( )} , ScheduledThreadPoolExecutor.ScheduledThreadPoolExecutor( ) , ThreadPoolExecutor.{setThreadFactory( ) , ThreadPoolExecutor( )}

Returned By

Executors.{defaultThreadFactory( ) , privilegedThreadFactory( )} , ThreadPoolExecutor.getThreadFactory( )



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net