Package org.alfresco.util
Class TraceableThreadFactory
java.lang.Object
org.alfresco.util.TraceableThreadFactory
- All Implemented Interfaces:
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
getActiveThreadGroups()
, allowing iteration of the the threads in the group.- Since:
- 2.1
- Author:
- Derek Hulley
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<ThreadGroup>
Get a list of thread groups registered by the factory.void
setNamePrefix
(String namePrefix) void
setThreadDaemon
(boolean daemon) void
setThreadPriority
(int threadPriority)
-
Constructor Details
-
TraceableThreadFactory
public TraceableThreadFactory()
-
-
Method Details
-
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
- Specified by:
newThread
in interfaceThreadFactory
-
setNamePrefix
-
getNamePrefix
-