Example usage for org.springframework.statemachine.processor StateMachineRuntime StateMachineRuntime

List of usage examples for org.springframework.statemachine.processor StateMachineRuntime StateMachineRuntime

Introduction

In this page you can find the example usage for org.springframework.statemachine.processor StateMachineRuntime StateMachineRuntime.

Prototype

StateMachineRuntime

Source Link

Usage

From source file:org.springframework.statemachine.processor.StateMachineHandlerCallHelper.java

private List<Object> getStateMachineHandlerResults(
        List<StateMachineHandler<? extends Annotation, S, E>> stateMachineHandlers,
        final StateContext<S, E> stateContext) {
    StateMachineRuntime<S, E> runtime = new StateMachineRuntime<S, E>() {
        @Override//w  w  w .  j a  v  a 2 s.  co  m
        public StateContext<S, E> getStateContext() {
            return stateContext;
        }
    };
    List<Object> results = new ArrayList<Object>();
    for (StateMachineHandler<? extends Annotation, S, E> handler : stateMachineHandlers) {
        try {
            results.add(handler.handle(runtime));
        } catch (Throwable e) {
            log.error("Error processing handler " + handler, e);
        }
    }
    return results;
}