com.agentfactory.platform.mts
Class FIPAMessageQueue
java.lang.Object
java.util.Observable
com.agentfactory.platform.mts.FIPAMessageQueue
public class FIPAMessageQueue
- extends java.util.Observable
This is a test class for the module implementation. It contains a
single method that prints something to the screen.
|
Method Summary |
java.util.ArrayList |
getMessageQueue()
|
java.util.ArrayList |
getMessages()
This method generates an ArrayList of the Messages that were
received by an agent since the last check. |
java.util.ArrayList |
getMessages(java.lang.String language)
|
boolean |
hasMessages()
|
void |
receiveMessage(Message message)
This method is used by FIPA Message Transport Services to deliver
new messages received to the relevant agents. |
boolean |
sendMessage(Message message)
This method is used to send messages created by FIPA actuators. |
| Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FIPAMessageQueue
public FIPAMessageQueue(Agent agent)
receiveMessage
public void receiveMessage(Message message)
- This method is used by FIPA Message Transport Services to deliver
new messages received to the relevant agents. The method has been
synchronized to ensure that no messages are added whilst the agent
is gathering beliefs about the currently received messages.
- Parameters:
message - a newly received FIPA message.
sendMessage
public boolean sendMessage(Message message)
- This method is used to send messages created by FIPA actuators. It is
passed through the Message Queue because this provides a simple way of
capturing the events of sending and receiving a message.
- Parameters:
message - the FIPA message to be sent.
getMessages
public java.util.ArrayList getMessages()
- This method generates an ArrayList of the Messages that were
received by an agent since the last check. This method is
synchronized to ensure that no messages are added to the
queue whilst the message list is being generated. The messages
added to this list are removed from the queue.
- Returns:
- an ArrayList of Strings that represent beliefs about the messages
received by the agent.
getMessages
public java.util.ArrayList getMessages(java.lang.String language)
hasMessages
public boolean hasMessages()
getMessageQueue
public java.util.ArrayList getMessageQueue()