Modifier and Type | Class and Description |
---|---|
static class |
FSM.FSMBuilder<T>
Fluid FSM builder
|
Constructor and Description |
---|
FSM(Persister<T> persister)
FSM Constructor with the Persister responsible for setting the State on the Entity
|
FSM(String name)
FSM Constructor with the name of the FSM
|
FSM(String name,
Persister<T> persister)
FSM Constructor with the name of the FSM and Persister responsible for setting the State on the Entity
|
FSM(String name,
Persister<T> persister,
int retryAttempts,
int retryInterval)
FSM Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
executeAction(Action<T> action,
T stateful,
String event,
String from,
String to,
Object... args) |
State<T> |
getCurrentState(T obj) |
String |
getName() |
Persister<T> |
getPersister() |
int |
getRetryAttempts() |
int |
getRetryInterval() |
protected Transition<T> |
getTransition(String event,
State<T> current) |
State<T> |
onEvent(T stateful,
String event,
Object... args)
Process event.
|
protected void |
setCurrent(T stateful,
State<T> current,
State<T> next) |
void |
setName(String name) |
void |
setPersister(Persister<T> persister) |
void |
setRetryAttempts(int retries) |
void |
setRetryInterval(int retryInterval) |
protected State<T> |
transition(T stateful,
State<T> current,
String event,
Transition<T> transition,
Object... args) |
public FSM(String name)
name
- Name associated with the FSMpublic FSM(Persister<T> persister)
persister
- Persister responsible for setting the State on the Entitypublic FSM(String name, Persister<T> persister)
name
- Name associated with the FSMpersister
- Persister responsible for setting the State on the Entitypublic FSM(String name, Persister<T> persister, int retryAttempts, int retryInterval)
name
- Name associated with the FSMpersister
- Persister responsible for setting the State on the EntityretryAttempts
- Number of Retry Attempts. A value of -1 indicates unlimited AttemptsretryInterval
- Time between Retry Attempts in millisecondspublic State<T> onEvent(T stateful, String event, Object... args) throws TooBusyException
stateful
- The Stateful Entityevent
- The Eventargs
- Optional parameters to pass into the ActionTooBusyException
- Exception indicating that we've exceeded the number of RetryAttemptspublic int getRetryAttempts()
public void setRetryAttempts(int retries)
public int getRetryInterval()
public void setRetryInterval(int retryInterval)
public String getName()
public void setName(String name)
protected Transition<T> getTransition(String event, State<T> current)
protected State<T> transition(T stateful, State<T> current, String event, Transition<T> transition, Object... args) throws RetryException
RetryException
protected void setCurrent(T stateful, State<T> current, State<T> next) throws StaleStateException
StaleStateException
protected void executeAction(Action<T> action, T stateful, String event, String from, String to, Object... args) throws RetryException
RetryException
Copyright © 2016. All rights reserved.