org.apache.mina.statemachine.context
Interface StateContext

All Known Implementing Classes:
AbstractStateContext, DefaultStateContext

public interface StateContext

StateContext objects are used to store the current State and any application specific attributes for a specific client of a StateMachine. Since StateMachines are singletons and shared by all clients using the StateMachine this is where client specific data needs to be stored.

Author:
Apache MINA Project

Method Summary
 Object getAttribute(Object key)
          Returns the value of the attribute with the specified key or nullif not found.
 State getCurrentState()
          Returns the current State.
 void setAttribute(Object key, Object value)
          Sets the value of the attribute with the specified key.
 void setCurrentState(State state)
          Sets the current State.
 

Method Detail

getCurrentState

State getCurrentState()
Returns the current State. This is only meant for internal use.

Returns:
the current State.

setCurrentState

void setCurrentState(State state)
Sets the current State. This is only meant for internal use. Don't call it directly!

Parameters:
state - the new current State.

getAttribute

Object getAttribute(Object key)
Returns the value of the attribute with the specified key or nullif not found.

Parameters:
key - the key.
Returns:
the value or null.

setAttribute

void setAttribute(Object key,
                  Object value)
Sets the value of the attribute with the specified key.

Parameters:
key - the key.
value - the value.


Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.