games.strategy.engine.message
Class MessageContext

java.lang.Object
  extended by games.strategy.engine.message.MessageContext

public class MessageContext
extends java.lang.Object

Information useful on invocation of remote networked events.

Author:
sgb

Constructor Summary
MessageContext()
           
 
Method Summary
static INode getSender()
          Within the invocation on a remote method on an IRemote or an IChannelSubscriber, this method will return the node that originated the message.
static void setSenderNodeForThread(INode node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageContext

public MessageContext()
Method Detail

setSenderNodeForThread

public static void setSenderNodeForThread(INode node)

getSender

public static INode getSender()
Within the invocation on a remote method on an IRemote or an IChannelSubscriber, this method will return the node that originated the message.

Will return null if the current thread is not currenlty executing a remote method of an IRemote or IChannelSubscrobor.

This is set by the server, and cannot be overwritten by the client, and can be used to verify where messages come from.

Returns:
the node that originated the message being received