|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmadkit.kernel.Message
public class Message
The generic MadKit message class. Use a subclass to adapt it to
your needs. This class is quite lightweight, it just defines sender
and receivers (expressed with AgentAddress class) and automatically
stamp the date of send on the message.
If security is an issue for the application, implementing the SecuredMessage
interface should be considered as,
although the default fields of a message could not be altered by receivers (read only or copy),
other messages (subclasses of Message) and their content could be intercepted via the hooking mechanism of the kernel.
Thus, additional content could be altered by receivers if not read only.
Implementing the SecuredMessage
interface
(and Overriding the default clone
method of Message
; Do not forget to call super.clone())
will tell the kernel
to do a copy of the message for each receiver, ensuring the data security of the original object/content used to build a message.
SecuredMessage
,
Serialized FormConstructor Summary | |
---|---|
Message()
Instantiates a new empty message. |
Method Summary | |
---|---|
Message |
clone()
|
java.util.Date |
getCreationDate()
Gets the creation date. |
AgentAddress |
getReceiver()
|
AgentAddress |
getSender()
|
java.lang.String |
toString()
Returns a debug string with envelope and content for the message |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Message()
Method Detail |
---|
public final AgentAddress getSender()
public final AgentAddress getReceiver()
public final java.util.Date getCreationDate()
public Message clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |