|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mina.statemachine.context.AbstractStateContextLookup
public abstract class AbstractStateContextLookup
Abstract StateContextLookup implementation. The lookup(Object[])
method will loop through the event arguments and call the supports(Class)
method for each of them. The first argument that this method returns
true for will be passed to the abstract lookup(Object)
method which should try to extract a StateContext from the argument.
If none is found a new StateContext will be created and stored in the
event argument using the store(Object, StateContext) method.
| Constructor Summary | |
|---|---|
AbstractStateContextLookup(StateContextFactory contextFactory)
Creates a new instance which uses the specified StateContextFactory
to create StateContext objects. |
|
| Method Summary | |
|---|---|
protected abstract StateContext |
lookup(Object eventArg)
Extracts a StateContext from the specified event argument which
is an instance of a class supports(Class) returns
true for. |
StateContext |
lookup(Object[] eventArgs)
Searches the arguments from an Event and returns a
StateContext if any of the arguments holds one. |
protected abstract void |
store(Object eventArg,
StateContext context)
Stores a new StateContext in the specified event argument which
is an instance of a class supports(Class) returns
true for. |
protected abstract 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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractStateContextLookup(StateContextFactory contextFactory)
StateContextFactory
to create StateContext objects.
contextFactory - the factory.| Method Detail |
|---|
public StateContext lookup(Object[] eventArgs)
StateContextLookupEvent and returns a
StateContext if any of the arguments holds one. NOTE! This method
must create a new StateContext if a compatible object is in
the arguments and the next time that same object is passed to this
method the same StateContext should be returned.
lookup in interface StateContextLookupprotected abstract StateContext lookup(Object eventArg)
StateContext from the specified event argument which
is an instance of a class supports(Class) returns
true for.
eventArg - the event argument.
StateContext.
protected abstract void store(Object eventArg,
StateContext context)
StateContext in the specified event argument which
is an instance of a class supports(Class) returns
true for.
eventArg - the event argument.context - the StateContext to be stored.protected abstract boolean supports(Class<?> c)
true for any Class that this
StateContextLookup can use to store and lookup
StateContext objects.
c - the class.
true or false.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||