org.jdiameter.api.app
Interface StateMachine

All Known Subinterfaces:
ClientAccSession, ClientAuthSession, ClientCCASession, ClientShSession, ServerAccSession, ServerAuthSession, ServerCCASession, ServerShSession

public interface StateMachine

The StateMachine lets you organize event handling, if the order of the events are important to you.

Version:
1.5.1 Final

Method Summary
 void addStateChangeNotification(StateChangeListener listener)
          Add a new state change listener
<E> E
getState(java.lang.Class<E> stateType)
          Get the current state
 boolean handleEvent(StateEvent event)
          Handle an event in the current state.
 void removeStateChangeNotification(StateChangeListener listener)
          Remove a state change listener
 

Method Detail

addStateChangeNotification

void addStateChangeNotification(StateChangeListener listener)
Add a new state change listener

Parameters:
listener - a reference to the listener that will get information about state changes.

removeStateChangeNotification

void removeStateChangeNotification(StateChangeListener listener)
Remove a state change listener

Parameters:
listener - a reference to the listener that will get information about state changes.

handleEvent

boolean handleEvent(StateEvent event)
                    throws InternalException,
                           OverloadException
Handle an event in the current state.

Parameters:
event - processing event
Returns:
true if staterocessed
Throws:
OverloadException - if queue of state mashine is full
InternalException - if FSM has internal error

getState

<E> E getState(java.lang.Class<E> stateType)
Get the current state

Parameters:
stateType - type of state
Returns:
current state


Copyright © 2009. All Rights Reserved.