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.
This attributes gives informations about the batch execution.
|numberOfCompletedTasks||current number of completed tasks|
|numberOfFailedTasks||current number of failed tasks|
|state||current state of the batch|
|beginDate||begin date of the batch execution|
|endDate||end date of the batch execution|
This operations can be invoked throw a MBean manager.
|Name||Required batch state||Description|
|pause||running||suspends the execution of the batch. Warning : the started tasks are not paused, but waited for termination.|
|resume||sleeping, waiting for launch, waiting for shutdown||resume the execution of the batch|
|shutdown||all||stop the execution of the batch. Wait for the execution of the submitted tasks before to terminate.|
|shutdownNow||all||stop the execution of the batch immediately: the running tasks are stopped abruptly and the submitted tasks are discarded|
|restart||waiting for shutdown||restart the execution of the batch|
An exception is thrown if the state of the batch cannot permit an invoked operation.
A notification is sent each time the state of the batch is changing. (see diagram of batch states)
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=5000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false