Package com.groiss.cluster.communication
Class Message
java.lang.Object
com.groiss.cluster.communication.Message
- All Implemented Interfaces:
Serializable
This class represents a message sent by the cluster communication mechanism.
It can transport an arbitrary serializable object. The type of the message can be set. It is an arbitrary string. Types starting with "_ep_" are reserved for internal use.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMessage()
Default constructorMessage
(Serializable content) Constructs a message and initializes the content. -
Method Summary
Modifier and TypeMethodDescriptionReturn the content of this message.getFrom()
Returns the node id of the sender of the message.Return the type of this message.void
setContent
(Serializable content) Set the content of this message.void
setMsgType
(String msgType) Set the type representation of this message.toString()
Return a String representation of this message.
-
Field Details
-
DEFAULT_TYPE
- See Also:
-
-
Constructor Details
-
Message
public Message()Default constructor -
Message
Constructs a message and initializes the content.- Parameters:
content
-
-
-
Method Details
-
getContent
Return the content of this message.- Returns:
- the content of this message
-
setContent
Set the content of this message.- Parameters:
content
- the new content
-
toString
Return a String representation of this message. -
getFrom
Returns the node id of the sender of the message.- Returns:
- the sender id
-
getMsgType
Return the type of this message.- Returns:
- the type of the message
-
setMsgType
Set the type representation of this message.
-