org.apache.mina.statemachine.context
Class AbstractStateContext

java.lang.Object
  extended by org.apache.mina.statemachine.context.AbstractStateContext
All Implemented Interfaces:
StateContext
Direct Known Subclasses:
DefaultStateContext

public abstract class AbstractStateContext
extends Object
implements StateContext

Abstract StateContext which uses a Map to store the attributes.

Version:
$Rev: 586695 $, $Date: 2007-10-20 12:01:17 +0200 (sam, 20 oct 2007) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Constructor Summary
AbstractStateContext()
           
 
Method Summary
 Object getAttribute(Object key)
          Returns the value of the attribute with the specified key or nullif not found.
protected  Map<Object,Object> getAttributes()
           
 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractStateContext

public AbstractStateContext()
Method Detail

getAttribute

public Object getAttribute(Object key)
Description copied from interface: StateContext
Returns the value of the attribute with the specified key or nullif not found.

Specified by:
getAttribute in interface StateContext
Parameters:
key - the key.
Returns:
the value or null.

getCurrentState

public State getCurrentState()
Description copied from interface: StateContext
Returns the current State. This is only meant for internal use.

Specified by:
getCurrentState in interface StateContext
Returns:
the current State.

setAttribute

public void setAttribute(Object key,
                         Object value)
Description copied from interface: StateContext
Sets the value of the attribute with the specified key.

Specified by:
setAttribute in interface StateContext
Parameters:
key - the key.
value - the value.

setCurrentState

public void setCurrentState(State state)
Description copied from interface: StateContext
Sets the current State. This is only meant for internal use. Don't call it directly!

Specified by:
setCurrentState in interface StateContext
Parameters:
state - the new current State.

getAttributes

protected Map<Object,Object> getAttributes()

toString

public String toString()
Overrides:
toString in class Object


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