org.gridbus.broker.farming.common
Class JobMonitor

java.lang.Object
  extended by org.gridbus.broker.farming.common.JobMonitor
All Implemented Interfaces:
java.lang.Runnable

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

Author:
krishna

Field Summary
static long MONITOR_DEFAULT_POLLTIME
          Default poll time = 5000 milliseconds
 
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 removeAllListeners()
           
 void removeListener(JobListener jl)
           
 void run()
           
 void setPollTime(long pollTimeMillis)
           
 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
 

Field Detail

MONITOR_DEFAULT_POLLTIME

public static final long MONITOR_DEFAULT_POLLTIME
Default poll time = 5000 milliseconds

See Also:
Constant Field Values
Constructor Detail

JobMonitor

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

setPollTime

public void setPollTime(long pollTimeMillis)
Parameters:
pollTimeMillis -

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()

getJobs

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