jade.domain
Class RequestManagementBehaviour
java.lang.Object
jade.core.behaviours.Behaviour
jade.core.behaviours.SimpleBehaviour
jade.proto.SimpleAchieveREResponder
jade.domain.RequestManagementBehaviour
- All Implemented Interfaces:
- FIPANames.InteractionProtocol, java.io.Serializable
public abstract class RequestManagementBehaviour
- extends SimpleAchieveREResponder
Base class for AMS and DF behaviours managing requests from agents.
This class handles the FIPA-request protocol and in particular prepares
the response taking into account all possible exceptions.
The preparation of the result notification is delegated to subclasses as
its form (RESULT or DONE) and sending time (i.e. whether it can be sent
immediately or must be delayed at a later time) depends on the specific
action.
- Author:
- Giovanni Caire - Tilab
- See Also:
- Serialized Form
| Fields inherited from interface jade.domain.FIPANames.InteractionProtocol |
FIPA_BROKERING, FIPA_CONTRACT_NET, FIPA_DUTCH_AUCTION, FIPA_ENGLISH_AUCTION, FIPA_ITERATED_CONTRACT_NET, FIPA_PROPOSE, FIPA_QUERY, FIPA_RECRUITING, FIPA_REQUEST, FIPA_REQUEST_WHEN, FIPA_SUBSCRIBE, ITERATED_FIPA_REQUEST |
| Methods inherited from class jade.core.behaviours.Behaviour |
actionWrapper, block, block, getBehaviourName, getDataStore, getExecutionState, getParent, getRestartCounter, handle, handleBlockEvent, handleRestartEvent, isRunnable, onEnd, restart, root, setAgent, setBehaviourName, setDataStore, setExecutionState |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RequestManagementBehaviour
protected RequestManagementBehaviour(Agent a,
MessageTemplate mt)
onStart
public void onStart()
- Description copied from class:
Behaviour
- This method is just an empty placeholders for subclasses. It is
executed just once before starting behaviour execution.
Therefore, it acts as a prolog to the task
represented by this
Behaviour.
- Overrides:
onStart in class Behaviour
performAction
protected abstract ACLMessage performAction(Action slAction,
ACLMessage request)
throws jade.security.JADESecurityException,
FIPAException
- Throws:
jade.security.JADESecurityException
FIPAException
prepareResponse
protected ACLMessage prepareResponse(ACLMessage request)
throws NotUnderstoodException,
RefuseException
- Description copied from class:
SimpleAchieveREResponder
- This method is called when the initiator's
message is received that matches the message template
passed in the constructor.
This default implementation return null which has
the effect of sending no reponse. Programmers should
override the method in case they need to react to this event.
- Overrides:
prepareResponse in class SimpleAchieveREResponder
- Parameters:
request - the received message
- Returns:
- null when the AGREE message can be skipper, the AGREE message
otherwise.
- Throws:
NotUnderstoodException
RefuseException- See Also:
ACLMessage.createReply()
prepareResultNotification
protected ACLMessage prepareResultNotification(ACLMessage request,
ACLMessage response)
throws FailureException
- Just return the (already prepared) notification message (if any).
- Overrides:
prepareResultNotification in class SimpleAchieveREResponder
- Parameters:
request - the received messageresponse - the previously sent response message
- Returns:
- the ACLMessage to be sent as a result notification (i.e. one of
inform, failure. Remind to
use the method createReply of the class ACLMessage in order
to create a good reply message
- Throws:
FailureException- See Also:
ACLMessage.createReply(),
SimpleAchieveREResponder.prepareResponse(ACLMessage)
reset
public void reset()
- Description copied from class:
SimpleAchieveREResponder
- Reset this behaviour using the same MessageTemplate.
- Overrides:
reset in class SimpleAchieveREResponder