|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ThreadPoolFactory
Factory interface for creating/obtaining named thread pools.
Method Summary | |
---|---|
ExecutorService |
getCachedTreadPool(String name)
Signal that the supplied thread pool is no longer needed. |
ExecutorService |
getScheduledThreadPool(String name)
Obtain a scheduled thread pool with the supplied name, or create and return one if no thread pool exists with that name. |
ExecutorService |
getThreadPool(String name)
Obtain a thread pool with the supplied name, or create and return one if no thread pool exists with that name. |
void |
releaseThreadPool(ExecutorService pool)
Performs a ExecutorService.shutdownNow() on the given pool, if the pool has been created
previously by this class. |
void |
terminateAllPools(long maxWaitTime,
TimeUnit timeUnit)
Terminates all the existing thread pool, by waiting for them maximum maxWaitTimeMillis milliseconds, after which
calling ExecutorService.shutdownNow() . |
Method Detail |
---|
ExecutorService getThreadPool(String name)
released
.
name
- the name of the thread pool; may not be null
ExecutorService getCachedTreadPool(String name)
released
.
name
- the name of the thread pool; may not be null
ExecutorService getScheduledThreadPool(String name)
released
.
name
- the name of the thread pool; may not be null
void releaseThreadPool(ExecutorService pool)
ExecutorService.shutdownNow()
on the given pool, if the pool has been created
previously by this class. Clients which use this method should handle, if necessary, any potential
InterruptedException
pool
- the pool that is no longer neededvoid terminateAllPools(long maxWaitTime, TimeUnit timeUnit)
maxWaitTimeMillis
milliseconds, after which
calling ExecutorService.shutdownNow()
.
maxWaitTime
- the maximum amount of time that should be given to the pools to shutdown on their own; must be
non-negativetimeUnit
- the unit of time for the maxWaitTime
parameter
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |