org.gridbus.broker.farming.common
Class JobMonitor

java.lang.Object
  |
  +--org.gridbus.broker.farming.common.JobMonitor
All Implemented Interfaces:
java.lang.Runnable

public class JobMonitor
extends java.lang.Object
implements java.lang.Runnable

Author:
krishna

Constructor Summary
JobMonitor(ComputeServer server)
           
 
Method Summary
 void addListener(JobListener jl)
          This class is also the source of the events.
 java.util.Collection getJobs()
           
 boolean isRunning()
          Returns true if the monitor is still running
 void notifyListeners_Blocking(Job j)
          This method blocks until all the listeners have processed the event.
 void notifyListeners(Job j)
           
 void removeAllListeners()
           
 void removeListener(JobListener jl)
           
 void run()
           
 void startMonitoring(Job j)
          Adds this job to the list of jobs to be monitored
 void stop()
          This method will signal the jobmonitor thread to stop
 void stopMonitoring(Job j)
          Removes this job to the list of jobs to be monitored
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobMonitor

public JobMonitor(ComputeServer server)
Parameters:
server -
Method Detail

stop

public final void stop()
This method will signal the jobmonitor thread to stop


isRunning

public final boolean isRunning()
Returns true if the monitor is still running

Returns:
boolean

run

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

startMonitoring

public final void startMonitoring(Job j)
Adds this job to the list of jobs to be monitored

Parameters:
j -

stopMonitoring

public final void stopMonitoring(Job j)
Removes this job to the list of jobs to be monitored

Parameters:
j -

addListener

public void addListener(JobListener jl)
This class is also the source of the events. So we have a system below for registering / unregistering listeners and notifying them of updates.

Parameters:
jl -

removeListener

public void removeListener(JobListener jl)
Parameters:
jl -

removeAllListeners

public void removeAllListeners()

notifyListeners

public void notifyListeners(Job j)
Parameters:
j -

notifyListeners_Blocking

public void notifyListeners_Blocking(Job j)
This method blocks until all the listeners have processed the event. Currently not used by any class inside the broker.

Parameters:
j -

getJobs

public java.util.Collection getJobs()
Returns:
the collection of jobs monitored by this monitor