Package com.mchange.v2.async
Class ThreadPoolAsynchronousRunner
java.lang.Object
com.mchange.v2.async.ThreadPoolAsynchronousRunner
- All Implemented Interfaces:
ClosableResource,AsynchronousRunner,ThreadPoolReportingAsynchronousRunner
public final class ThreadPoolAsynchronousRunner
extends Object
implements ThreadPoolReportingAsynchronousRunner
-
Constructor Summary
ConstructorsConstructorDescriptionThreadPoolAsynchronousRunner(int num_threads, boolean daemon) ThreadPoolAsynchronousRunner(int num_threads, boolean daemon, int max_individual_task_time, int deadlock_detector_interval, int interrupt_delay_after_apparent_deadlock) ThreadPoolAsynchronousRunner(int num_threads, boolean daemon, int max_individual_task_time, int deadlock_detector_interval, int interrupt_delay_after_apparent_deadlock, String threadLabel) ThreadPoolAsynchronousRunner(int num_threads, boolean daemon, int max_individual_task_time, int deadlock_detector_interval, int interrupt_delay_after_apparent_deadlock, Timer myTimer) ThreadPoolAsynchronousRunner(int num_threads, boolean daemon, int max_individual_task_time, int deadlock_detector_interval, int interrupt_delay_after_apparent_deadlock, Timer myTimer, String threadLabel) ThreadPoolAsynchronousRunner(int num_threads, boolean daemon, Timer sharedTimer) ThreadPoolAsynchronousRunner(int num_threads, boolean daemon, Timer sharedTimer, String threadLabel) -
Method Summary
-
Constructor Details
-
ThreadPoolAsynchronousRunner
-
ThreadPoolAsynchronousRunner
public ThreadPoolAsynchronousRunner(int num_threads, boolean daemon, int max_individual_task_time, int deadlock_detector_interval, int interrupt_delay_after_apparent_deadlock, Timer myTimer) -
ThreadPoolAsynchronousRunner
public ThreadPoolAsynchronousRunner(int num_threads, boolean daemon, int max_individual_task_time, int deadlock_detector_interval, int interrupt_delay_after_apparent_deadlock, String threadLabel) -
ThreadPoolAsynchronousRunner
public ThreadPoolAsynchronousRunner(int num_threads, boolean daemon, int max_individual_task_time, int deadlock_detector_interval, int interrupt_delay_after_apparent_deadlock) -
ThreadPoolAsynchronousRunner
-
ThreadPoolAsynchronousRunner
-
ThreadPoolAsynchronousRunner
public ThreadPoolAsynchronousRunner(int num_threads, boolean daemon)
-
-
Method Details
-
postRunnable
- Specified by:
postRunnablein interfaceAsynchronousRunner
-
getThreadCount
public int getThreadCount()- Specified by:
getThreadCountin interfaceThreadPoolReportingAsynchronousRunner
-
close
public void close(boolean skip_remaining_tasks) Description copied from interface:AsynchronousRunnerFinish with this AsynchronousRunner, and clean-up any Threads or resources it may hold.- Specified by:
closein interfaceAsynchronousRunner- 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.
-
close
public void close()Description copied from interface:AsynchronousRunnerClean-up resources held by this asynchronous runner as soon as possible. Remaining tasks are skipped if possible, and any tasks executing when close() is called may or may not be interrupted. Equivalent to close( true ).- Specified by:
closein interfaceAsynchronousRunner- Specified by:
closein interfaceClosableResource
-
getActiveCount
public int getActiveCount()- Specified by:
getActiveCountin interfaceThreadPoolReportingAsynchronousRunner
-
getIdleCount
public int getIdleCount()- Specified by:
getIdleCountin interfaceThreadPoolReportingAsynchronousRunner
-
getPendingTaskCount
public int getPendingTaskCount()- Specified by:
getPendingTaskCountin interfaceThreadPoolReportingAsynchronousRunner
-
getStatus
- Specified by:
getStatusin interfaceThreadPoolReportingAsynchronousRunner
-
getStackTraces
- Specified by:
getStackTracesin interfaceThreadPoolReportingAsynchronousRunner
-
getMultiLineStatusString
-