org.jboss.remoting.util
Class NamingThreadFactory

java.lang.Object
  extended by org.jboss.remoting.util.NamingThreadFactory
All Implemented Interfaces:
ThreadFactory

public final class NamingThreadFactory
extends Object
implements ThreadFactory

A wrapper ThreadFactory that gives the threads a sensible name.


Constructor Summary
NamingThreadFactory(ThreadFactory delegate, String namePattern)
          Create a new instance.
 
Method Summary
 Thread newThread(Runnable r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamingThreadFactory

public NamingThreadFactory(ThreadFactory delegate,
                           String namePattern)
Create a new instance. The pattern is a format string such as one would provide to String.format(String, Object[]). The format string should contain one %s which will be replaced with the original thread name.

Parameters:
delegate - the thread factory to actually use to produce the thread
namePattern - the name pattern to apply
Method Detail

newThread

public Thread newThread(Runnable r)
Specified by:
newThread in interface ThreadFactory


Copyright © 2008 JBoss, a division of Red Hat, Inc.