org.ourgrid.mygrid.scheduler
Class SchedulerEventEngine

java.lang.Object
  extended by org.ourgrid.mygrid.scheduler.SchedulerEventEngine
All Implemented Interfaces:
java.lang.Runnable, EBSyncShutdownable, EventEngine<ActionEvent>, ShutdownEventEngine
Direct Known Subclasses:
FakeSchedulerEventEngine

public class SchedulerEventEngine
extends java.lang.Object
implements ShutdownEventEngine

This class is responsible for receiving events that come from the EBSchedulerFacade and process them.


Constructor Summary
SchedulerEventEngine(Scheduler scheduler, GumpManager gumpManager, GumpClient gridMachineConsumer, EBReplicaExecutorFacade ebReplicaExecutorFacade, EBSchedulerFacade ebSchedulerFacade)
          The constructor.
 
Method Summary
protected  EBSchedulingHeuristic createSchedulingHeuristic()
           
 GridManager getGridManager()
          Returns the EBGridManager.
 EBSchedulingHeuristic getHeuristic()
          Returns the EBSchedulingHeuristic.
 JobManager getJobManager()
          Returns the EBJobManager.
protected  EBReplicaExecutorFacade getReplicaExecutorFacade()
           
 boolean isAlive()
          Checks if the EBSyncShutdownable is alive.
 void putEvent(ActionEvent event)
          Puts an Event in the EventQueue.
 void run()
          The Thread behavior.
protected  boolean schedule(EBSchedulingHeuristic schedulingHeuristic)
           
 void shutdown(EventQueue<ShutdownResponseEvent> eq)
          Marks this Runnable to be shutdown and tries to unbind all remote objects.
 void startProcessing()
          Starts the SchedulerEventEngine Thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchedulerEventEngine

public SchedulerEventEngine(Scheduler scheduler,
                            GumpManager gumpManager,
                            GumpClient gridMachineConsumer,
                            EBReplicaExecutorFacade ebReplicaExecutorFacade,
                            EBSchedulerFacade ebSchedulerFacade)
                     throws ConfigException
The constructor.

Parameters:
scheduler - GuMManager accessible through RMI.
gumpManager - GuMPManager accessible through RMI.
gridMachineConsumer - GridMachineConsumer accessible through RMI.
ebReplicaExecutorFacade - The EBReplicaExecutorFacade
ebSchedulerFacade - The EBSchedulerFacade
Throws:
ConfigException - When the scheduler could not be created
Method Detail

createSchedulingHeuristic

protected EBSchedulingHeuristic createSchedulingHeuristic()
                                                   throws ConfigException
Throws:
ConfigException

startProcessing

public void startProcessing()
Starts the SchedulerEventEngine Thread.

Specified by:
startProcessing in interface EventEngine<ActionEvent>

putEvent

public void putEvent(ActionEvent event)
Puts an Event in the EventQueue.

Specified by:
putEvent in interface EventEngine<ActionEvent>
Parameters:
event - The Event

getJobManager

public JobManager getJobManager()
Returns the EBJobManager.

Returns:
The EBJobManager

getGridManager

public GridManager getGridManager()
Returns the EBGridManager.

Returns:
The EBGridManager

getHeuristic

public EBSchedulingHeuristic getHeuristic()
Returns the EBSchedulingHeuristic.

Returns:
The EBSchedulingHeuristic

getReplicaExecutorFacade

protected EBReplicaExecutorFacade getReplicaExecutorFacade()

schedule

protected boolean schedule(EBSchedulingHeuristic schedulingHeuristic)

run

public void run()
The Thread behavior.

Specified by:
run in interface java.lang.Runnable

shutdown

public void shutdown(EventQueue<ShutdownResponseEvent> eq)
Marks this Runnable to be shutdown and tries to unbind all remote objects.

Specified by:
shutdown in interface EBSyncShutdownable
Parameters:
eq - EventQueue that will contain the ShutdownResponseEvent after the object had successfully shutdown

isAlive

public boolean isAlive()
Description copied from interface: EBSyncShutdownable
Checks if the EBSyncShutdownable is alive.

Specified by:
isAlive in interface EBSyncShutdownable
Returns:
True if it is alive, false otherwise
See Also:
EBSyncShutdownable.isAlive()