public interface DwAsyncPool
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
Blocks until all tasks have completed execution after a shutdown request, or
the timeout occurs, or the current thread is interrupted, whichever happens
first.
|
int |
getActiveCount()
Returns the approximate number of threads that are actively executing tasks.
|
long |
getCompletedTaskCount()
Returns the approximate total number of tasks that have completed execution.
|
int |
getCorePoolSize()
Returns the core number of threads.
|
int |
getPoolSize()
Returns the current number of threads in the pool.
|
long |
getTaskCount()
Returns the approximate total number of tasks that have ever been scheduled
for execution.
|
boolean |
isShutdown()
Returns true if the pool has been shut down (orderly).
|
boolean |
isTerminated()
Returns true if the pool has been terminated
|
void |
shutdown()
Initiates an orderly shutdown in which previously submitted tasks are
executed, but no new tasks will be accepted.
|
java.util.List<java.lang.Runnable> |
shutdownNow()
Attempts to stop all actively executing tasks, halts the processing of
waiting tasks, and returns a list of the tasks that were awaiting execution.
|
<T> java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> task)
Submits a value-returning task for execution and returns a Future
representing the pending results of the task.
|
<T> java.util.concurrent.Future<T> |
submit(java.lang.Runnable task)
Submits a Runnable task for execution and returns a Future representing that
task.
|
<T> java.util.concurrent.Future<T> |
submit(java.lang.Runnable task,
T result)
Submits a Runnable task for execution and returns a Future representing that
task.
|
<T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
task
- ExecutorService.submit(Callable)
<T> java.util.concurrent.Future<T> submit(java.lang.Runnable task)
task
- ExecutorService.submit(Runnable)
<T> java.util.concurrent.Future<T> submit(java.lang.Runnable task, T result)
task
- ExecutorService.submit(Runnable, Object)
int getActiveCount()
ThreadPoolExecutor.getActiveCount()
long getTaskCount()
ThreadPoolExecutor.getTaskCount()
long getCompletedTaskCount()
ThreadPoolExecutor.getCompletedTaskCount()
int getPoolSize()
ThreadPoolExecutor.getPoolSize()
int getCorePoolSize()
ThreadPoolExecutor.getCorePoolSize()
boolean isShutdown()
boolean isTerminated()
boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
timeout
- unit
- java.lang.InterruptedException
ExecutorService.awaitTermination(long, TimeUnit)
void shutdown()
This method does not wait for previously submitted tasks to complete
execution. Use awaitTermination
to do that.
ExecutorService.shutdown()
java.util.List<java.lang.Runnable> shutdownNow()
This method does not wait for actively executing tasks to terminate. Use
awaitTermination
to do that.
There are no guarantees beyond best-effort attempts to stop processing
actively executing tasks. For example, typical implementations will cancel
via Thread.interrupt()
, so any task that fails to respond to interrupts
may never terminate.
ExecutorService.shutdownNow()