com.ch.odi.parallel
Class ParallelScheduler

java.lang.Object
  |
  +--com.ch.odi.parallel.ParallelScheduler

public class ParallelScheduler
extends Object


Constructor Summary
ParallelScheduler(JobFactory jf)
          Creates a new Scheduler that uses the specified factory to produce jobs.
ParallelScheduler(JobFactory jf, int maxThreads)
          Creates a new Scheduler that uses the specified factory to produce jobs.
 
Method Summary
 void addSchedulerListener(SchedulerListener listener)
           
 void notifyJobEnd(ParallelJob job)
          Called by the ParallelJob class to notify this scheduler that a thread has ended.
 void removeSchedulerListener(SchedulerListener listener)
           
 void run()
          Starts the scheduler.
 void setMaxThreads(int maxThreads)
          Sets the maximum number of threads that are running at the same time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParallelScheduler

public ParallelScheduler(JobFactory jf)
Creates a new Scheduler that uses the specified factory to produce jobs. The thread limit (setMaxThreads) is set to 1.

ParallelScheduler

public ParallelScheduler(JobFactory jf,
                         int maxThreads)
Creates a new Scheduler that uses the specified factory to produce jobs. Specifies a limit for the maximum number of threads running.
Method Detail

setMaxThreads

public void setMaxThreads(int maxThreads)
Sets the maximum number of threads that are running at the same time.

notifyJobEnd

public void notifyJobEnd(ParallelJob job)
Called by the ParallelJob class to notify this scheduler that a thread has ended.

addSchedulerListener

public void addSchedulerListener(SchedulerListener listener)

removeSchedulerListener

public void removeSchedulerListener(SchedulerListener listener)

run

public void run()
Starts the scheduler.