communication
Class Message
java.lang.Object
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
Message
public Message(ProcessIdentifier processId,
java.lang.Object data)
- Parameters:
processId
- the process identifier for the messagedata
- the data of the message
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