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: 671827 $, $Date: 2008-06-26 10:49:48 +0200 (jeu, 26 jun 2008) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Field Summary
static String DEFAULT_SESSION_ATTRIBUTE_NAME
          The default 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.
IoSessionStateContextLookup(StateContextFactory contextFactory, String sessionAttributeName)
          Creates a new instance using the specified StateContextFactory to create StateContext objects for new IoSessions.
IoSessionStateContextLookup(String sessionAttributeName)
          Creates a new instance using a DefaultStateContextFactory 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

DEFAULT_SESSION_ATTRIBUTE_NAME

public static final String DEFAULT_SESSION_ATTRIBUTE_NAME
The default 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(String sessionAttributeName)
Creates a new instance using a DefaultStateContextFactory to create StateContext objects for new IoSessions.

Parameters:
sessionAttributeName - the name of the IoSession attribute used to store the StateContext object.

IoSessionStateContextLookup

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

Parameters:
contextFactory - the StateContextFactory.

IoSessionStateContextLookup

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

Parameters:
contextFactory - the StateContextFactory.
sessionAttributeName - the name of the IoSession attribute used to store the StateContext object.
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-2008 Apache MINA Project. All Rights Reserved.