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

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

Introduction

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

Prototype

void publishStateExited(Object source, State<?, ?> state);

Source Link

Document

Publish a state exited event.

Usage

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

protected void notifyStateExited(StateContext<S, E> stateContext) {
    try {/*w w w.j ava  2  s .  co  m*/
        stateMachineHandlerCallHelper.callOnStateExit(getBeanName(), stateContext);
        stateListener.stateExited(stateContext.getSource());
        stateListener.stateContext(stateContext);
        if (contextEventsEnabled) {
            StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
            if (eventPublisher != null) {
                eventPublisher.publishStateExited(this, stateContext.getSource());
            }
        }
    } catch (Throwable e) {
        log.warn("Error during notifyStateExited", e);
    }
}