org.apache.mina.statemachine.context

## Class IoSessionStateContextLookup

- java.lang.Object
- - org.apache.mina.statemachine.context.AbstractStateContextLookup
  - - 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`.
  Author:
    Apache MINA Project

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_SESSION_ATTRIBUTE_NAME` The default name of the `IoSession` attribute used to store the `StateContext` object.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IoSessionStateContextLookup()` Creates a new instance using a `DefaultStateContextFactory` to create `StateContext` objects for new `IoSession`s.
    `IoSessionStateContextLookup(StateContextFactory contextFactory)` Creates a new instance using the specified `StateContextFactory` to create `StateContext` objects for new `IoSession`s.
    `IoSessionStateContextLookup(StateContextFactory contextFactory, String sessionAttributeName)` Creates a new instance using the specified `StateContextFactory` to create `StateContext` objects for new `IoSession`s.
    `IoSessionStateContextLookup(String sessionAttributeName)` Creates a new instance using a `DefaultStateContextFactory` to create `StateContext` objects for new `IoSession`s.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 `IoSession`s.

    - #### IoSessionStateContextLookup

          public IoSessionStateContextLookup(String sessionAttributeName)

      Creates a new instance using a `DefaultStateContextFactory` to create `StateContext` objects for new `IoSession`s.
      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 `IoSession`s.
      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 `IoSession`s.
      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-2012 Apache MINA Project. All Rights Reserved.