Version 1.5APIs subject to change!

multiverse.msgsys
Class Message

java.lang.Object
  extended by multiverse.msgsys.Message
All Implemented Interfaces:
java.io.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.GenerateStructureMessage, ObjectManagerClient.GetTemplateMessage, ObjectManagerClient.LoadObjectMessage, ObjectManagerClient.RegisterTemplateMessage, ObjectManagerClient.SaveObjectMessage, ObjectManagerClient.UnloadObjectMessage, PerceptionMessage, PluginAvailableMessage, ResponseMessage, SearchMessage, SubjectMessage, SubscribeMessage, TargetMessage, UnsubscribeMessage, WorldManagerClient.HostInstanceMessage, WorldManagerClient.NewRegionMessage, WorldManagerClient.PerceiverRegionsMessage, WorldManagerClient.SysChatMessage

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

Multiverse message base-class.

See Also:
Serialized Form

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.
 java.lang.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.
 void setMsgType(MessageType msgType)
          Set the message type.
static void toBytes(Message message, multiverse.server.network.MVByteBuffer buffer)
          Internal use only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


getSenderName

public java.lang.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.


toBytes

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


isRPC

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



Copyright © 2008 The Multiverse Network, Inc.