Class SingletonStateContextLookup
java.lang.Object
org.apache.mina.statemachine.context.SingletonStateContextLookup
- All Implemented Interfaces:
StateContextLookup
StateContextLookup implementation which always returns the same
StateContext instance.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance which always returns the sameDefaultStateContextinstance.SingletonStateContextLookup(StateContextFactory contextFactory) Creates a new instance which uses the specifiedStateContextFactoryto create the single instance. -
Method Summary
Modifier and TypeMethodDescriptionSearches the arguments from anEventand returns aStateContextif any of the arguments holds one.
-
Field Details
-
context
-
-
Constructor Details
-
SingletonStateContextLookup
public SingletonStateContextLookup()Creates a new instance which always returns the sameDefaultStateContextinstance. -
SingletonStateContextLookup
Creates a new instance which uses the specifiedStateContextFactoryto create the single instance.- Parameters:
contextFactory- theStateContextFactoryto use to create the singleton instance.
-
-
Method Details
-
lookup
Description copied from interface:StateContextLookupSearches the arguments from anEventand returns aStateContextif any of the arguments holds one. NOTE! This method must create a newStateContextif a compatible object is in the arguments and the next time that same object is passed to this method the sameStateContextshould be returned.- Specified by:
lookupin interfaceStateContextLookup- Parameters:
eventArgs- The arguments we are looking for- Returns:
- The StateContext we are looking for
-