public class IoSessionStateContextLookup extends AbstractStateContextLookup
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
DEFAULT_SESSION_ATTRIBUTE_NAME
The default name of the
IoSession attribute used to store the
StateContext object. |
构造器和说明 |
---|
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,
java.lang.String sessionAttributeName)
Creates a new instance using the specified
StateContextFactory to
create StateContext objects for new IoSession s. |
IoSessionStateContextLookup(java.lang.String sessionAttributeName)
Creates a new instance using a
DefaultStateContextFactory to
create StateContext objects for new IoSession s. |
限定符和类型 | 方法和说明 |
---|---|
protected StateContext |
lookup(java.lang.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(java.lang.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(java.lang.Class<?> c)
Must return true for any
Class that this
StateContextLookup can use to store and lookup
StateContext objects. |
lookup
public static final java.lang.String DEFAULT_SESSION_ATTRIBUTE_NAME
IoSession
attribute used to store the
StateContext
object.public IoSessionStateContextLookup()
DefaultStateContextFactory
to
create StateContext
objects for new IoSession
s.public IoSessionStateContextLookup(java.lang.String sessionAttributeName)
DefaultStateContextFactory
to
create StateContext
objects for new IoSession
s.sessionAttributeName
- the name of the IoSession
attribute
used to store the StateContext
object.public IoSessionStateContextLookup(StateContextFactory contextFactory)
StateContextFactory
to
create StateContext
objects for new IoSession
s.contextFactory
- the StateContextFactory
.public IoSessionStateContextLookup(StateContextFactory contextFactory, java.lang.String sessionAttributeName)
StateContextFactory
to
create StateContext
objects for new IoSession
s.contextFactory
- the StateContextFactory
.sessionAttributeName
- the name of the IoSession
attribute
used to store the StateContext
object.protected StateContext lookup(java.lang.Object eventArg)
AbstractStateContextLookup
StateContext
from the specified event argument which
is an instance of a class AbstractStateContextLookup.supports(Class)
returns
true for.lookup
在类中 AbstractStateContextLookup
eventArg
- the event argument.StateContext
.protected void store(java.lang.Object eventArg, StateContext context)
AbstractStateContextLookup
StateContext
in the specified event argument which
is an instance of a class AbstractStateContextLookup.supports(Class)
returns
true for.store
在类中 AbstractStateContextLookup
eventArg
- the event argument.context
- the StateContext
to be stored.protected boolean supports(java.lang.Class<?> c)
AbstractStateContextLookup
Class
that this
StateContextLookup
can use to store and lookup
StateContext
objects.supports
在类中 AbstractStateContextLookup
c
- the class.