jade.proto
Class FipaRequestResponderBehaviour.ActionHandler

java.lang.Object
  |
  +--jade.core.behaviours.Behaviour
        |
        +--jade.proto.FipaRequestResponderBehaviour.ActionHandler

public abstract static class FipaRequestResponderBehaviour.ActionHandler
extends Behaviour

This class must be extended by users to handle a specific request action. It provides convenience protected methods to send back specific inform, refuse or failure messages. Besides, it holds request and reply ACL messages.

See Also:
Serialized Form

Inner classes inherited from class jade.core.behaviours.Behaviour
Behaviour.RunnableChangedEvent
 
Fields inherited from class jade.core.behaviours.Behaviour
myAgent, myEvent, NOTIFY_DOWN, NOTIFY_UP, parent
 
Constructor Summary
protected FipaRequestResponderBehaviour.ActionHandler(Agent ag, ACLMessage request)
          Constructor for ActionHandlerobjects.
 
Method Summary
protected  ACLMessage getReply()
           
protected  ACLMessage getRequest()
           
protected  void sendReply(int performative, java.lang.String content)
          Send a reply message back to the requester.
protected  void setReply(ACLMessage reply)
           
 
Methods inherited from class jade.core.behaviours.Behaviour
action, block, block, done, handle, isRunnable, reset, restart, root
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FipaRequestResponderBehaviour.ActionHandler

protected FipaRequestResponderBehaviour.ActionHandler(Agent ag,
                                                      ACLMessage request)
Constructor for ActionHandlerobjects.
Parameters:
a - The agent this ActionHandler belongs to.
request - is the REQUEST message that needs to be responded
Method Detail

getReply

protected ACLMessage getReply()

setReply

protected void setReply(ACLMessage reply)

getRequest

protected final ACLMessage getRequest()
Returns:
The ACLMessage that was received by the dispatcher and that this Action has to handle.

sendReply

protected void sendReply(int performative,
                         java.lang.String content)
Send a reply message back to the requester. This method sends the ACL message object returned by getReply() method, after changing its message type to the passed parameter and after setting the content to the passed parameter.