org.jmonks.batch.framework.management
Class JobMonitor

java.lang.Object
  extended byorg.jmonks.batch.framework.management.JobMonitor
All Implemented Interfaces:
JobMonitorMBean

public class JobMonitor
extends java.lang.Object
implements JobMonitorMBean

Implementation of job monitor mbean to instrument the job controller.

Since:
1.0
Version:
1.0
Author:
Suresh Pragada

Constructor Summary
JobMonitor(JobController jobController)
          Creates a new instance of JobMonitorMBean and initializes with job controller.
 
Method Summary
 long getExpectedRecordsCount()
          Gets the total number of records this job might try to process.
 long getProcessedRecordsCount()
          Gets the records processed by this job so far.
 java.lang.String[] getProcessorIDList()
          Returns the array of IDs assigned to be processors running under this controller.
 ProcessorState getProcessorState(java.lang.String processorID)
          Gets the state of the processor identified by the given processor ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobMonitor

public JobMonitor(JobController jobController)
Creates a new instance of JobMonitorMBean and initializes with job controller.

Parameters:
jobController - Job controller implements this interface.
Throws:
java.lang.IllegalArgumentException - if input argument job controller is null.
Method Detail

getExpectedRecordsCount

public long getExpectedRecordsCount()
Description copied from interface: JobMonitorMBean
Gets the total number of records this job might try to process.

Specified by:
getExpectedRecordsCount in interface JobMonitorMBean
Returns:
Returns the total number of records this job might try to process.
See Also:
JobMonitorMBean.getExpectedRecordsCount()

getProcessedRecordsCount

public long getProcessedRecordsCount()
Description copied from interface: JobMonitorMBean
Gets the records processed by this job so far.

Specified by:
getProcessedRecordsCount in interface JobMonitorMBean
Returns:
Returns the number of records processed by this job so far.
See Also:
JobMonitorMBean.getProcessedRecordsCount()

getProcessorIDList

public java.lang.String[] getProcessorIDList()
Description copied from interface: JobMonitorMBean
Returns the array of IDs assigned to be processors running under this controller.

Specified by:
getProcessorIDList in interface JobMonitorMBean
Returns:
Returns the array of IDs being assigned by each processor.
See Also:
JobMonitorMBean.getProcessorIDList()

getProcessorState

public ProcessorState getProcessorState(java.lang.String processorID)
Description copied from interface: JobMonitorMBean
Gets the state of the processor identified by the given processor ID. This returns the state in a ProcessorState object.

Specified by:
getProcessorState in interface JobMonitorMBean
Returns:
Returns the state of the requested processor.
See Also:
JobMonitorMBean.getProcessorState(java.lang.String)