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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_SESSION_ATTRIBUTE_NAMEThe default name of theIoSessionattribute used to store theStateContextobject.private java.lang.StringsessionAttributeName
-
Constructor Summary
Constructors Constructor Description IoSessionStateContextLookup()Creates a new instance using aDefaultStateContextFactoryto createStateContextobjects for newIoSessions.IoSessionStateContextLookup(java.lang.String sessionAttributeName)Creates a new instance using aDefaultStateContextFactoryto createStateContextobjects for newIoSessions.IoSessionStateContextLookup(StateContextFactory contextFactory)Creates a new instance using the specifiedStateContextFactoryto createStateContextobjects for newIoSessions.IoSessionStateContextLookup(StateContextFactory contextFactory, java.lang.String sessionAttributeName)Creates a new instance using the specifiedStateContextFactoryto createStateContextobjects for newIoSessions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StateContextlookup(java.lang.Object eventArg)Extracts aStateContextfrom the specified event argument which is an instance of a classAbstractStateContextLookup.supports(Class)returnstruefor.protected voidstore(java.lang.Object eventArg, StateContext context)Stores a newStateContextin the specified event argument which is an instance of a classAbstractStateContextLookup.supports(Class)returnstruefor.protected booleansupports(java.lang.Class<?> c)Must returntruefor anyClassthat thisStateContextLookupcan use to store and lookupStateContextobjects.-
Methods inherited from class org.apache.mina.statemachine.context.AbstractStateContextLookup
lookup
-
-
-
-
Field Detail
-
DEFAULT_SESSION_ATTRIBUTE_NAME
public static final java.lang.String DEFAULT_SESSION_ATTRIBUTE_NAME
The default name of theIoSessionattribute used to store theStateContextobject.
-
sessionAttributeName
private final java.lang.String sessionAttributeName
-
-
Constructor Detail
-
IoSessionStateContextLookup
public IoSessionStateContextLookup()
Creates a new instance using aDefaultStateContextFactoryto createStateContextobjects for newIoSessions.
-
IoSessionStateContextLookup
public IoSessionStateContextLookup(java.lang.String sessionAttributeName)
Creates a new instance using aDefaultStateContextFactoryto createStateContextobjects for newIoSessions.- Parameters:
sessionAttributeName- the name of theIoSessionattribute used to store theStateContextobject.
-
IoSessionStateContextLookup
public IoSessionStateContextLookup(StateContextFactory contextFactory)
Creates a new instance using the specifiedStateContextFactoryto createStateContextobjects for newIoSessions.- Parameters:
contextFactory- theStateContextFactory.
-
IoSessionStateContextLookup
public IoSessionStateContextLookup(StateContextFactory contextFactory, java.lang.String sessionAttributeName)
Creates a new instance using the specifiedStateContextFactoryto createStateContextobjects for newIoSessions.- Parameters:
contextFactory- theStateContextFactory.sessionAttributeName- the name of theIoSessionattribute used to store theStateContextobject.
-
-
Method Detail
-
lookup
protected StateContext lookup(java.lang.Object eventArg)
Description copied from class:AbstractStateContextLookupExtracts aStateContextfrom the specified event argument which is an instance of a classAbstractStateContextLookup.supports(Class)returnstruefor.- Specified by:
lookupin classAbstractStateContextLookup- Parameters:
eventArg- the event argument.- Returns:
- the
StateContext.
-
store
protected void store(java.lang.Object eventArg, StateContext context)Description copied from class:AbstractStateContextLookupStores a newStateContextin the specified event argument which is an instance of a classAbstractStateContextLookup.supports(Class)returnstruefor.- Specified by:
storein classAbstractStateContextLookup- Parameters:
eventArg- the event argument.context- theStateContextto be stored.
-
supports
protected boolean supports(java.lang.Class<?> c)
Description copied from class:AbstractStateContextLookupMust returntruefor anyClassthat thisStateContextLookupcan use to store and lookupStateContextobjects.- Specified by:
supportsin classAbstractStateContextLookup- Parameters:
c- the class.- Returns:
trueorfalse.
-
-