com.iparelan.util
Class ConcurrencyTools.ThreadPoolProxyThreadFactory
java.lang.Object
com.iparelan.util.ConcurrencyTools.ThreadPoolProxyThreadFactory
- All Implemented Interfaces:
- ThreadFactory
- Enclosing class:
- ConcurrencyTools
private static final class ConcurrencyTools.ThreadPoolProxyThreadFactory
- extends Object
- implements ThreadFactory
The default thread factory
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
poolName
private final String poolName
nextSequenceNumber
private final AtomicInteger nextSequenceNumber
ConcurrencyTools.ThreadPoolProxyThreadFactory
ConcurrencyTools.ThreadPoolProxyThreadFactory(String poolName)
- Creates a
ThreadPoolProxyThreadFactory
.
- Parameters:
poolName
- The name of the thread pool. May be neither null
nor
the empty string.
- Throws:
ValidationException
- Iff poolName
is either null
or the empty
string.
newThread
public Thread newThread(Runnable runnable)
- Produces a new
Thread
.
- Specified by:
newThread
in interface ThreadFactory
- Parameters:
runnable
- Defines the work to be done by the new Thread
. May
not be null
.
- Returns:
- A new
Thread
. Never null
. - To Do:
- Consider
setDaemon(true)
for thread pool
threads. Obviates need to shutdown()
explicitly?
better/easily resource management? could cause some final
operations to be abandoned silently before completed...
Copyright © 2008 Iparelan Solutions, LLC. All rights reserved.