es.upv.dsic.gti_ia.cAgents.protocols
Class FIPA_REQUEST_Initiator

java.lang.Object
  extended by es.upv.dsic.gti_ia.cAgents.protocols.FIPA_REQUEST_Initiator

public abstract class FIPA_REQUEST_Initiator
extends Object

Template for CFactories that manage fipa request initiator conversation. The user has to create his/her own class extending from this one. And implement the abstract methods. Other methods can be overriden in order to modify the default behaviour

Author:
ricard

Constructor Summary
FIPA_REQUEST_Initiator()
           
 
Method Summary
protected  void doAgree(CProcessor myProcessor, ACLMessage msg)
          Method to execute when the initiator receives an agree message
protected  void doBegin(CProcessor myProcessor, ACLMessage msg)
          Method to execute at the beginning of the conversation
protected  void doFailure(CProcessor myProcessor, ACLMessage msg)
          Method to execute when the initiator receives a failure message
protected  void doFinal(CProcessor myProcessor, ACLMessage messageToSend)
          Method to execute when the initiator ends the conversation
protected abstract  void doInform(CProcessor myProcessor, ACLMessage msg)
          Method to execute when the initiator receives an inform message
protected  void doNotUnderstood(CProcessor myProcessor, ACLMessage msg)
          Method to execute when the initiator receives a not-understood message
protected  void doRefuse(CProcessor myProcessor, ACLMessage msg)
          Method to execute when the initiator receives a failure message
protected  void doRequest(CProcessor myProcessor, ACLMessage messageToSend)
          Sets the request message
protected  void doSecondWait(CProcessor myProcessor, ACLMessage msg)
          Method to execute when the timeout is reached
 CFactory newFactory(String name, MessageFilter filter, ACLMessage requestMessage, int availableConversations, CAgent myAgent, long timeout)
          Creates a new initiator fipa request cfactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FIPA_REQUEST_Initiator

public FIPA_REQUEST_Initiator()
Method Detail

doBegin

protected void doBegin(CProcessor myProcessor,
                       ACLMessage msg)
Method to execute at the beginning of the conversation

Parameters:
myProcessor - the CProcessor managing the conversation
msg - first message to send

doRequest

protected void doRequest(CProcessor myProcessor,
                         ACLMessage messageToSend)
Sets the request message

Parameters:
myProcessor - the CProcessor managing the conversation
messageToSend - request message

doNotUnderstood

protected void doNotUnderstood(CProcessor myProcessor,
                               ACLMessage msg)
Method to execute when the initiator receives a not-understood message

Parameters:
myProcessor - the CProcessor managing the conversation
msg - not-understood message

doRefuse

protected void doRefuse(CProcessor myProcessor,
                        ACLMessage msg)
Method to execute when the initiator receives a failure message

Parameters:
myProcessor - the CProcessor managing the conversation
msg - failure message

doAgree

protected void doAgree(CProcessor myProcessor,
                       ACLMessage msg)
Method to execute when the initiator receives an agree message

Parameters:
myProcessor - the CProcessor managing the conversation
msg - agree message

doSecondWait

protected void doSecondWait(CProcessor myProcessor,
                            ACLMessage msg)
Method to execute when the timeout is reached

Parameters:
myProcessor - the CProcessor managing the conversation
msg - timeout message

doFailure

protected void doFailure(CProcessor myProcessor,
                         ACLMessage msg)
Method to execute when the initiator receives a failure message

Parameters:
myProcessor - the CProcessor managing the conversation
msg - failure message

doInform

protected abstract void doInform(CProcessor myProcessor,
                                 ACLMessage msg)
Method to execute when the initiator receives an inform message

Parameters:
myProcessor -
msg -

doFinal

protected void doFinal(CProcessor myProcessor,
                       ACLMessage messageToSend)
Method to execute when the initiator ends the conversation

Parameters:
myProcessor -
messageToSend -

newFactory

public CFactory newFactory(String name,
                           MessageFilter filter,
                           ACLMessage requestMessage,
                           int availableConversations,
                           CAgent myAgent,
                           long timeout)
Creates a new initiator fipa request cfactory

Parameters:
name - factory's name
filter - message filter
requestMessage - first message to send
availableConversations - maximum number of conversation this CFactory can manage simultaneously
myAgent - agent owner of this CFactory
timeout - for waiting after sending the request message
Returns:
a new fipa request initiator factory


Copyright © 2012 GTI-IA. All Rights Reserved.