Package org.jppf.client.monitoring.jobs
Class JobMonitor
java.lang.Object
org.jppf.client.monitoring.topology.TopologyListenerAdapter
org.jppf.client.monitoring.jobs.JobMonitor
- All Implemented Interfaces:
AutoCloseable,EventListener,JobMonitoringHandler,TopologyListener
This class provides a representation of the jobs and corresponding node dispatches executing in a JPPF grid.
- Since:
- 5.1
- Author:
- Laurent Cohen
-
Constructor Summary
ConstructorsConstructorDescriptionJobMonitor(JobMonitorUpdateMode updateMode, long period, TopologyManager topologyManager, JobMonitoringListener... listeners) Initialize this job manager with the specified topology manager and event mode.JobMonitor(TopologyManager topologyManager, JobMonitoringListener... listeners) Initialize this job manager with the specified topology manager inIMMEDIATE_NOTFICATIONSmode. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a listener to the events emitted by this job monitor.voidclose()voiddriverAdded(TopologyEvent event) Called when a driver is added.voiddriverRemoved(TopologyEvent event) Called when a driver is removed.getAllJobDispatches(String jobUuid) Get the dispatches of the specified job accrosss the entire topology.getDriversForJob(String jobUuid) Get the drivers to which a job was submitted, either in parallel from the same client, or from one driver to another in a multi-driver topology.getJobDriver(String driverUuid) Get the driver with the specified uuid.Get the drivers monitored by this job monitor.Get the topology manager associated with this job monitor.voidRemove a listener to the events emitted by this job monitor.Methods inherited from class org.jppf.client.monitoring.topology.TopologyListenerAdapter
driverUpdated, nodeAdded, nodeRemoved, nodeUpdated
-
Constructor Details
-
JobMonitor
Initialize this job manager with the specified topology manager inIMMEDIATE_NOTFICATIONSmode.- Parameters:
topologyManager- the topology manager to use.listeners- optional listeners that can be registered immediately with this job monitor.
-
JobMonitor
public JobMonitor(JobMonitorUpdateMode updateMode, long period, TopologyManager topologyManager, JobMonitoringListener... listeners) Initialize this job manager with the specified topology manager and event mode.- Parameters:
updateMode- the update mode which determines how job monitoring events are generated.period- the interval between publications of updates. This is not used inIMMEDIATE_NOTFICATIONSmode.topologyManager- the topology manager to use.listeners- optional listeners that can be registered immediately with this job monitor.
-
-
Method Details
-
getTopologyManager
Get the topology manager associated with this job monitor.- Returns:
- a
TopologyManagerobject.
-
getJobDriver
Get the driver with the specified uuid.- Parameters:
driverUuid- the uuid of the driver to retrieve.- Returns:
- a
JobDriverobject, ornullif there si no such driver.
-
getJobDrivers
Get the drivers monitored by this job monitor.- Returns:
- a list of
JobDriverobjects.
-
getDriversForJob
Get the drivers to which a job was submitted, either in parallel from the same client, or from one driver to another in a multi-driver topology.- Parameters:
jobUuid- the uuid of the job for which to find the drivers.- Returns:
- a list of
JobDriverinstances, possibly empty.
-
getAllJobDispatches
Get the dispatches of the specified job accrosss the entire topology. This will return a list of dispatches where the nodes may be attached to more than one server.- Parameters:
jobUuid- the uuid of the job for which to find the dispatches.- Returns:
- a list of
JobDispatchinstances, possibly empty.
-
addJobMonitoringListener
Add a listener to the events emitted by this job monitor.- Parameters:
listener- the listener to add.
-
removeJobMonitoringListener
Remove a listener to the events emitted by this job monitor.- Parameters:
listener- the listener to remove.
-
driverAdded
Called when a driver is added.- Specified by:
driverAddedin interfaceTopologyListener- Overrides:
driverAddedin classTopologyListenerAdapter- Parameters:
event- the event encapsulating the change information.
-
driverRemoved
Called when a driver is removed.- Specified by:
driverRemovedin interfaceTopologyListener- Overrides:
driverRemovedin classTopologyListenerAdapter- Parameters:
event- the event encapsulating the change information.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceJobMonitoringHandler
-