Overview  Package   Class  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

sajas.proto.states
Class HandlerSelector
java.lang.Object
  sajas.core.behaviours.Behaviour
      sajas.core.behaviours.CompositeBehaviour
          sajas.core.behaviours.SerialBehaviour
              sajas.core.behaviours.FSMBehaviour
                  sajas.proto.states.HandlerSelector
All Implemented Interfaces:
jade.util.leap.Serializable, Serializable

public abstract class HandlerSelector
extends FSMBehaviour
Note: this class has been re-implemented to redirect the use of the agent and behaviour classes to SAJaS versions.
Author:
hlc
See Also:
jade.proto.states.HandlerSelector

Nested classes/interfaces inherited from class sajas.core.behaviours.Behaviour
Behaviour.RunnableChangedEvent
Field Summary
static int
SELECTION_NOK
          Value returned by onEnd method if no handler was found mapped to the key
static int
SELECTION_OK
          Value returned by onEnd method if an handler was found mapped to the key
Fields inherited from class sajas.core.behaviours.FSMBehaviour
currentName, lastStates
Fields inherited from class sajas.core.behaviours.CompositeBehaviour
currentExecuted
Fields inherited from class sajas.core.behaviours.Behaviour
myAgent, myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING
Constructor Summary
HandlerSelector(Agent a, DataStore s, Object accessKey)
          Constructor for this HandlerSelector.
Method Summary
protected abstract Object
getSelectionKey(Object selectionVar)
          Subclasses must provide a concrete implementation for this method.
void
registerHandler(Object key, Behaviour h)
          Register the bounding between an handler and a key.
Methods inherited from class sajas.core.behaviours.FSMBehaviour
checkTermination, deregisterDefaultTransition, deregisterState, deregisterTransition, forceTransitionTo, getChildren, getCurrent, getLastExitValue, getName, getPrevious, getState, handleInconsistentFSM, handleStateEntered, hasDefaultTransition, onEnd, registerDefaultTransition, registerDefaultTransition, registerFirstState, registerLastState, registerState, registerTransition, registerTransition, reset, resetStates, scheduleFirst, scheduleNext, stringifyTransitionTable
Methods inherited from class sajas.core.behaviours.SerialBehaviour
handle
Methods inherited from class sajas.core.behaviours.CompositeBehaviour
action, done, handleBlockEvent, handleRestartEvent, registerAsChild, resetChildren, setAgent
Methods inherited from class sajas.core.behaviours.Behaviour
actionWrapper, block, block, getAgent, getBehaviourName, getDataStore, getExecutionState, getParent, getRestartCounter, isRunnable, onStart, restart, root, setBehaviourName, setDataStore, setExecutionState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
SELECTION_NOK
public static final int SELECTION_NOK
Value returned by onEnd method if no handler was found mapped to the key
See Also:
Constant Field Values

SELECTION_OK
public static final int SELECTION_OK
Value returned by onEnd method if an handler was found mapped to the key
See Also:
Constant Field Values
Constructor Detail
HandlerSelector
public HandlerSelector(Agent a,
                       DataStore s,
                       Object accessKey)
Constructor for this HandlerSelector.
Parameters:
a - is a reference to the Agent object
s - is the DataStore where the object can be retrieved from
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
See Also:
getSelectionKey(Object)
Method Detail
getSelectionKey
protected abstract Object getSelectionKey(Object selectionVar)
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

registerHandler
public void registerHandler(Object key,
                            Behaviour h)
Register the bounding between an handler and a key.
Parameters:
key - this is the key that must be later returned by the method getSelectionKey when the passed Behaviour must be selected
h - the handler for this key

Overview  Package   Class  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Java API documentation generated with DocFlex/Doclet 1.6.1 using JavadocPro template set.
DocFlex/Doclet is both a multi-format Javadoc doclet and a free edition of DocFlex/Javadoc, which is a template-driven programming tool for rapid development of any Javadoc-based Java API documentation generators (i.e. doclets). If you need to customize your Javadoc without writing a full-blown doclet from scratch, DocFlex/Javadoc may be the only tool able to help you! Find out more at www.docflex.com