com.taserv.SMS
Interface SMStateIF

All Known Implementing Classes:
SMCompositeState, SMState

public interface SMStateIF

Defines contract for manipulating state behavior definitions and performing state transitions


Method Summary
 void _entryTransition()
          Performs the state entry transisions, it should not be used or overloaded by user SM.
 void _exitTransition()
          Performs the state exit transisions, it should not be used or overloaded by user SM.
 void addEntryTransition(EntryStateTransition trans)
          Adds entry transition to be perfomed every time the state becomes current
 void addExitTransition(ExitStateTransition trans)
          Adds exit transition to be perfomed every time other state replaces the state as current
 void addTransition(java.lang.Class triggerEventCls, StateTransition transition)
          Adds transition to the state.
 void addTransition(java.lang.Class triggerEventCls, StateTransition transition, java.lang.Enum newState)
          Adds transition to the state.
 void copy(SMStateIF state)
          Copies state data such as transitions from the parameter state to the state
 void entryTransition()
          Deprecated. replaced by addEntryTransition
 void exitTransition()
          Deprecated. replaced by addExitTransition
 java.util.HashSet<EntryStateTransition> getEntryTransitions()
          Returns the collection of the defined entry transitions
 java.util.HashMap<java.lang.Class,SMState.TransitionSegment> getEventTransitions()
          Returns collection of the transistions defined in the state
 java.util.HashSet<ExitStateTransition> getExitTransitions()
          Returns the collection of the defined exit transitions
 StateTransition getLastPerformedTrans()
          Returns the last transition performed by the state
 java.lang.Enum getStateID()
          Returns the Enum indetifying the state
 java.lang.String getStateName()
          Returns state name
 void removeEntryTransition(EntryStateTransition trans)
          Removed entry transition
 java.lang.Enum stateHandleEvent(SMEvent event)
          Performs transition identified by the event class.
 

Method Detail

getStateName

java.lang.String getStateName()
Returns state name


addTransition

void addTransition(java.lang.Class triggerEventCls,
                   StateTransition transition)
Adds transition to the state. If the transition for triggerEventCls exists, it will be replaced. New state returned by stateHandleEvent after executing the transition identified by the return value of the transition.

Parameters:
triggerEventCls - the class of the event that will trigger the transitions
transition - the transition object to be added

addTransition

void addTransition(java.lang.Class triggerEventCls,
                   StateTransition transition,
                   java.lang.Enum newState)
Adds transition to the state. If the transition for triggerEventCls exists, it will be replaced. New state returned by stateHandleEvent after executing the transition is newState if the return value of the transition is NULL

Parameters:
triggerEventCls - the class of the event that will trigger the transitions
transition - the transition object to be added
newState - Enum identifying the new state after performing the transition

stateHandleEvent

java.lang.Enum stateHandleEvent(SMEvent event)
                                throws SMStateCanNotHandleEvent
Performs transition identified by the event class. If the state does not have transition for the event class, SMStateCanNotHandleEvent thrown.

Parameters:
event - the event to be handled
Returns:
new state to set current. If transition object retuns non-NULL value, it is returned as new state, otherwise predefined newState returned
Throws:
SMStateCanNotHandleEvent - thrown if the state does not have a transition for the event class

_exitTransition

void _exitTransition()
Performs the state exit transisions, it should not be used or overloaded by user SM.


_entryTransition

void _entryTransition()
Performs the state entry transisions, it should not be used or overloaded by user SM.


entryTransition

void entryTransition()
Deprecated. replaced by addEntryTransition


exitTransition

void exitTransition()
Deprecated. replaced by addExitTransition


getStateID

java.lang.Enum getStateID()
Returns the Enum indetifying the state


addEntryTransition

void addEntryTransition(EntryStateTransition trans)
Adds entry transition to be perfomed every time the state becomes current

Parameters:
trans - the transition to add

removeEntryTransition

void removeEntryTransition(EntryStateTransition trans)
Removed entry transition

Parameters:
trans - the transition to remove

addExitTransition

void addExitTransition(ExitStateTransition trans)
Adds exit transition to be perfomed every time other state replaces the state as current

Parameters:
trans - the transition to add

copy

void copy(SMStateIF state)
          throws SMStateCanNotCopy
Copies state data such as transitions from the parameter state to the state

Parameters:
state - the state to copy data from
Throws:
SMStateCanNotCopy

getLastPerformedTrans

StateTransition getLastPerformedTrans()
Returns the last transition performed by the state


getEventTransitions

java.util.HashMap<java.lang.Class,SMState.TransitionSegment> getEventTransitions()
Returns collection of the transistions defined in the state

Returns:
the copy of the map of the defined transitions, the keys are the event classes that will trigger transitions

getEntryTransitions

java.util.HashSet<EntryStateTransition> getEntryTransitions()
Returns the collection of the defined entry transitions

Returns:
the copy of the Set of the entry transitions

getExitTransitions

java.util.HashSet<ExitStateTransition> getExitTransitions()
Returns the collection of the defined exit transitions

Returns:
the copy of the Set of the exit transitions


Copyright © 2004 TAServ. All Rights Reserved.