@@ -31,7 +31,6 @@ import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.statemachine.StateContext;
|
||||
import org.springframework.statemachine.annotation.OnEventNotAccepted;
|
||||
import org.springframework.statemachine.annotation.OnExtendedStateChanged;
|
||||
@@ -47,7 +46,6 @@ import org.springframework.statemachine.annotation.OnTransitionStart;
|
||||
import org.springframework.statemachine.annotation.WithStateMachine;
|
||||
import org.springframework.statemachine.state.State;
|
||||
import org.springframework.statemachine.support.StateMachineUtils;
|
||||
import org.springframework.statemachine.transition.Transition;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -97,7 +95,7 @@ public class StateMachineHandlerCallHelper<S, E> implements InitializingBean, Be
|
||||
this.beanFactory = (ListableBeanFactory)beanFactory;
|
||||
}
|
||||
|
||||
public void callOnStateChanged(String stateMachineId, Transition<S,E> transition, Message<E> message, StateContext<S, E> stateContext) {
|
||||
public void callOnStateChanged(String stateMachineId, StateContext<S, E> stateContext) {
|
||||
List<StateMachineHandler<? extends Annotation, S, E>> handlersList = new ArrayList<StateMachineHandler<? extends Annotation, S, E>>();
|
||||
String cacheKey = OnStateChanged.class.getName() + stateMachineId;
|
||||
List<CacheEntry> list = cache.get(cacheKey);
|
||||
@@ -114,7 +112,7 @@ public class StateMachineHandlerCallHelper<S, E> implements InitializingBean, Be
|
||||
getStateMachineHandlerResults(handlersList, stateContext);
|
||||
}
|
||||
|
||||
public void callOnStateEntry(String stateMachineId, Transition<S,E> transition, Message<E> message, StateContext<S, E> stateContext) {
|
||||
public void callOnStateEntry(String stateMachineId, StateContext<S, E> stateContext) {
|
||||
List<StateMachineHandler<? extends Annotation, S, E>> handlersList = new ArrayList<StateMachineHandler<? extends Annotation, S, E>>();
|
||||
String cacheKey = OnStateEntry.class.getName() + stateMachineId;
|
||||
List<CacheEntry> list = cache.get(cacheKey);
|
||||
@@ -131,7 +129,7 @@ public class StateMachineHandlerCallHelper<S, E> implements InitializingBean, Be
|
||||
getStateMachineHandlerResults(handlersList, stateContext);
|
||||
}
|
||||
|
||||
public void callOnStateExit(String stateMachineId, Transition<S,E> transition, Message<E> message, StateContext<S, E> stateContext) {
|
||||
public void callOnStateExit(String stateMachineId, StateContext<S, E> stateContext) {
|
||||
List<StateMachineHandler<? extends Annotation, S, E>> handlersList = new ArrayList<StateMachineHandler<? extends Annotation, S, E>>();
|
||||
String cacheKey = OnStateExit.class.getName() + stateMachineId;
|
||||
List<CacheEntry> list = cache.get(cacheKey);
|
||||
@@ -169,7 +167,7 @@ public class StateMachineHandlerCallHelper<S, E> implements InitializingBean, Be
|
||||
}
|
||||
|
||||
|
||||
public void callOnTransitionStart(String stateMachineId, Transition<S,E> transition, Message<E> message, StateContext<S, E> stateContext) {
|
||||
public void callOnTransitionStart(String stateMachineId, StateContext<S, E> stateContext) {
|
||||
List<StateMachineHandler<? extends Annotation, S, E>> handlersList = new ArrayList<StateMachineHandler<? extends Annotation, S, E>>();
|
||||
String cacheKey = OnTransitionStart.class.getName() + stateMachineId;
|
||||
List<CacheEntry> list = cache.get(cacheKey);
|
||||
@@ -178,15 +176,15 @@ public class StateMachineHandlerCallHelper<S, E> implements InitializingBean, Be
|
||||
}
|
||||
for (CacheEntry entry : list) {
|
||||
if (annotationHandlerSourceTargetMatch((String[]) AnnotationUtils.getValue(entry.metaAnnotation, "source"),
|
||||
(String[]) AnnotationUtils.getValue(entry.metaAnnotation, "target"), entry.annotation, transition.getSource(),
|
||||
transition.getTarget())) {
|
||||
(String[]) AnnotationUtils.getValue(entry.metaAnnotation, "target"), entry.annotation,
|
||||
stateContext.getTransition().getSource(), stateContext.getTransition().getTarget())) {
|
||||
handlersList.add(entry.handler);
|
||||
}
|
||||
}
|
||||
getStateMachineHandlerResults(handlersList, stateContext);
|
||||
}
|
||||
|
||||
public void callOnTransition(String stateMachineId, Transition<S,E> transition, Message<E> message, StateContext<S, E> stateContext) {
|
||||
public void callOnTransition(String stateMachineId, StateContext<S, E> stateContext) {
|
||||
List<StateMachineHandler<? extends Annotation, S, E>> handlersList = new ArrayList<StateMachineHandler<? extends Annotation, S, E>>();
|
||||
String cacheKey = OnTransition.class.getName() + stateMachineId;
|
||||
List<CacheEntry> list = cache.get(cacheKey);
|
||||
@@ -195,15 +193,15 @@ public class StateMachineHandlerCallHelper<S, E> implements InitializingBean, Be
|
||||
}
|
||||
for (CacheEntry entry : list) {
|
||||
if (annotationHandlerSourceTargetMatch((String[]) AnnotationUtils.getValue(entry.metaAnnotation, "source"),
|
||||
(String[]) AnnotationUtils.getValue(entry.metaAnnotation, "target"), entry.annotation, transition.getSource(),
|
||||
transition.getTarget())) {
|
||||
(String[]) AnnotationUtils.getValue(entry.metaAnnotation, "target"), entry.annotation,
|
||||
stateContext.getTransition().getSource(), stateContext.getTransition().getTarget())) {
|
||||
handlersList.add(entry.handler);
|
||||
}
|
||||
}
|
||||
getStateMachineHandlerResults(handlersList, stateContext);
|
||||
}
|
||||
|
||||
public void callOnTransitionEnd(String stateMachineId, Transition<S,E> transition, Message<E> message, StateContext<S, E> stateContext) {
|
||||
public void callOnTransitionEnd(String stateMachineId, StateContext<S, E> stateContext) {
|
||||
List<StateMachineHandler<? extends Annotation, S, E>> handlersList = new ArrayList<StateMachineHandler<? extends Annotation, S, E>>();
|
||||
String cacheKey = OnTransitionEnd.class.getName() + stateMachineId;
|
||||
List<CacheEntry> list = cache.get(cacheKey);
|
||||
@@ -212,8 +210,8 @@ public class StateMachineHandlerCallHelper<S, E> implements InitializingBean, Be
|
||||
}
|
||||
for (CacheEntry entry : list) {
|
||||
if (annotationHandlerSourceTargetMatch((String[]) AnnotationUtils.getValue(entry.metaAnnotation, "source"),
|
||||
(String[]) AnnotationUtils.getValue(entry.metaAnnotation, "target"), entry.annotation, transition.getSource(),
|
||||
transition.getTarget())) {
|
||||
(String[]) AnnotationUtils.getValue(entry.metaAnnotation, "target"), entry.annotation,
|
||||
stateContext.getTransition().getSource(), stateContext.getTransition().getTarget())) {
|
||||
handlersList.add(entry.handler);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ public abstract class AbstractStateMachine<S, E> extends StateMachineObjectSuppo
|
||||
public boolean sendEvent(Message<E> event) {
|
||||
if (hasStateMachineError()) {
|
||||
// TODO: should we throw exception?
|
||||
notifyEventNotAccepted(event, buildStateContext(Stage.EVENT_NOT_ACCEPTED, event, null, getRelayStateMachine()));
|
||||
notifyEventNotAccepted(buildStateContext(Stage.EVENT_NOT_ACCEPTED, event, null, getRelayStateMachine()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -185,18 +185,18 @@ public abstract class AbstractStateMachine<S, E> extends StateMachineObjectSuppo
|
||||
event = getStateMachineInterceptors().preEvent(event, this);
|
||||
} catch (Exception e) {
|
||||
log.info("Event " + event + " threw exception in interceptors, not accepting event");
|
||||
notifyEventNotAccepted(event, buildStateContext(Stage.EVENT_NOT_ACCEPTED, event, null, getRelayStateMachine()));
|
||||
notifyEventNotAccepted(buildStateContext(Stage.EVENT_NOT_ACCEPTED, event, null, getRelayStateMachine()));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isComplete() || !isRunning()) {
|
||||
notifyEventNotAccepted(event, buildStateContext(Stage.EVENT_NOT_ACCEPTED, event, null, getRelayStateMachine()));
|
||||
notifyEventNotAccepted(buildStateContext(Stage.EVENT_NOT_ACCEPTED, event, null, getRelayStateMachine()));
|
||||
return false;
|
||||
}
|
||||
boolean accepted = acceptEvent(event);
|
||||
stateMachineExecutor.execute();
|
||||
if (!accepted) {
|
||||
notifyEventNotAccepted(event, buildStateContext(Stage.EVENT_NOT_ACCEPTED, event, null, getRelayStateMachine()));
|
||||
notifyEventNotAccepted(buildStateContext(Stage.EVENT_NOT_ACCEPTED, event, null, getRelayStateMachine()));
|
||||
}
|
||||
return accepted;
|
||||
}
|
||||
@@ -263,16 +263,16 @@ public abstract class AbstractStateMachine<S, E> extends StateMachineObjectSuppo
|
||||
@Override
|
||||
public void transit(Transition<S, E> t, StateContext<S, E> ctx, Message<E> message) {
|
||||
// TODO: fix above stateContext as it's not used
|
||||
notifyTransitionStart(t, message, buildStateContext(Stage.TRANSITION_START, message, t, getRelayStateMachine()));
|
||||
notifyTransition(t, message, buildStateContext(Stage.TRANSITION, message, t, getRelayStateMachine()));
|
||||
notifyTransitionStart(buildStateContext(Stage.TRANSITION_START, message, t, getRelayStateMachine()));
|
||||
notifyTransition(buildStateContext(Stage.TRANSITION, message, t, getRelayStateMachine()));
|
||||
if (t.getKind() == TransitionKind.INITIAL) {
|
||||
switchToState(t.getTarget(), message, t, getRelayStateMachine());
|
||||
notifyStateMachineStarted(getRelayStateMachine(), buildStateContext(Stage.STATEMACHINE_START, message, t, getRelayStateMachine()));
|
||||
notifyStateMachineStarted(buildStateContext(Stage.STATEMACHINE_START, message, t, getRelayStateMachine()));
|
||||
} else if (t.getKind() != TransitionKind.INTERNAL) {
|
||||
switchToState(t.getTarget(), message, t, getRelayStateMachine());
|
||||
}
|
||||
// TODO: looks like events should be called here and anno processing earlier
|
||||
notifyTransitionEnd(t, message, buildStateContext(Stage.TRANSITION_END, message, t, getRelayStateMachine()));
|
||||
notifyTransitionEnd(buildStateContext(Stage.TRANSITION_END, message, t, getRelayStateMachine()));
|
||||
}
|
||||
});
|
||||
stateMachineExecutor = executor;
|
||||
@@ -305,7 +305,7 @@ public abstract class AbstractStateMachine<S, E> extends StateMachineObjectSuppo
|
||||
// dispatch started event which would net getting
|
||||
// dispatched via executor
|
||||
StateContext<S, E> stateContext = buildStateContext(Stage.STATEMACHINE_START, null, null, getRelayStateMachine());
|
||||
notifyStateMachineStarted(getRelayStateMachine(), stateContext);
|
||||
notifyStateMachineStarted(stateContext);
|
||||
return;
|
||||
}
|
||||
registerPseudoStateListener();
|
||||
@@ -326,7 +326,7 @@ public abstract class AbstractStateMachine<S, E> extends StateMachineObjectSuppo
|
||||
@Override
|
||||
protected void doStop() {
|
||||
stateMachineExecutor.stop();
|
||||
notifyStateMachineStopped(this, buildStateContext(Stage.STATEMACHINE_STOP, null, null, this));
|
||||
notifyStateMachineStopped(buildStateContext(Stage.STATEMACHINE_STOP, null, null, this));
|
||||
currentState = null;
|
||||
initialEnabled = null;
|
||||
}
|
||||
@@ -347,7 +347,7 @@ public abstract class AbstractStateMachine<S, E> extends StateMachineObjectSuppo
|
||||
currentError = exception;
|
||||
}
|
||||
if (currentError != null) {
|
||||
notifyStateMachineError(this, currentError, buildStateContext(Stage.STATEMACHINE_ERROR, null, null, this, currentError));
|
||||
notifyStateMachineError(buildStateContext(Stage.STATEMACHINE_ERROR, null, null, this, currentError));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -735,7 +735,7 @@ public abstract class AbstractStateMachine<S, E> extends StateMachineObjectSuppo
|
||||
start();
|
||||
}
|
||||
entryToState(state, message, transition, stateMachine);
|
||||
notifyStateChanged(notifyFrom, state, message, buildStateContext(Stage.STATE_CHANGED, message, null, getRelayStateMachine(), notifyFrom, state));
|
||||
notifyStateChanged(buildStateContext(Stage.STATE_CHANGED, message, null, getRelayStateMachine(), notifyFrom, state));
|
||||
nonDeepStatePresent = true;
|
||||
} else if (currentState == null && StateMachineUtils.isSubstate(findDeep, state)) {
|
||||
if (exit) {
|
||||
@@ -747,7 +747,7 @@ public abstract class AbstractStateMachine<S, E> extends StateMachineObjectSuppo
|
||||
start();
|
||||
}
|
||||
entryToState(findDeep, message, transition, stateMachine);
|
||||
notifyStateChanged(notifyFrom, findDeep, message, buildStateContext(Stage.STATE_CHANGED, message, null, getRelayStateMachine(), notifyFrom, findDeep));
|
||||
notifyStateChanged(buildStateContext(Stage.STATE_CHANGED, message, null, getRelayStateMachine(), notifyFrom, findDeep));
|
||||
}
|
||||
|
||||
if (currentState != null && !nonDeepStatePresent) {
|
||||
@@ -861,7 +861,7 @@ public abstract class AbstractStateMachine<S, E> extends StateMachineObjectSuppo
|
||||
log.debug("Exit state=[" + state + "]");
|
||||
state.exit(stateContext);
|
||||
|
||||
notifyStateExited(state, message, buildStateContext(Stage.STATE_EXIT, message, null, getRelayStateMachine(), state, null));
|
||||
notifyStateExited(buildStateContext(Stage.STATE_EXIT, message, null, getRelayStateMachine(), state, null));
|
||||
}
|
||||
|
||||
private void entryToState(State<S, E> state, Message<E> message, Transition<S, E> transition, StateMachine<S, E> stateMachine) {
|
||||
@@ -889,7 +889,7 @@ public abstract class AbstractStateMachine<S, E> extends StateMachineObjectSuppo
|
||||
}
|
||||
}
|
||||
|
||||
notifyStateEntered(state, message, buildStateContext(Stage.STATE_ENTRY, message, transition, getRelayStateMachine(), null, state));
|
||||
notifyStateEntered(buildStateContext(Stage.STATE_ENTRY, message, transition, getRelayStateMachine(), null, state));
|
||||
log.debug("Enter state=[" + state + "]");
|
||||
state.entry(stateContext);
|
||||
}
|
||||
|
||||
@@ -128,122 +128,122 @@ public abstract class StateMachineObjectSupport<S, E> extends LifecycleObjectSup
|
||||
return stateListener;
|
||||
}
|
||||
|
||||
protected void notifyStateChanged(State<S,E> source, State<S,E> target, Message<E> message, StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnStateChanged(getBeanName(), null, message, stateContext);
|
||||
stateListener.stateChanged(source, target);
|
||||
protected void notifyStateChanged(StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnStateChanged(getBeanName(), stateContext);
|
||||
stateListener.stateChanged(stateContext.getSource(), stateContext.getTarget());
|
||||
stateListener.stateContext(stateContext);
|
||||
if (contextEventsEnabled) {
|
||||
StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
|
||||
if (eventPublisher != null) {
|
||||
eventPublisher.publishStateChanged(this, source, target);
|
||||
eventPublisher.publishStateChanged(this, stateContext.getSource(), stateContext.getTarget());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void notifyStateEntered(State<S,E> state, Message<E> message, StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnStateEntry(getBeanName(), null, message, stateContext);
|
||||
stateListener.stateEntered(state);
|
||||
protected void notifyStateEntered(StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnStateEntry(getBeanName(), stateContext);
|
||||
stateListener.stateEntered(stateContext.getTarget());
|
||||
stateListener.stateContext(stateContext);
|
||||
if (contextEventsEnabled) {
|
||||
StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
|
||||
if (eventPublisher != null) {
|
||||
eventPublisher.publishStateEntered(this, state);
|
||||
eventPublisher.publishStateEntered(this, stateContext.getTarget());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void notifyStateExited(State<S,E> state, Message<E> message, StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnStateExit(getBeanName(), null, message, stateContext);
|
||||
stateListener.stateExited(state);
|
||||
protected void notifyStateExited(StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnStateExit(getBeanName(), stateContext);
|
||||
stateListener.stateExited(stateContext.getSource());
|
||||
stateListener.stateContext(stateContext);
|
||||
if (contextEventsEnabled) {
|
||||
StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
|
||||
if (eventPublisher != null) {
|
||||
eventPublisher.publishStateExited(this, state);
|
||||
eventPublisher.publishStateExited(this, stateContext.getSource());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void notifyEventNotAccepted(Message<E> event, StateContext<S, E> stateContext) {
|
||||
protected void notifyEventNotAccepted(StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnEventNotAccepted(getBeanName(), stateContext);
|
||||
stateListener.eventNotAccepted(event);
|
||||
stateListener.eventNotAccepted(stateContext.getMessage());
|
||||
stateListener.stateContext(stateContext);
|
||||
if (contextEventsEnabled) {
|
||||
StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
|
||||
if (eventPublisher != null) {
|
||||
eventPublisher.publishEventNotAccepted(this, event);
|
||||
eventPublisher.publishEventNotAccepted(this, stateContext.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void notifyTransitionStart(Transition<S,E> transition, Message<E> message, StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnTransitionStart(getBeanName(), transition, message, stateContext);
|
||||
stateListener.transitionStarted(transition);
|
||||
protected void notifyTransitionStart(StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnTransitionStart(getBeanName(), stateContext);
|
||||
stateListener.transitionStarted(stateContext.getTransition());
|
||||
stateListener.stateContext(stateContext);
|
||||
if (contextEventsEnabled) {
|
||||
StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
|
||||
if (eventPublisher != null) {
|
||||
eventPublisher.publishTransitionStart(this, transition);
|
||||
eventPublisher.publishTransitionStart(this, stateContext.getTransition());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void notifyTransition(Transition<S,E> transition, Message<E> message, StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnTransition(getBeanName(), transition, message, stateContext);
|
||||
stateListener.transition(transition);
|
||||
protected void notifyTransition(StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnTransition(getBeanName(), stateContext);
|
||||
stateListener.transition(stateContext.getTransition());
|
||||
stateListener.stateContext(stateContext);
|
||||
if (contextEventsEnabled) {
|
||||
StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
|
||||
if (eventPublisher != null) {
|
||||
eventPublisher.publishTransition(this, transition);
|
||||
eventPublisher.publishTransition(this, stateContext.getTransition());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void notifyTransitionEnd(Transition<S,E> transition, Message<E> message, StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnTransitionEnd(getBeanName(), transition, message, stateContext);
|
||||
stateListener.transitionEnded(transition);
|
||||
protected void notifyTransitionEnd(StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnTransitionEnd(getBeanName(), stateContext);
|
||||
stateListener.transitionEnded(stateContext.getTransition());
|
||||
stateListener.stateContext(stateContext);
|
||||
if (contextEventsEnabled) {
|
||||
StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
|
||||
if (eventPublisher != null) {
|
||||
eventPublisher.publishTransitionEnd(this, transition);
|
||||
eventPublisher.publishTransitionEnd(this, stateContext.getTransition());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void notifyStateMachineStarted(StateMachine<S, E> stateMachine, StateContext<S, E> stateContext) {
|
||||
protected void notifyStateMachineStarted(StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnStateMachineStart(getBeanName(), stateContext);
|
||||
stateListener.stateMachineStarted(stateMachine);
|
||||
stateListener.stateMachineStarted(stateContext.getStateMachine());
|
||||
stateListener.stateContext(stateContext);
|
||||
if (contextEventsEnabled) {
|
||||
StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
|
||||
if (eventPublisher != null) {
|
||||
eventPublisher.publishStateMachineStart(this, stateMachine);
|
||||
eventPublisher.publishStateMachineStart(this, stateContext.getStateMachine());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void notifyStateMachineStopped(StateMachine<S, E> stateMachine, StateContext<S, E> stateContext) {
|
||||
protected void notifyStateMachineStopped(StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnStateMachineStop(getBeanName(), stateContext);
|
||||
stateListener.stateMachineStopped(stateMachine);
|
||||
stateListener.stateMachineStopped(stateContext.getStateMachine());
|
||||
stateListener.stateContext(stateContext);
|
||||
if (contextEventsEnabled) {
|
||||
StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
|
||||
if (eventPublisher != null) {
|
||||
eventPublisher.publishStateMachineStop(this, stateMachine);
|
||||
eventPublisher.publishStateMachineStop(this, stateContext.getStateMachine());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void notifyStateMachineError(StateMachine<S, E> stateMachine, Exception exception, StateContext<S, E> stateContext) {
|
||||
protected void notifyStateMachineError(StateContext<S, E> stateContext) {
|
||||
stateMachineHandlerCallHelper.callOnStateMachineError(getBeanName(), stateContext);
|
||||
stateListener.stateMachineError(stateMachine, exception);
|
||||
stateListener.stateMachineError(stateContext.getStateMachine(), stateContext.getException());
|
||||
stateListener.stateContext(stateContext);
|
||||
if (contextEventsEnabled) {
|
||||
StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
|
||||
if (eventPublisher != null) {
|
||||
eventPublisher.publishStateMachineError(this, stateMachine, exception);
|
||||
eventPublisher.publishStateMachineError(this, stateContext.getStateMachine(), stateContext.getException());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user