org.alfresco.util
Class TraceableThreadFactory

java.lang.Object
  extended by org.alfresco.util.TraceableThreadFactory
All Implemented Interfaces:
java.util.concurrent.ThreadFactory

public class TraceableThreadFactory
extends java.lang.Object
implements java.util.concurrent.ThreadFactory

A thread factory that spawns threads that are statically visible. Each factory uses a unique thread group. All the groups that have been used can be fetched using TraceableThreadFactory.getActiveThreadGroups(), allowing iteration of the the threads in the group.

Since:
2.1

Constructor Summary
TraceableThreadFactory()
           
 
Method Summary
static java.util.List getActiveThreadGroups()
          Get a list of thread groups registered by the factory.
 java.lang.String getNamePrefix()
           
 java.lang.Thread newThread(java.lang.Runnable r)
           
 void setNamePrefix(java.lang.String namePrefix)
           
 void setThreadDaemon(boolean daemon)
           
 void setThreadPriority(int threadPriority)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraceableThreadFactory

public TraceableThreadFactory()
Method Detail

getActiveThreadGroups

public static java.util.List getActiveThreadGroups()
Get a list of thread groups registered by the factory.

Returns:
Returns a snapshot of thread groups

setThreadDaemon

public void setThreadDaemon(boolean daemon)
Parameters:
daemon - true if all threads created must be daemon threads

setThreadPriority

public void setThreadPriority(int threadPriority)
Parameters:
threadPriority - the threads priority from 1 (lowest) to 10 (highest)

newThread

public java.lang.Thread newThread(java.lang.Runnable r)
Specified by:
newThread in interface java.util.concurrent.ThreadFactory

setNamePrefix

public void setNamePrefix(java.lang.String namePrefix)

getNamePrefix

public java.lang.String getNamePrefix()


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.