|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.conversation.StateMachine
Represents a state-machine view of a conversation. A conversation is viewed as a set of states and trnasitions between these states. There exist two roles in the conversation of which only one is active for a particular state-machine.
OLD VERSION -- TO BE DELETED Replaced by com.ibm.conversation.base.BasicCpStateMachine
Supports a property change listener for the current state of execution of the state machine. The identifier for the listener is "currentStateName"
Field Summary | |
---|---|
protected java.beans.PropertyChangeSupport |
propertySupport
Firing property change support |
protected static long |
serialVersionUID
Serialized version identifier in form YYYYMMDDVerRelModxx |
Fields inherited from interface com.ibm.able.conversation.StateMachineInterface |
---|
CURRENT_STATE_PROPERTY |
Constructor Summary | |
---|---|
StateMachine(ConversationParser cp)
Constructor for StateMachine - Uses a ConversationParser to obtain data associated with the conversation - namely the name, states, transitions and the initial state name |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener newListener)
Adds the property chage listener for the given property |
java.lang.String |
getActiveRole()
Returns the active role of the state-machine |
java.util.Enumeration |
getAllStateIds()
Returns an enumeration of String ids of all states in the state machine |
java.util.Enumeration |
getAllTransitionNames(java.lang.String stateId)
Returns an enumeration of all transition names from the state identified by the state id. |
State |
getCurrentState()
Returns the current state name of the statemachine |
java.lang.String |
getCurrentStateId()
Return the current state id of the state-machine (conversation) during execution |
java.lang.String |
getCurrentStateName()
Returns the name of the current state during the execution of the state-machine |
java.lang.String |
getEvent(java.lang.String stateId,
java.lang.String transitionName)
Returns the event name associated with the transition from a particular state |
java.lang.String |
getInitialStateId()
Return the initial state id of the state-machine (conversation) |
java.lang.String |
getInitialStateName()
Returns the name of the initial state of the state-machine |
java.lang.String |
getName()
Returns the name of the state-machine(conversation) |
java.util.Vector |
getRoles()
Returns the set of roles in the conversation |
State |
getState(java.lang.String stateName)
Get a particular state given the state name |
java.util.Enumeration |
getStateNames()
Returns an enumeration of names of states in the state-machine |
java.util.Enumeration |
getStates()
Returns an enumeration of states in the state-machine |
java.lang.String |
getTargetStateId(java.lang.String sourceStateId,
java.lang.String transitionName)
Returns the identifier of the state reached from a state by making a particular transition. |
Transition |
getTransition(java.lang.String transitionName)
Returns the transition object for the given transition name(id) |
java.util.Enumeration |
getTransitionNames(java.lang.String stateName)
Returns the names(ids) of all transitions from the given state |
java.util.Enumeration |
getTransitions(java.lang.String stateName)
Returns the set of all transitions from the given state(name) |
boolean |
isActiveInState(State state)
Finds if the state machine is active in the given state |
boolean |
isActiveInState(java.lang.String stateName)
Finds if the state machine is active in the given state (name) |
boolean |
isLoadChildState(java.lang.String stateId)
Checks if a particular state is a state where a new child CP is loaded |
boolean |
isTerminalState(java.lang.String stateId)
Checks if a particular state is a terminal state |
void |
reset()
Set the current-state to the initial state of the state-machine effectively resetting the state-machine |
void |
setActiveRole(java.lang.String role)
Sets the active role of the state-machine |
void |
setCurrentStateName(java.lang.String name)
Set the current state of the state-machine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final long serialVersionUID
protected transient java.beans.PropertyChangeSupport propertySupport
Constructor Detail |
public StateMachine(ConversationParser cp)
cp
- ConversationParser object that parses the cp-xml
to obtain the relevant informationMethod Detail |
public java.lang.String getName()
public java.util.Vector getRoles()
getRoles
in interface StateMachineInterface
public java.lang.String getInitialStateName()
public java.lang.String getInitialStateId()
StateMachineInterface
getInitialStateId
in interface StateMachineInterface
StateMachineInterface.getInitialStateId()
public java.lang.String getCurrentStateName()
public java.lang.String getCurrentStateId()
StateMachineInterface
getCurrentStateId
in interface StateMachineInterface
StateMachineInterface.getCurrentStateId()
public void setCurrentStateName(java.lang.String name)
name
- Name of the state to be set as the current statepublic State getCurrentState()
public java.util.Enumeration getStates()
public java.util.Enumeration getStateNames()
public java.util.Enumeration getAllStateIds()
StateMachineInterface
getAllStateIds
in interface StateMachineInterface
StateMachineInterface.getAllStateIds()
public java.lang.String getActiveRole()
public void setActiveRole(java.lang.String role)
role
- the active role to be assumed by the state-machinepublic void reset()
public State getState(java.lang.String stateName)
stateName
- the name of the required state
public java.util.Enumeration getTransitions(java.lang.String stateName)
stateName
- The name of a state
public java.util.Enumeration getTransitionNames(java.lang.String stateName)
stateName
- The name of the state
public java.util.Enumeration getAllTransitionNames(java.lang.String stateId)
StateMachineInterface
getAllTransitionNames
in interface StateMachineInterface
StateMachineInterface.getAllTransitionNames(String)
public Transition getTransition(java.lang.String transitionName)
WARNING: Could return unexpected results if different transitions from different states are allowed to have the same name(id)
transitionName
- The name of the transition
public boolean isActiveInState(java.lang.String stateName)
stateName
- name of the state
return true if the state-machine is active in the state, false otherwise
public boolean isActiveInState(State state)
state
- the state
return true if the state-machine is active in the state, false otherwise
public void addPropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener newListener)
addPropertyChangeListener
in interface StateMachineInterface
property
- Name of the property
newListener
- The property change listenerpublic java.lang.String getTargetStateId(java.lang.String sourceStateId, java.lang.String transitionName)
StateMachineInterface
getTargetStateId
in interface StateMachineInterface
StateMachineInterface.getTargetStateId(String,String)
public boolean isTerminalState(java.lang.String stateId)
StateMachineInterface
isTerminalState
in interface StateMachineInterface
StateMachineInterface.isTerminalState(String)
public boolean isLoadChildState(java.lang.String stateId)
StateMachineInterface
isLoadChildState
in interface StateMachineInterface
StateMachineInterface.isLoadChildState(String)
public java.lang.String getEvent(java.lang.String stateId, java.lang.String transitionName)
StateMachineInterface
getEvent
in interface StateMachineInterface
StateMachineInterface.getEvent(String,String)
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |