ServiceLifecycleEvent
Keywords: net.corda.core.node.services.ServiceLifecycleEvent class
Date: 2023-09-18

net.corda.core.node.services

## Enum ServiceLifecycleEvent

-     public enum ServiceLifecycleEvent

- - ### Enum Constant Detail

    - #### BEFORE_STATE_MACHINE_START

          public static ServiceLifecycleEvent BEFORE_STATE_MACHINE_START

      This event is dispatched when the node is about to start the State Machine. The State Machine will not be started until all handlers return from processing this event. Handlers can delay the node start-up, and the processing of flows, by not returning from handling this event until their CorDapp is ready for flows to be started/resumed.

      If a handler for this event throws `exception CordaServiceCriticalFailureException` - this is the way to flag that it will not make sense for Corda node to continue its operation. The lifecycle events dispatcher will endeavor to terminate node's JVM as soon as practically possible.

      See Also:
        `exception CordaServiceCriticalFailureException`

    - #### STATE_MACHINE_STARTED

          public static ServiceLifecycleEvent STATE_MACHINE_STARTED

      This event is dispatched when State Machine is fully started such that `interface AppServiceHub` available for `annotationclass CordaService` to be use.

      If a handler for this event throws `exception CordaServiceCriticalFailureException` - this is the way to flag that it will not make sense for Corda node to continue its operation. The lifecycle events dispatcher will endeavor to terminate node's JVM as soon as practically possible.

      See Also:
        `interface AppServiceHub`, `annotationclass CordaService`, `exception CordaServiceCriticalFailureException`