Package jade.domain
Class FIPAService
- java.lang.Object
-
- jade.domain.FIPAService
-
- Direct Known Subclasses:
AMSService,DFService
public class FIPAService extends Object
This class provides a set of basic and static methods to perform the FIPA Agent Management actions. However, developers should useDFServiceandAMSServicewhich provide specialized methods to communicate with the DF and the AMS.- Version:
- $Date$ $Revision$
- Author:
- Fabio Bellifemine - CSELT S.p.A.
-
-
Constructor Summary
Constructors Constructor Description FIPAService()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ACLMessagedoFipaRequestClient(Agent a, ACLMessage request)This method plays the initiator role in the Fipa-Request interaction protocol and performs all the steps of the protocol.static ACLMessagedoFipaRequestClient(Agent a, ACLMessage request, long timeout)This method plays the initiator role in the Fipa-Request interaction protocol and performs all the steps of the protocol, and additionally sets a conversation timeout.static AIDparseAID(SimpleSLTokenizer parser)The parser content has the form: agent-identifier ......)
-
-
-
Method Detail
-
doFipaRequestClient
public static ACLMessage doFipaRequestClient(Agent a, ACLMessage request) throws FIPAException
This method plays the initiator role in the Fipa-Request interaction protocol and performs all the steps of the protocol. The method uses the:reply-with/:in-reply-toACL message slots as a mechanism to match the protocol replies. Take care because the method blocks until all the response messages are received. Under error conditions, or if the responder does not wish to respond, that might block for ever the execution of the agent. For this reason, theFipaRequestInitiatorBehaviouris the preferred way to play the protocol.- Parameters:
a- is the Agent playing the initiator rolerequest- is the ACLMessage to be sent. Notice that all the slots of the message must have already been filled by the caller. If the:reply-withmessage slot is not set, a default one will be generated automatically.- Returns:
- the INFORM message received in the final state of the protocol, if the protocol succeeded, otherwise it throws an Exception
- Throws:
FIPAException
-
doFipaRequestClient
public static ACLMessage doFipaRequestClient(Agent a, ACLMessage request, long timeout) throws FIPAException
This method plays the initiator role in the Fipa-Request interaction protocol and performs all the steps of the protocol, and additionally sets a conversation timeout. The method uses the:reply-with/:in-reply-toACL message slots as a mechanism to match the protocol replies. Under error conditions, or if the responder does not wish to respond, that might block the execution of the agent until the conversation timeout expires. For this reason, theFipaRequestInitiatorBehaviouris the preferred way to play the protocol.- Parameters:
a- is the Agent playing the initiator rolerequest- is the ACLMessage to be sent. Notice that all the slots of the message must have already been filled by the caller. If the:reply-withmessage slot is not set, a default one will be generated automatically.timeout- The maximum time to wait for the conversation to finish, in milliseconds.- Returns:
- the INFORM message received in the final state of the protocol, if the protocol succeeded, otherwise it throws an Exception
- Throws:
FIPAException
-
parseAID
public static AID parseAID(SimpleSLTokenizer parser) throws Exception
The parser content has the form: agent-identifier ......)- Throws:
Exception
-
-