|
MessageTemplate
Author: Tiziana Trucco (TILab S.p.a)
Date: 6/12/2001
This example shows the usage
of the MessageTemplate.MatchExpression Interface to define an
application specific MessageTemplate.
In particular in the method match() the programmer should realize
the necessary checks on the ACLMessage and return true only if
the message matches the application-specific template.
To try the example, start the WaitAgent and then enters the name (GUID) of
all the agents that are allowed to send REQUEST messages to this agent.
java jade.Boot -gui agent:examples.MessageTemplate.WaitAgent
It might be useful to launch a DummyAgent from the RMA gui and use it to send a REQUEST message.
If a REQUEST message is received by one of the expected agents than the WaitAgent replies with a INFORM message, otherwise the message is just ignored.
WaitAgent | |
Description: | |
The WaitAgent agent
waits for a REQUEST message from one of the set of agents specified by the user. If such a message arrives (i.e. a message that matches the REQUEST performative and has been sent by one of the specified agents) than the WaitAgent replies with a INFORM message, otherwise no reply is sent and the message is ignored. |
|
Jade classes used: | |
SimpleBehaviour,MessageTemplate.MatchExpression | |
Source | |
\src\examples\MessageTemplate\WaitAgent.java |
JADE
is a trademark of TILAB (formerly CSELT).
JADE has been developed jointly by TILAB
(formerly CSELT)
and the Computer
Engineering Group of the University
of Parma