es.upv.dsic.gti_ia.architecture
Class FIPARequestResponder

java.lang.Object
  extended by es.upv.dsic.gti_ia.architecture.FIPARequestResponder

public class FIPARequestResponder
extends Object

This class implements the FIPA-Request interaction protocol, Role Responder.

Version:
2009.9.07
Author:
Joan Bellver Faus, GTI-IA, DSIC, UPV

Field Summary
 QueueAgent myAgent
           
 
Constructor Summary
FIPARequestResponder(QueueAgent _agent, MessageTemplate _template)
          Creates a new FIPA-Request interaction protocol, Role responder.
 
Method Summary
 void action()
          Runs the state machine with the communication protocol
 void finish()
          Sends a CANCEL Message for active conversation and terminates the protocol
 QueueAgent getQueueAgent()
          Returns the agent.
protected  ACLMessage prepareResponse(ACLMessage request)
          This method is called when the initiator's message is received that matches the message template passed in the constructor.
protected  ACLMessage prepareResultNotification(ACLMessage request, ACLMessage responder)
          This method is called after the response has been sent and only when one of the following two cases arise: the response was an agree message OR no response message was sent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myAgent

public QueueAgent myAgent
Constructor Detail

FIPARequestResponder

public FIPARequestResponder(QueueAgent _agent,
                            MessageTemplate _template)
Creates a new FIPA-Request interaction protocol, Role responder.

Parameters:
agent - agent is the reference to the Agent Object.
template - is a MessageTemplate, will serve as a filter for receiving the right message
Method Detail

getQueueAgent

public QueueAgent getQueueAgent()
Returns the agent.

Returns:
QueueAgent

finish

public void finish()
Sends a CANCEL Message for active conversation and terminates the protocol


action

public void action()
Runs the state machine with the communication protocol


prepareResponse

protected ACLMessage prepareResponse(ACLMessage request)
                              throws NotUnderstoodException,
                                     RefuseException
This method is called when the initiator's message is received that matches the message template passed in the constructor.

Parameters:
request - initial message
Returns:
ACLMessage
Throws:
NotUnderstoodException
RefuseException

prepareResultNotification

protected ACLMessage prepareResultNotification(ACLMessage request,
                                               ACLMessage responder)
                                        throws FailureException
This method is called after the response has been sent and only when one of the following two cases arise: the response was an agree message OR no response message was sent.

Parameters:
request - ACLMessage
responder - ACLMessage
Returns:
ACLMessage
Throws:
FailureException


Copyright © 2012 GTI-IA. All Rights Reserved.