Version 3

    User Story

    Provide a means to send JMX notifications for the new lifecycle server events.

    Issue Metadata

    EAP issues: https://issues.jboss.org/browse/EAP7-471 - Management and JMX notifications when ControlledProcessState changes / [WFCORE-1157] Managmement and JMX notifications when ControlledProcessState changes - JBoss Issue Tracker

    Related issue: https://issues.jboss.org/browse/EAP7-472 - Ability to register a listener (integrated with the management layer) that will be notified of the lifecycle server events

    Dev Contact ehugonnet

    QE Contacts: Martin Simka

    Hard Requirements

    • Sends JMX notifications when the server state changes (either the runtime configuration state or if available the running state).

    Design Details

    Server lifecycle events

    The server rutime configuration lifecycle events are governed by the different state transition based on its ControlledProcessStateService:

    • starting
    • running / ok
    • reload-required
    • restart-required
    • stopping
    • stopped

     

    The server running state events are governed by the different state transition based on its SuspendController :

    • running
    • pre-suspend
    • suspending
    • suspended

     

     

    The listeners will be bound to the ControlledProcessStateService lifecycle and will be able to be called for the following transitions:

    • starting -> running
    • running -> reload-required
    • running -> restart-required
    • reload-required -> restart-required
    • restart-required -> reload-required
    • running -> stopping
    • reload-required -> stopping
    • restart-required -> stopping

     

    The listeners will be bound to the SuspendController lifecycle and will be able to be called for the following transitions:

    • starting -> suspended
    • suspended-> normal / admin-only
    • normal / admin-only -> suspending
    • suspending -> suspended
    • suspended -> stopping

     

    As the SuspendController is only available in server mode (aka standalone or domain server) those transitions don't happen on a Domain or Host Controller.

    When WildFly boots, an instance of org.jboss.as.server.jmx.RunningStateJmxMBean will be registered that will listen to the internal events and sends JMX notifications. So any javax.management.NotificationListener can listen on "jboss.root:type=state" to get those notifications.

    each JMX notification will provide : the old state, the new state and an attribute name of RuntimeConfigurationState or RunningState depending on the state transition.

     

    Work Decomposition

    Work is impacting the wildfly-core project only and is self-contained.

     

    QE

    Test that a JMX  notification listener will be notified of all possible state transition (these tests must be included in wildfly-core test suite).