com.mchange.v2.async
Class ThreadPerTaskAsynchronousRunner
java.lang.Object
com.mchange.v2.async.ThreadPerTaskAsynchronousRunner
- All Implemented Interfaces:
- ClosableResource, AsynchronousRunner
public class ThreadPerTaskAsynchronousRunner
- extends java.lang.Object
- implements AsynchronousRunner
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadPerTaskAsynchronousRunner
public ThreadPerTaskAsynchronousRunner(int max_task_threads)
ThreadPerTaskAsynchronousRunner
public ThreadPerTaskAsynchronousRunner(int max_task_threads,
long interrupt_task_delay)
postRunnable
public void postRunnable(java.lang.Runnable r)
- Specified by:
postRunnable in interface AsynchronousRunner
close
public void close()
- Description copied from interface:
ClosableResource
- forces the release of any resources that might be
associated with this object.
- Specified by:
close in interface ClosableResource- Specified by:
close in interface AsynchronousRunner
close
public void close(boolean skip_remaining_tasks)
- Description copied from interface:
AsynchronousRunner
- Finish with this AsynchronousRunner, and clean-up
any Threads or resources it may hold.
- Specified by:
close in interface AsynchronousRunner
- Parameters:
skip_remaining_tasks - Should be regarded as
a hint, not a guarantee. If true, pending,
not-yet-performed tasks will be skipped,
if possible.
Currently executing tasks may or
may not be interrupted. If false, all
previously scheduled tasks will be
completed prior to clean-up. The method
returns immediately regardless.
getRunningCount
public int getRunningCount()
getRunningTasks
public java.util.Collection getRunningTasks()
getWaitingCount
public int getWaitingCount()
getWaitingTasks
public java.util.Collection getWaitingTasks()
isClosed
public boolean isClosed()
isDoneAndGone
public boolean isDoneAndGone()