communication
Class Message

java.lang.Object
  extended by communication.Message
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
TypedMessage

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

Messages are sent and received by processes. A message contains two fields: the identifier of the sender (or receiver) and the data to send (or being received). Data is simply any kind of Java object (that must nevertheless be serializable).

See Also:
Serialized Form

Field Summary
protected  java.lang.Object data
          Data embedded in the message
protected  ProcessIdentifier processId
          The identifier of the process that either sent the message or either is the receiver of the message
 
Constructor Summary
Message(ProcessIdentifier processId, java.lang.Object data)
           
 
Method Summary
 java.lang.Object getData()
           
 ProcessIdentifier getProcessId()
           
 void setData(java.lang.Object data)
           
 void setProcessId(ProcessIdentifier processId)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

processId

protected ProcessIdentifier processId
The identifier of the process that either sent the message or either is the receiver of the message


data

protected java.lang.Object data
Data embedded in the message

Constructor Detail

Message

public Message(ProcessIdentifier processId,
               java.lang.Object data)
Parameters:
processId - the process identifier for the message
data - the data of the message
Method Detail

getProcessId

public ProcessIdentifier getProcessId()
Returns:
the process identifier embedded in the message

setProcessId

public void setProcessId(ProcessIdentifier processId)
Parameters:
processId - the process identifier to set

getData

public java.lang.Object getData()
Returns:
the data of the message

setData

public void setData(java.lang.Object data)
Parameters:
data - the data to set

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object