ibspan.tss.messaging
Class SafeHandlerSelector
java.lang.Object
jade.core.behaviours.Behaviour
jade.core.behaviours.CompositeBehaviour
jade.core.behaviours.SerialBehaviour
jade.core.behaviours.FSMBehaviour
jade.proto.states.HandlerSelector
ibspan.tss.messaging.SafeHandlerSelector
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- ActionDispatcher, ActionDispatcherWithSessionTracking, PersonalActionDispatcher
public abstract class SafeHandlerSelector
- extends HandlerSelector
Extends functionality of HandlerSelector
by providing
registerErrorHandler(Behaviour)
method for registering behaviour,
which handles with situation in which no behaviour for the given request is
registered or an error occured during dispatching.
- Author:
- Maciej Gawinecki
- See Also:
- Serialized Form
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.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 |
SafeHandlerSelector
public SafeHandlerSelector(Agent a,
DataStore s,
Object accessKey)
- Constructor for this SafeHandlerSelector.
- Parameters:
a
- is a reference to the Agent objects
- is the DataStore where the object can be retrieved fromaccessKey
- 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
- See Also:
getSelectionKey(Object)
getSelectionKey
protected final Object getSelectionKey(Object o)
- Returns the key to which the handler was bound. Invokes
getSelectionKey_internal
method.
- Specified by:
getSelectionKey
in class HandlerSelector
- Parameters:
selectionVar
- is the object retrieved from the datastore at the
accessKey
passed in the constructor
- Returns:
- the key to which the handler was bound; if key was not found or
error occured (signalled as catched exception) then key for error
handler is returned.
- See Also:
registerErrorHandler(Behaviour)
,
getSelectionKey_internal(Object)
getSelectionKey_internal
protected abstract Object getSelectionKey_internal(Object o)
throws Exception
- Subclasses must provide a concrete implementation for this method. It
must return the key to which the handler was bound.
- Parameters:
selectionVar
- the object retrieved from the datastore at the
accessKey
passed in the constructor
- Returns:
- the key to which the handler was bound
- Throws:
Exception
registerErrorHandler
public void registerErrorHandler(Behaviour h)
- Register behaviour which will handle with situations in which action
dispatcher cannot process request or the this no handler for the request.
- Parameters:
h
- error handler