Example usage for org.springframework.statemachine.event StateMachineEventPublisher publishStateMachineStop

List of usage examples for org.springframework.statemachine.event StateMachineEventPublisher publishStateMachineStop

Introduction

In this page you can find the example usage for org.springframework.statemachine.event StateMachineEventPublisher publishStateMachineStop.

Prototype

void publishStateMachineStop(Object source, StateMachine<?, ?> stateMachine);

Source Link

Document

Publish a statemachine stop event.

Usage

From source file:org.springframework.statemachine.support.StateMachineObjectSupport.java

protected void notifyStateMachineStopped(StateContext<S, E> stateContext) {
    try {/*w w w  . jav  a  2s  .c  o m*/
        stateMachineHandlerCallHelper.callOnStateMachineStop(getBeanName(), stateContext);
        stateListener.stateMachineStopped(stateContext.getStateMachine());
        stateListener.stateContext(stateContext);
        if (contextEventsEnabled) {
            StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
            if (eventPublisher != null) {
                eventPublisher.publishStateMachineStop(this, stateContext.getStateMachine());
            }
        }
    } catch (Throwable e) {
        log.warn("Error during notifyStateMachineStopped", e);
    }
}