multiverse.msgsys
Class Message

java.lang.Object
  extended by multiverse.msgsys.Message
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AdvertiseMessage, AgentHelloMessage, AgentStateMessage, AllocNameMessage, AwaitPluginDependentsMessage, EnginePlugin.PluginStateMessage, EnginePlugin.TransferObjectMessage, FilterUpdateMessage, GenericMessage, HelloResponseMessage, InstanceClient.CreateInstanceMessage, InstanceClient.GetInstanceInfoMessage, InstanceClient.GetMarkerMessage, InstanceClient.GetRegionMessage, InstanceClient.RegisterInstanceTemplateMessage, MobManagerClient.CreateSpawnGeneratorMessage, NamespaceMessage, NewAgentMessage, ObjectManagerClient.DeleteObjectMessage, ObjectManagerClient.FixWorldNodeMessage, ObjectManagerClient.GenerateObjectMessage, ObjectManagerClient.GetNamedObjectMessage, ObjectManagerClient.GetTemplateMessage, ObjectManagerClient.LoadObjectMessage, ObjectManagerClient.RegisterTemplateMessage, ObjectManagerClient.SaveObjectMessage, ObjectManagerClient.UnloadObjectMessage, PerceptionMessage, PluginAvailableMessage, ProxyPlugin.ConnectionResetMessage, ResponseMessage, SearchMessage, SubjectMessage, SubscribeMessage, TargetMessage, TestSerialization.TestMessage, UnsubscribeMessage, WorldManagerClient.HostInstanceMessage, WorldManagerClient.NewRegionMessage, WorldManagerClient.PerceiverRegionsMessage, WorldManagerClient.PlayerPathWMReqMessage, WorldManagerClient.SysChatMessage

public class Message
extends Object
implements Serializable

Multiverse message base-class.

See Also:
Serialized Form

Field Summary
(package private)  long enqueueTime
           
(package private)  short flags
           
(package private)  long msgId
           
(package private)  MessageType msgType
           
(package private)  MessageAgent.RemoteAgent remoteAgent
           
(package private) static short RPC
           
private static long serialVersionUID
           
 
Constructor Summary
Message()
           
Message(MessageType msgType)
          Create message of the given message type.
 
Method Summary
 long getEnqueueTime()
          Get the message enqueue time.
 long getMsgId()
          Get the message id.
 MessageType getMsgType()
          Get the message type.
(package private)  MessageAgent.RemoteAgent getRemoteAgent()
           
 String getSenderName()
          Get the sending agent name.
 boolean isRPC()
          True if the message is an RPC request.
 void setEnqueueTime()
          Set the message enqueue time to the current nano-second time.
 void setEnqueueTime(long when)
          Set the message enqueue time.
(package private)  void setMessageId(long msgId)
           
 void setMsgType(MessageType msgType)
          Set the message type.
(package private)  void setRPC()
           
static void toBytes(Message message, MVByteBuffer buffer)
          Internal use only.
(package private)  void unsetRPC()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RPC

static final short RPC
See Also:
Constant Field Values

msgId

long msgId

msgType

MessageType msgType

flags

short flags

remoteAgent

transient MessageAgent.RemoteAgent remoteAgent

enqueueTime

transient long enqueueTime

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

Message

public Message()

Message

public Message(MessageType msgType)
Create message of the given message type.

Method Detail

getMsgType

public MessageType getMsgType()
Get the message type.


setMsgType

public void setMsgType(MessageType msgType)
Set the message type.


getMsgId

public long getMsgId()
Get the message id. The message id is unique within the sending agent. The message ids will repeat if the agent restarts.


setMessageId

void setMessageId(long msgId)

getSenderName

public String getSenderName()
Get the sending agent name.

Returns:
Agent name or null if the message has not been sent.

getEnqueueTime

public long getEnqueueTime()
Get the message enqueue time.


setEnqueueTime

public void setEnqueueTime(long when)
Set the message enqueue time. Application callbacks can set the enqueue time prior to insertion to an application queue or thread pool.


setEnqueueTime

public void setEnqueueTime()
Set the message enqueue time to the current nano-second time. Application callbacks can set the enqueue time prior to insertion to an application queue or thread pool.


getRemoteAgent

MessageAgent.RemoteAgent getRemoteAgent()

toBytes

public static void toBytes(Message message,
                           MVByteBuffer buffer)
Internal use only.


setRPC

void setRPC()

unsetRPC

void unsetRPC()

isRPC

public boolean isRPC()
True if the message is an RPC request.