| Modifier and Type | Field and Description |
|---|---|
protected Properties |
props |
| Constructor and Description |
|---|
StateMachine(String name) |
StateMachine(String name,
Properties props) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(StateMachineListener listener) |
State |
createStartState(String name) |
State |
createState(String name) |
State |
createState(String name,
boolean isEndState) |
void |
eventHappens(Event event) |
void |
eventHappens(Event event,
boolean sync) |
protected void |
executeFirstTransition()
This should only execute once! Execute this to transition this state machine into its initial state.
|
int |
getEventQueueSize() |
Object |
getFromMachineState(Object key) |
State |
getState() |
boolean |
isMachineRunning() |
void |
kill()
This will kill the internal thread that fires the next event.
|
Object |
putFromMachineState(String key,
Object value) |
boolean |
register(Event event) |
void |
run() |
void |
setSyncDefault(boolean syncDefault) |
void |
startMachine(boolean startThread) |
boolean |
waitUntilDone(long timeout) |
protected Properties props
public StateMachine(String name)
public StateMachine(String name, Properties props)
public boolean register(Event event)
public boolean add(StateMachineListener listener)
public State createStartState(String name) throws ConfigException
ConfigExceptionpublic void startMachine(boolean startThread)
throws ConfigException
ConfigExceptionprotected void executeFirstTransition()
throws ConfigException
ConfigExceptionpublic void eventHappens(Event event) throws ConfigException
ConfigExceptionpublic void eventHappens(Event event, boolean sync) throws ConfigException
ConfigExceptionpublic void kill()
public boolean isMachineRunning()
public boolean waitUntilDone(long timeout)
public State getState()
public int getEventQueueSize()
public void setSyncDefault(boolean syncDefault)
Copyright © 2017. All rights reserved.