|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atomikos.finitestates.FSMImp<Status>
public class FSMImp<Status>
Implementation of a finite state machine. The following consistency is provided:
| Constructor Summary | |
|---|---|
FSMImp(Object eventsource,
TransitionTable<Status> transitiontable,
Status initialstate)
Creates a new instance with a given event source. |
|
FSMImp(TransitionTable<Status> transitiontable,
Status initialstate)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
addEnterListener(Hashtable<Status,Hashtable<EventListener,Object>> listeners,
EventListener lstnr,
Status state)
Help function for adding enter listeners. |
void |
addFSMEnterListener(FSMEnterListener<Status> lstnr,
Status state)
Add an enter event listener. |
void |
addFSMPreEnterListener(FSMPreEnterListener<Status> lstnr,
Status state)
|
void |
addFSMPreTransitionListener(FSMPreTransitionListener<Status> lstnr,
Status from,
Status to)
|
void |
addFSMTransitionListener(FSMTransitionListener<Status> lstnr,
Status from,
Status to)
|
protected void |
addTransitionListener(Hashtable listeners,
Object lstnr,
Status from,
Status to)
Help function for adding transition listeners. |
Status |
getState()
|
protected void |
notifyListeners(Hashtable<Status,Hashtable<EventListener,Object>> listeners,
Status state,
boolean pre)
Notify the enter listeners. |
protected void |
notifyListeners(Hashtable<Status,Hashtable<EventListener,Object>> listeners,
Status from,
Status to,
boolean pre)
Notify transition listeners. |
void |
setState(Status state)
To set a new state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FSMImp(TransitionTable<Status> transitiontable,
Status initialstate)
transitiontable - The transitiontable with valid
transitions.initialstate - The initial state of the FSM.
public FSMImp(Object eventsource,
TransitionTable<Status> transitiontable,
Status initialstate)
eventsource - The object to be used as source of events.transitiontable - The transitiontable for state changes.initialstate - The initial state of the FSM.| Method Detail |
|---|
protected void addEnterListener(Hashtable<Status,Hashtable<EventListener,Object>> listeners,
EventListener lstnr,
Status state)
listeners - One of the listener tables.lstnr - The listener to add.state - The state for which the listener wants to be notified.
protected void addTransitionListener(Hashtable listeners,
Object lstnr,
Status from,
Status to)
listeners - One of the transition listener tables.lstnr - The listener to add.from - The start state of the transition.to - The end state of the transition.
protected void notifyListeners(Hashtable<Status,Hashtable<EventListener,Object>> listeners,
Status state,
boolean pre)
listeners - One of the enter listener tables.state - The state about to enter (or entered).pre - True iff before entering.
protected void notifyListeners(Hashtable<Status,Hashtable<EventListener,Object>> listeners,
Status from,
Status to,
boolean pre)
listeners - One of the transition listener tables.from - The initial state.to - The end state.pre - True iff before transition.public Status getState()
getState in interface Stateful<Status>FSM
public void setState(Status state)
throws IllegalStateException
StateMutable
setState in interface StateMutable<Status>state - The new state.
IllegalStateException - if the new state transition to
the new state is not allowed.StateMutable
public void addFSMEnterListener(FSMEnterListener<Status> lstnr,
Status state)
FSMEnterEventSource
addFSMEnterListener in interface FSMEnterEventSource<Status>lstnr - The listener.state - The state to listen on.FSMEnterEventSource
public void addFSMPreEnterListener(FSMPreEnterListener<Status> lstnr,
Status state)
addFSMPreEnterListener in interface FSMPreEnterEventSource<Status>FSMPreEnterEventSource
public void addFSMTransitionListener(FSMTransitionListener<Status> lstnr,
Status from,
Status to)
addFSMTransitionListener in interface FSMTransitionEventSource<Status>FSMTransitionEventSource
public void addFSMPreTransitionListener(FSMPreTransitionListener<Status> lstnr,
Status from,
Status to)
addFSMPreTransitionListener in interface FSMPreTransitionEventSource<Status>FSMPreTransitionEventSource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||