Add new method isStateMachineManaged

Determines if the given machine identifier denotes a known managed state machine.
This commit is contained in:
Vincent Privat
2019-03-14 19:00:27 +01:00
committed by Janne Valkealahti
parent 7df664d306
commit 675fdf07de

View File

@@ -128,6 +128,18 @@ public class DefaultStateMachineService<S, E> implements StateMachineService<S,
}
}
/**
* Determines if the given machine identifier denotes a known managed state machine.
*
* @param machineId machine identifier
* @return true if machineId denotes a known managed state machine currently in memory
*/
public boolean hasStateMachine(String machineId) {
synchronized (machines) {
return machines.containsKey(machineId);
}
}
/**
* Sets the state machine persist.
*