fipaos.mts
Class Message

java.lang.Object
  |
  +--fipaos.mts.Message
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Message
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Provides an encapsulated entity for the parts which compose an Agent message

See Also:
Serialized Form

Constructor Summary
Message(ACL msg)
          Creates a Message based upon the given ACL object (automatically generates an Envelope based upon the ACL object given)
Message(Envelope env, ACL acl)
          Create a new Message based upon the given Envelope (which is assumed to contain an ACL object).
Message(Message msg)
          Deprecated. Use the clone() method instead
 
Method Summary
 void addMessageListener(MessageListener ml)
          Add a MessageListener to this
 java.lang.Object clone()
           
 ACL getACL()
          Gets the ACL that is part of this Message
 java.lang.Object getContent()
          Gets the content of this Message
 Envelope getEnvelope()
          Gets the Envelope that is part of this Message
 void removeMessageListener(MessageListener ml)
          Remove a MessageListener from this
 java.lang.String toString()
          Convert Message to human-readable form
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message(Message msg)
Deprecated. Use the clone() method instead

Create a new Message based upon the given Message

Message

public Message(Envelope env,
               ACL acl)
Create a new Message based upon the given Envelope (which is assumed to contain an ACL object).
Parameters:
env - The Envelope to base the Message upon

Message

public Message(ACL msg)
Creates a Message based upon the given ACL object (automatically generates an Envelope based upon the ACL object given)
Parameters:
msg - ACL object to create the Message from
Method Detail

addMessageListener

public void addMessageListener(MessageListener ml)
Add a MessageListener to this

removeMessageListener

public void removeMessageListener(MessageListener ml)
Remove a MessageListener from this

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getEnvelope

public Envelope getEnvelope()
Gets the Envelope that is part of this Message
Returns:
The Envelope belonging to this message

getACL

public ACL getACL()
Gets the ACL that is part of this Message
Returns:
The ACL part of this message

getContent

public java.lang.Object getContent()
Gets the content of this Message
Returns:
The content of this Message

toString

public java.lang.String toString()
Convert Message to human-readable form
Overrides:
toString in class java.lang.Object