org.jboss.dtf.testframework.coordinator2.scheduler
Class Scheduler

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.jboss.dtf.testframework.coordinator2.scheduler.Scheduler
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable, java.rmi.Remote, SchedulerInterface

public class Scheduler
extends java.rmi.server.UnicastRemoteObject
implements SchedulerInterface, java.lang.Runnable

This class manages the scheduling of test runs.

Author:
Richard A. Begg
See Also:
Serialized Form

Field Summary
static java.lang.String SCHEDULER_NAME_SERVICE_NAME
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
Scheduler(Coordinator coordinator, ProductRepositoryInterface productRepository)
           
 
Method Summary
 ScheduleInformation[] getSchedule()
           
 boolean hasScheduledTests()
           
 void notifyStatus(boolean busy)
          Called by the coordinator to notify the scheduler when it is busy and when it is idle.
 void run()
           
 void schedule(CoordinatorInterface coordinator, ScheduleInformation scheduleInfo)
          Adds the given schedule information to the diary.
 boolean unschedule(long scheduleId)
           
 boolean unschedule(ScheduleInformation scheduleInfo)
           
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SCHEDULER_NAME_SERVICE_NAME

public static final java.lang.String SCHEDULER_NAME_SERVICE_NAME
See Also:
Constant Field Values
Constructor Detail

Scheduler

public Scheduler(Coordinator coordinator,
                 ProductRepositoryInterface productRepository)
          throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

notifyStatus

public void notifyStatus(boolean busy)
Called by the coordinator to notify the scheduler when it is busy and when it is idle.

Parameters:
busy - - true when the coordinator is busy.

hasScheduledTests

public boolean hasScheduledTests()

getSchedule

public ScheduleInformation[] getSchedule()
                                  throws java.rmi.RemoteException
Specified by:
getSchedule in interface SchedulerInterface
Throws:
java.rmi.RemoteException

schedule

public void schedule(CoordinatorInterface coordinator,
                     ScheduleInformation scheduleInfo)
              throws java.rmi.RemoteException
Adds the given schedule information to the diary.

Specified by:
schedule in interface SchedulerInterface
Parameters:
scheduleInfo -
Throws:
java.rmi.RemoteException

unschedule

public boolean unschedule(ScheduleInformation scheduleInfo)
                   throws java.rmi.RemoteException
Specified by:
unschedule in interface SchedulerInterface
Throws:
java.rmi.RemoteException

unschedule

public boolean unschedule(long scheduleId)
                   throws java.rmi.RemoteException
Specified by:
unschedule in interface SchedulerInterface
Throws:
java.rmi.RemoteException