Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public interface StateMachine<T extends StateMachine<T, S, E, C>, S, E, C> exten
Collection<S> getAllStates();

Collection<ImmutableState<T, S, E, C>> getAllRawStates();

void setCurrentState(S currentState);

/**
* Dump current state machine data. This operation can only be done when state machine status is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,17 @@ public S getInitialState() {
}
}

@Override
public void setCurrentState(S currentState){
writeLock.lock();
try {
data.write().initialState(currentState);
data.write().currentState(null);
} finally {
writeLock.unlock();
}
}

private void entryAll(ImmutableState<T, S, E, C> origin, StateContext<T, S, E, C> stateContext) {
Stack<ImmutableState<T, S, E, C>> stack = new Stack<ImmutableState<T, S, E, C>>();

Expand Down