Expose extended state

- ExtendedState is now exposed via
  StateMachine interface.
- Add "sm variables" command to samples.
This commit is contained in:
Janne Valkealahti
2015-04-04 10:24:50 +01:00
parent cceec5500a
commit a4fcb9da97
3 changed files with 36 additions and 1 deletions

View File

@@ -37,6 +37,13 @@ public interface StateMachine<S, E> extends Region<S, E> {
*/
State<S,E> getInitialState();
/**
* Gets the state machine extended state.
*
* @return extended state
*/
ExtendedState getExtendedState();
/**
* Adds the state listener.
*

View File

@@ -177,6 +177,11 @@ public abstract class AbstractStateMachine<S, E> extends LifecycleObjectSupport
return initialState;
}
@Override
public ExtendedState getExtendedState() {
return extendedState;
}
@Override
public boolean sendEvent(Message<E> event) {
if (isComplete() || !isRunning()) {