org.apache.mina.statemachine.context
Class SingletonStateContextLookup

java.lang.Object
  extended by org.apache.mina.statemachine.context.SingletonStateContextLookup
All Implemented Interfaces:
StateContextLookup

public class SingletonStateContextLookup
extends Object
implements StateContextLookup

StateContextLookup implementation which always returns the same StateContext instance.

Version:
$Rev: 586695 $, $Date: 2007-10-20 12:01:17 +0200 (sam, 20 oct 2007) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Constructor Summary
SingletonStateContextLookup()
          Creates a new instance which always returns the same DefaultStateContext instance.
SingletonStateContextLookup(StateContextFactory contextFactory)
          Creates a new instance which uses the specified StateContextFactory to create the single instance.
 
Method Summary
 StateContext lookup(Object[] eventArgs)
          Searches the arguments from an Event and returns a StateContext if any of the arguments holds one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonStateContextLookup

public SingletonStateContextLookup()
Creates a new instance which always returns the same DefaultStateContext instance.


SingletonStateContextLookup

public SingletonStateContextLookup(StateContextFactory contextFactory)
Creates a new instance which uses the specified StateContextFactory to create the single instance.

Parameters:
contextFactory - the StateContextFactory to use to create the singleton instance.
Method Detail

lookup

public StateContext lookup(Object[] eventArgs)
Description copied from interface: StateContextLookup
Searches the arguments from an Event 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.

Specified by:
lookup in interface StateContextLookup


Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.