JMX Management

MyBatchFramework exposes automatically attributes in relation with the execution of the batch, and provide operations to manage its life cycle. The name of the MBean is BatchService.

Attributes

This attributes gives informations about the batch execution.

NameDescription
numberOfCompletedTaskscurrent number of completed tasks
numberOfFailedTaskscurrent number of failed tasks
statecurrent state of the batch
beginDatebegin date of the batch execution
endDateend date of the batch execution
List of exposed attributes:

Operations

This operations can be invoked throw a MBean manager.

NameRequired batch stateDescription
pauserunningsuspends the execution of the batch. Warning : the started tasks are not paused, but waited for termination.
resumesleeping, waiting for launch, waiting for shutdownresume the execution of the batch
shutdownallstop the execution of the batch. Wait for the execution of the submitted tasks before to terminate.
shutdownNowallstop the execution of the batch immediately: the running tasks are stopped abruptly and the submitted tasks are discarded
restartwaiting for shutdownrestart the execution of the batch
List of operations:

An exception is thrown if the state of the batch cannot permit an invoked operation.

Notifications

A notification is sent each time the state of the batch is changing. (see diagram of batch states)

Info:
one powerfull MBean manager: JConsole (distributed with the Sun JVM).
Warning:
If the JMX management is enabled into the batch configuration, when you must give to the JVM some JMX configuration arguments, like the authentication mode and the remote port. Please refer to a JMX tutorial for more information about it. Here is an example of configuration without authentication or secure connection:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=5000
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false