List of usage examples for org.springframework.statemachine.action Action execute
void execute(StateContext<S, E> context);
From source file:org.springframework.statemachine.state.AbstractState.java
/** * Execute action and notify action listener if set. * * @param action the action/*from www.ja v a 2 s . com*/ * @param context the context */ protected void executeAction(Action<S, E> action, StateContext<S, E> context) { long now = System.currentTimeMillis(); action.execute(context); if (this.actionListener != null) { try { this.actionListener.onExecute(context.getStateMachine(), action, System.currentTimeMillis() - now); } catch (Exception e) { log.warn("Error with actionListener", e); } } }
From source file:org.springframework.statemachine.transition.AbstractTransition.java
protected final void executeAllActions(StateContext<S, E> context) { if (actions == null) { return;//from ww w . j a va 2s.co m } for (Action<S, E> action : actions) { long now = System.currentTimeMillis(); action.execute(context); if (this.actionListener != null) { this.actionListener.onExecute(context.getStateMachine(), action, System.currentTimeMillis() - now); } } }