com.iparelan.util
Class ConcurrencyTools
java.lang.Object
com.iparelan.util.ConcurrencyTools
@Copyright(value="Copyright © 2008, Iparelan Solutions, LLC. All rights reserved.")
public final class ConcurrencyTools
- extends Object
This utility class contains concurrency convenience algorithms.
- Version:
- July 2008
- Author:
- Greg Mattes
Method Summary |
static
|
newThreadPoolProxy(String poolName,
T toProxy)
Creates a Proxy for toProxy that routes
method invocations through a thread pool. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGGER_NAME
public static final String LOGGER_NAME
- See Also:
- Constant Field Values
LOGGER
static final Logger LOGGER
ConcurrencyTools
public ConcurrencyTools()
newThreadPoolProxy
public static <T> T newThreadPoolProxy(String poolName,
T toProxy)
- Creates a
Proxy
for toProxy
that routes
method invocations through a thread pool.
- Parameters:
poolName
- The name of the thread pool. May not be null
.toProxy
- The object for which to create a dynamic proxy. May not be
null
.
- Returns:
- A proxy for
toProxy
. Never null
.
- Throws:
IllegalArgumentException
- Iff a dynamic proxy cannot be created.- To Do:
- Allow a thread pool (not just a thread pool name) to be injected
into this method? Allow sharing of a thread pool among several
proxies?
- For each thread:
setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)
Copyright © 2008 Iparelan Solutions, LLC. All rights reserved.