public class DwAsyncServiceImpl extends java.lang.Object implements DwAsyncService
| Constructor and Description |
|---|
DwAsyncServiceImpl(java.lang.Long waitBeforeForcedShutdown) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTerminationForPool(java.lang.String poolToken,
long timeout,
java.util.concurrent.TimeUnit unit)
Blocks until all tasks have completed execution after a shutdown request for
the given pool
|
int |
getActiveCountAll()
Returns the approximately number of active threads in all pools.
|
long |
getCompletedTaskCountAll()
Returns the approximate total number of tasks that have completed execution
summed over all pools.
|
int |
getNrOfPools()
Returns the number of pools
|
DwAsyncPool |
getPool(java.lang.String poolToken)
Returns the pool identified by poolToken or null.
|
long |
getTaskCountAll()
Returns the approximate total number of tasks that have ever been scheduled
for execution summed over all pools.
|
DwAsyncPool |
initPool(java.lang.String poolToken,
PoolConfiguration configuration)
Initializes a new pool for the given configuration.
|
boolean |
isShutdownPool(java.lang.String poolToken)
Returns true if the pool was asked to shutdown.
|
boolean |
isTerminatedPool(java.lang.String poolToken)
Returns true if all tasks have completed following shut down.
|
boolean |
poolExists(java.lang.String poolToken)
Returns true if pool identified by poolToken exists
|
void |
shutdownAll()
Calls shutdown on all pools.
|
java.util.List<java.lang.Runnable> |
shutdownAllNow()
Calls shutdownNow on all pools.
|
java.util.List<java.lang.Runnable> |
shutdownNowDefault()
Terminates the default thread pool.
|
void |
shutdownPool(java.lang.String poolToken)
If pool exists, the pool is asked to orderly shutdown.
|
java.util.List<java.lang.Runnable> |
shutdownPoolNow(java.lang.String poolToken)
If pool exists, the pool is shutdown immediately.
|
void |
submit(java.lang.Runnable task)
Submits a task to be run on the default thread pool
|
void |
suhtdownDefault()
Shuts down the default thread pool
|
public DwAsyncServiceImpl(java.lang.Long waitBeforeForcedShutdown)
public void shutdownAll()
DwAsyncServiceshutdownAll in interface DwAsyncServiceDwAsyncPool.shutdown()public java.util.List<java.lang.Runnable> shutdownAllNow()
DwAsyncServiceshutdownAllNow in interface DwAsyncServiceDwAsyncPool.shutdownNow()public boolean poolExists(java.lang.String poolToken)
DwAsyncServicepoolExists in interface DwAsyncServicepoolToken - The pool identifierpublic boolean isShutdownPool(java.lang.String poolToken)
DwAsyncServiceisShutdownPool in interface DwAsyncServiceExecutorService.isShutdown()public boolean isTerminatedPool(java.lang.String poolToken)
DwAsyncServiceisTerminatedPool in interface DwAsyncServicepublic DwAsyncPool initPool(java.lang.String poolToken, PoolConfiguration configuration)
DwAsyncServiceinitPool in interface DwAsyncServicepublic DwAsyncPool getPool(java.lang.String poolToken)
DwAsyncServicegetPool in interface DwAsyncServicepublic void shutdownPool(java.lang.String poolToken)
DwAsyncServiceshutdownPool in interface DwAsyncServiceExecutorService.shutdown()public java.util.List<java.lang.Runnable> shutdownPoolNow(java.lang.String poolToken)
DwAsyncServiceshutdownPoolNow in interface DwAsyncServiceExecutorService.shutdownNow()public boolean awaitTerminationForPool(java.lang.String poolToken,
long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
DwAsyncServiceawaitTerminationForPool in interface DwAsyncServicepoolToken - The pool identifierjava.lang.InterruptedExceptionExecutorService.awaitTermination(long, TimeUnit)public int getNrOfPools()
DwAsyncServicegetNrOfPools in interface DwAsyncServicepublic int getActiveCountAll()
DwAsyncServicegetActiveCountAll in interface DwAsyncServicepublic long getTaskCountAll()
DwAsyncServicegetTaskCountAll in interface DwAsyncServicepublic long getCompletedTaskCountAll()
DwAsyncServicegetCompletedTaskCountAll in interface DwAsyncServicepublic void submit(java.lang.Runnable task)
DwAsyncServicesubmit in interface DwAsyncServicepublic void suhtdownDefault()
DwAsyncServicesuhtdownDefault in interface DwAsyncServicepublic java.util.List<java.lang.Runnable> shutdownNowDefault()
DwAsyncServiceshutdownNowDefault in interface DwAsyncService