ibspan.tss.agents.sha.session
Class ActionDispatcherWithSessionTracking

java.lang.Object
  extended by jade.core.behaviours.Behaviour
      extended by jade.core.behaviours.CompositeBehaviour
          extended by jade.core.behaviours.SerialBehaviour
              extended by jade.core.behaviours.FSMBehaviour
                  extended by jade.proto.states.HandlerSelector
                      extended by ibspan.tss.messaging.SafeHandlerSelector
                          extended by ibspan.tss.agents.sha.session.ActionDispatcherWithSessionTracking
All Implemented Interfaces:
Serializable

public class ActionDispatcherWithSessionTracking
extends SafeHandlerSelector

This class resolves the handler behaviour responsible for handling with incoming request and tracks the session with user. More precisely, it has the following multiply functionality:

Author:
Maciej Gawinecki
See Also:
ActionDispatcher, Action, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jade.core.behaviours.Behaviour
Behaviour.RunnableChangedEvent
 
Field Summary
 
Fields inherited from class jade.proto.states.HandlerSelector
SELECTION_NOK, SELECTION_OK
 
Fields inherited from class jade.core.behaviours.FSMBehaviour
currentName, lastStates, previousName
 
Fields inherited from class jade.core.behaviours.CompositeBehaviour
currentExecuted
 
Fields inherited from class jade.core.behaviours.Behaviour
myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING
 
Constructor Summary
ActionDispatcherWithSessionTracking(Agent a, DataStore ds, HistoryLogger historyLogger, Object accessKey, Object actionNameKey, Object actKey)
          Constructs action dispatcher.
 
Method Summary
protected  Object getSelectionKey_internal(Object o)
          Subclasses must provide a concrete implementation for this method.
 void registerHandler(boolean requiresAuthorization, Object key, Behaviour h)
          Register the bounding between an handler and a key.
 
Methods inherited from class ibspan.tss.messaging.SafeHandlerSelector
getSelectionKey, registerErrorHandler
 
Methods inherited from class jade.proto.states.HandlerSelector
registerHandler
 
Methods inherited from class jade.core.behaviours.FSMBehaviour
checkTermination, deregisterState, forceTransitionTo, getChildren, getCurrent, getLastExitValue, getName, getPrevious, getState, handleInconsistentFSM, handleStateEntered, onEnd, registerDefaultTransition, registerDefaultTransition, registerFirstState, registerLastState, registerState, registerTransition, registerTransition, reset, resetStates, scheduleFirst, scheduleNext
 
Methods inherited from class jade.core.behaviours.SerialBehaviour
handle
 
Methods inherited from class jade.core.behaviours.CompositeBehaviour
action, block, done, registerAsChild, resetChildren, restart, setAgent
 
Methods inherited from class jade.core.behaviours.Behaviour
actionWrapper, block, getBehaviourName, getDataStore, getExecutionState, getParent, isRunnable, onStart, root, setBehaviourName, setDataStore, setExecutionState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionDispatcherWithSessionTracking

public ActionDispatcherWithSessionTracking(Agent a,
                                           DataStore ds,
                                           HistoryLogger historyLogger,
                                           Object accessKey,
                                           Object actionNameKey,
                                           Object actKey)
Constructs action dispatcher.

Parameters:
a - is a reference to the Agent object.
ds - is DataStore which will be used locally.
historyLogger - is logger which logs request of the user in a database
accessKey - is the key to get the proper object from the DataStore, this is the object that will be later passed as argument to the method getSelectionKey.
actionNameKey - is the key to get the name of action resolved by this action dispatcher.
actKey - is the key in the DataStore to access Action from current request, extracted by this action dispatcher.
See Also:
SafeHandlerSelector.getSelectionKey(Object)
Method Detail

getSelectionKey_internal

protected final Object getSelectionKey_internal(Object o)
Description copied from class: SafeHandlerSelector
Subclasses must provide a concrete implementation for this method. It must return the key to which the handler was bound.

Specified by:
getSelectionKey_internal in class SafeHandlerSelector
Returns:
the key to which the handler was bound

registerHandler

public void registerHandler(boolean requiresAuthorization,
                            Object key,
                            Behaviour h)
Register the bounding between an handler and a key.

Parameters:
requiresAuthorization - true if the passed Behaviour realizes user request, which requires authorization
key - this is the key that must be later returned by the method getSelectionKey when the passed Behaviour must be selected
h - the control handler for this key