Class SingletonStateContextLookup

    • 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​(java.lang.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
        Parameters:
        eventArgs - The arguments we are looking for
        Returns:
        The StateContext we are looking for