com.groiss.cluster.communication
Class Message

java.lang.Object
  extended by com.groiss.cluster.communication.Message
All Implemented Interfaces:
Serializable

public class Message
extends Object
implements 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:
Serialized Form

Field Summary
static String DEFAULT_TYPE
           
 
Constructor Summary
Message()
          Default constructor
Message(Serializable content)
          Constructs a message and initializes the content.
 
Method Summary
 Serializable getContent()
          Return the content of this message.
 String getFrom()
          Returns the node id of the sender of the message.
 String getMsgType()
          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.
 String toString()
          Return a String representation of this message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_TYPE

public static final String DEFAULT_TYPE
See Also:
Constant Field Values
Constructor Detail

Message

public Message()
Default constructor


Message

public Message(Serializable content)
Constructs a message and initializes the content.

Parameters:
content -
Method Detail

getContent

public Serializable getContent()
Return the content of this message.

Returns:
the content of this message

setContent

public void setContent(Serializable content)
Set the content of this message.

Parameters:
content - the new content

toString

public String toString()
Return a String representation of this message.

Overrides:
toString in class Object
Returns:
the representation of the content

getFrom

public String getFrom()
Returns the node id of the sender of the message.

Returns:
the sender id

getMsgType

public String getMsgType()
Return the type of this message.

Returns:
the type of the message

setMsgType

public void setMsgType(String msgType)
Set the type representation of this message.



@enterprise 8.0.10809 Copyright © 2001-2012 Groiss Informatics GmbH. All Rights Reserved.