|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jmonks.batch.framework.management.JobManagementAgent
JobManagementAgent defines the methods to start and stop the JMX Agent for this job. Only one agent will be created for a job and this can be created only be the framework. Agent service can be started and stopped only once during the life cycle of the job. This uses the JobConnectorHelper to take the help in creating different JMX connector servers and register and unregister jmx connector servers to be looked up by the JMX connector clients.
| Field Summary | |
static java.lang.String |
JOB_MANAGER_MBEAN_NAME
Name of the bean that manages this job. |
static java.lang.String |
JOB_MONITOR_MBEAN_NAME
Name of the bean monitors this job. |
static java.lang.String |
MBEAN_SERVER_DOMAIN_NAME
Mbean Server domain name. |
| Method Summary | |
static JobManagementAgent |
createJobManagementAgent(JobContext jobContext,
Main agentCreator)
Creates the agent and initializes with the job context and job connection helper. |
boolean |
isRunning()
Tells whether the agent is running or not. |
boolean |
start(JobController jobController)
This method start the job management agent with the given controller information. |
boolean |
stop(ErrorCode exitCode)
Stops the JMX connector server, unregisters the MBeans and MBeanServer and unregisters the jmx service url information from lookup location and marks stopped flag as true to indicate that agent has been stopped. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String MBEAN_SERVER_DOMAIN_NAME
public static final java.lang.String JOB_MANAGER_MBEAN_NAME
public static final java.lang.String JOB_MONITOR_MBEAN_NAME
| Method Detail |
public static JobManagementAgent createJobManagementAgent(JobContext jobContext,
Main agentCreator)
Creates the agent and initializes with the job context and job connection helper. Once it is created, it will be associated with the job in the job context.
jobContext - Context of the job is being run.agentCreator - Main class instance authroized to create the agent.
java.lang.SecurityException - If there is an attempt to create the agent other than Main class(framework).
ConfigurationException - If unable to instantiate the job connection helper.public boolean start(JobController jobController)
This method start the job management agent with the given controller information.
Basicially, this does the following activities to start the management agent.
jobController - Controller reference to be passed to the mbeans.
java.lang.IllegalArgumentException - If input parameters job name or job controller is null.
java.lang.IllegalStateException - If manager is already started.public boolean stop(ErrorCode exitCode)
exitCode - errorCode returned by controller to the Main class.
java.lang.IllegalArgumentException - If input parameter status code is null.
java.lang.IllegalStateException - If agent is already stopped or it not yet started.public boolean isRunning()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||