com.virtuosotechnologies.lib.asyncjob
Class ThreadWorkerAsyncJobRunner
java.lang.Object
com.virtuosotechnologies.lib.asyncjob.AbstractAsyncJobRunner
com.virtuosotechnologies.lib.asyncjob.ThreadWorkerAsyncJobRunner
- All Implemented Interfaces:
- AsyncJobRunner
- public class ThreadWorkerAsyncJobRunner
- extends AbstractAsyncJobRunner
AsyncJobRunner that queues jobs and runs them in a pool of threads.
This class is fully synchronized and thread safe.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadWorkerAsyncJobRunner
public ThreadWorkerAsyncJobRunner(int numThreads)
- Constructor
- Parameters:
numThreads
- number of threads in the thread pool
startJob
public AsyncJobExecution startJob(AsyncJob job)
- Start a job
- Parameters:
job
- job to start
- Returns:
- an object to use to track execution progress
shutDown
public void shutDown()
- Shut down the runner once the jobs are done.