org.jmonks.batch.framework.management
Class JobManager

java.lang.Object
  extended byjavax.management.NotificationBroadcasterSupport
      extended byorg.jmonks.batch.framework.management.JobManager
All Implemented Interfaces:
JobManagerMBean, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter

public class JobManager
extends javax.management.NotificationBroadcasterSupport
implements JobManagerMBean

JobManager instruments the job controller for management purposes.

Since:
1.0
Version:
1.0
Author:
Suresh Pragada

Constructor Summary
JobManager(JobController jobController)
          Creates a new instance of JobManagerMBean and initializes with job controller.
 
Method Summary
 boolean changeLogLevel(java.lang.String loggerName, org.apache.log4j.Level newLogLevel)
          Changes the log level for the requested logger name with the given log level.
 org.apache.log4j.Level getLogLevel(java.lang.String loggerName)
          Gets the log level of the given logger name.
 ProcessorStatus getProcessorStatus(java.lang.String processorID)
          Returns the status of the processor identified by the given processor ID.
 boolean resume(java.lang.String processorID)
          Controller should resume processing of the processor identified by the given processor ID.
 boolean stop(java.lang.String processorID)
          Controller should stop processing of the processor identified by the given processor ID.
 boolean suspend(java.lang.String processorID)
          Controller should suspend processing of the processor identified by the give processor ID.
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobManager

public JobManager(JobController jobController)
Creates a new instance of JobManagerMBean 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

stop

public boolean stop(java.lang.String processorID)
Controller should stop processing of the processor identified by the given processor ID.

Specified by:
stop in interface JobManagerMBean
Parameters:
processorID - ID assigned to each processor.
Returns:
Returns true, if processor has been stopped, false otherwise.

suspend

public boolean suspend(java.lang.String processorID)
Controller should suspend processing of the processor identified by the give processor ID.

Specified by:
suspend in interface JobManagerMBean
Parameters:
processorID - ID assigned to each processor.
Returns:
Returns true, if processor has been suspended, false otherwise.

resume

public boolean resume(java.lang.String processorID)
Controller should resume processing of the processor identified by the given processor ID.

Specified by:
resume in interface JobManagerMBean
Parameters:
processorID - ID assigned to each processor.
Returns:
Returns true, if processor can be resumed, false, otherwise.

getProcessorStatus

public ProcessorStatus getProcessorStatus(java.lang.String processorID)
Returns the status of the processor identified by the given processor ID.

Specified by:
getProcessorStatus in interface JobManagerMBean
Parameters:
processorID - ID assigned to each processor.
Returns:
Returns the processor status.

getLogLevel

public org.apache.log4j.Level getLogLevel(java.lang.String loggerName)
Gets the log level of the given logger name.

Specified by:
getLogLevel in interface JobManagerMBean
Parameters:
loggerName - Name of the logger wants to find the log level.
Returns:
Returns the log level, null, if the given logger could not be found.

changeLogLevel

public boolean changeLogLevel(java.lang.String loggerName,
                              org.apache.log4j.Level newLogLevel)
Changes the log level for the requested logger name with the given log level.

Specified by:
changeLogLevel in interface JobManagerMBean
Parameters:
loggerName - Logger name needs to be modified.
newLogLevel - new logging level.
Returns:
Returns true, if log level could be changed, false, otherwise.