public interface DwAsyncService
ExecutorService
) can be
created.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
|
boolean poolExists(java.lang.String poolToken)
poolToken
- The pool identifierDwAsyncPool initPool(java.lang.String poolToken, PoolConfiguration configuration)
poolToken
- configuration
- DwAsyncPool getPool(java.lang.String poolToken)
poolToken
- void shutdownPool(java.lang.String poolToken)
poolToken
- ExecutorService.shutdown()
java.util.List<java.lang.Runnable> shutdownPoolNow(java.lang.String poolToken)
poolToken
- ExecutorService.shutdownNow()
boolean awaitTerminationForPool(java.lang.String poolToken, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
poolToken
- The pool identifiertimeout
- unit
- java.lang.InterruptedException
ExecutorService.awaitTermination(long, TimeUnit)
boolean isShutdownPool(java.lang.String poolToken)
poolToken
- ExecutorService.isShutdown()
boolean isTerminatedPool(java.lang.String poolToken)
poolToken
- int getNrOfPools()
int getActiveCountAll()
long getTaskCountAll()
long getCompletedTaskCountAll()
void shutdownAll()
DwAsyncPool.shutdown()
java.util.List<java.lang.Runnable> shutdownAllNow()
DwAsyncPool.shutdownNow()
void submit(java.lang.Runnable task)
task
- void suhtdownDefault()
java.util.List<java.lang.Runnable> shutdownNowDefault()