use of org.springframework.statemachine.listener.StateMachineListenerAdapter in project cloudbreak by hortonworks.
the class AbstractFlowConfiguration method getStateMachineConfiguration.
protected MachineConfiguration<S, E> getStateMachineConfiguration() {
StateMachineConfigurationBuilder<S, E> configurationBuilder = new StateMachineConfigurationBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR, true);
StateMachineStateBuilder<S, E> stateBuilder = new StateMachineStateBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR, true);
StateMachineTransitionBuilder<S, E> transitionBuilder = new StateMachineTransitionBuilder<>(ObjectPostProcessor.QUIESCENT_POSTPROCESSOR, true);
StateMachineListener<S, E> listener = new StateMachineListenerAdapter<S, E>() {
@Override
public void stateChanged(State<S, E> from, State<S, E> to) {
LOGGER.debug("state changed from {} to {}", from, to);
}
@Override
public void eventNotAccepted(Message<E> event) {
LOGGER.error("{} not accepted event: {}", getClass().getSimpleName(), event);
}
};
return new MachineConfiguration<>(configurationBuilder, stateBuilder, transitionBuilder, listener, new SyncTaskExecutor());
}
Aggregations