org.apache.mina.statemachine.context
Class IoSessionStateContextLookup

java.lang.Object
  extended by org.apache.mina.statemachine.context.AbstractStateContextLookup
      extended by org.apache.mina.statemachine.context.IoSessionStateContextLookup
All Implemented Interfaces:
StateContextLookup

public class IoSessionStateContextLookup
extends AbstractStateContextLookup

MINA specific StateContextLookup which uses an IoSession attribute to store the StateContextLookup.

Version:
$Rev: 589477 $, $Date: 2007-10-29 04:19:58 +0100 (Mon, 29 Oct 2007) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Field Summary
static String STATE_CONTEXT
          The name of the IoSession attribute used to store the StateContext object.
 
Constructor Summary
IoSessionStateContextLookup()
          Creates a new instance using a DefaultStateContextFactory to create StateContext objects for new IoSessions.
IoSessionStateContextLookup(StateContextFactory contextFactory)
          Creates a new instance using the specified StateContextFactory to create StateContext objects for new IoSessions.
 
Method Summary
protected  StateContext lookup(Object eventArg)
          Extracts a StateContext from the specified event argument which is an instance of a class AbstractStateContextLookup.supports(Class) returns true for.
protected  void store(Object eventArg, StateContext context)
          Stores a new StateContext in the specified event argument which is an instance of a class AbstractStateContextLookup.supports(Class) returns true for.
protected  boolean supports(Class<?> c)
          Must return true for any Class that this StateContextLookup can use to store and lookup StateContext objects.
 
Methods inherited from class org.apache.mina.statemachine.context.AbstractStateContextLookup
lookup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_CONTEXT

public static final String STATE_CONTEXT
The name of the IoSession attribute used to store the StateContext object.

Constructor Detail

IoSessionStateContextLookup

public IoSessionStateContextLookup()
Creates a new instance using a DefaultStateContextFactory to create StateContext objects for new IoSessions.


IoSessionStateContextLookup

public IoSessionStateContextLookup(StateContextFactory contextFactory)
Creates a new instance using the specified StateContextFactory to create StateContext objects for new IoSessions.

Parameters:
contextFactory - the StateContextFactory.
Method Detail

lookup

protected StateContext lookup(Object eventArg)
Description copied from class: AbstractStateContextLookup
Extracts a StateContext from the specified event argument which is an instance of a class AbstractStateContextLookup.supports(Class) returns true for.

Specified by:
lookup in class AbstractStateContextLookup
Parameters:
eventArg - the event argument.
Returns:
the StateContext.

store

protected void store(Object eventArg,
                     StateContext context)
Description copied from class: AbstractStateContextLookup
Stores a new StateContext in the specified event argument which is an instance of a class AbstractStateContextLookup.supports(Class) returns true for.

Specified by:
store in class AbstractStateContextLookup
Parameters:
eventArg - the event argument.
context - the StateContext to be stored.

supports

protected boolean supports(Class<?> c)
Description copied from class: AbstractStateContextLookup
Must return true for any Class that this StateContextLookup can use to store and lookup StateContext objects.

Specified by:
supports in class AbstractStateContextLookup
Parameters:
c - the class.
Returns:
true or false.


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