com.virtuosotechnologies.lib.asyncjob
Class ThreadWorkerAsyncJobRunner

java.lang.Object
  extended bycom.virtuosotechnologies.lib.asyncjob.AbstractAsyncJobRunner
      extended bycom.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.


Nested Class Summary
 
Nested classes inherited from class com.virtuosotechnologies.lib.asyncjob.AbstractAsyncJobRunner
AbstractAsyncJobRunner.ExecutionImpl
 
Constructor Summary
ThreadWorkerAsyncJobRunner(int numThreads)
          Constructor
 
Method Summary
 void shutDown()
          Shut down the runner once the jobs are done.
 AsyncJobExecution startJob(AsyncJob job)
          Start a job
 
Methods inherited from class com.virtuosotechnologies.lib.asyncjob.AbstractAsyncJobRunner
addAsyncJobListener, removeAsyncJobListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadWorkerAsyncJobRunner

public ThreadWorkerAsyncJobRunner(int numThreads)
Constructor

Parameters:
numThreads - number of threads in the thread pool
Method Detail

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.