org.apache.ws.util.thread
Class NamedThread.ConcurrentThreadFactory

java.lang.Object
  extended byorg.apache.ws.util.thread.NamedThread.ConcurrentThreadFactory
All Implemented Interfaces:
EDU.oswego.cs.dl.util.concurrent.ThreadFactory
Enclosing class:
NamedThread

public static class NamedThread.ConcurrentThreadFactory
extends java.lang.Object
implements EDU.oswego.cs.dl.util.concurrent.ThreadFactory

A thread factory for use with the Concurrent API. This factory creates threads of type NamedThread and provides the ability to name the threads via the base name facility of NamedThread. Threads created by this factory may be daemon threads if desired (see ConcurrentThreadFactory#ConcurrentThreadFactory(String, boolean)).


Constructor Summary
NamedThread.ConcurrentThreadFactory()
          Creates a factory that does not define a base name for the user threads it will create.
NamedThread.ConcurrentThreadFactory(boolean isDaemon)
          Creates a factory that does not define a base name for the threads it will create but explicitly defines whether or not the threads will be daemon or user threads.
NamedThread.ConcurrentThreadFactory(java.lang.String baseName)
          Creates a factory that defines a base name for the user threads it will create.
NamedThread.ConcurrentThreadFactory(java.lang.String baseName, boolean isDaemon)
          Creates a factory that defines the new threads' base names and whether or not the threads to be created will be daemon or user threads.
 
Method Summary
 java.lang.Thread newThread(java.lang.Runnable command)
          Creates a NamedThread using this factory's base name as the new thread's base name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedThread.ConcurrentThreadFactory

public NamedThread.ConcurrentThreadFactory()
Creates a factory that does not define a base name for the user threads it will create.


NamedThread.ConcurrentThreadFactory

public NamedThread.ConcurrentThreadFactory(java.lang.String baseName)
Creates a factory that defines a base name for the user threads it will create.

Parameters:
baseName - the base name used for all threads created by this factory (may be null)
See Also:
NamedThread.getBaseName()

NamedThread.ConcurrentThreadFactory

public NamedThread.ConcurrentThreadFactory(boolean isDaemon)
Creates a factory that does not define a base name for the threads it will create but explicitly defines whether or not the threads will be daemon or user threads.

Parameters:
isDaemon - if true then all threads created by this factory will be daemon threads.

NamedThread.ConcurrentThreadFactory

public NamedThread.ConcurrentThreadFactory(java.lang.String baseName,
                                           boolean isDaemon)
Creates a factory that defines the new threads' base names and whether or not the threads to be created will be daemon or user threads.

Parameters:
baseName - the base name used for all threads created by this factory (may be null)
isDaemon - if true then all threads created by this factory will be daemon threads.
Method Detail

newThread

public java.lang.Thread newThread(java.lang.Runnable command)
Creates a NamedThread using this factory's base name as the new thread's base name.

Specified by:
newThread in interface EDU.oswego.cs.dl.util.concurrent.ThreadFactory
See Also:
ThreadFactory.newThread(java.lang.Runnable), NamedThread.NamedThread(Runnable, String), NamedThread.getBaseName()


Copyright © 2004-2005 Apache Software Foundation. All Rights Reserved.