games.strategy.engine.message
Class UnifiedMessenger

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

public class UnifiedMessenger
extends java.lang.Object

A messenger general enough that both Channel and Remote messenger can be based on it.

Author:
Sean Bridges

Constructor Summary
UnifiedMessenger(IMessenger messenger)
           
 
Method Summary
 void addImplementor(RemoteName endPointDescriptor, java.lang.Object implementor, boolean singleThreaded)
           
 void dumpState(java.io.PrintStream stream)
           
 java.lang.Object getImplementor(java.lang.String name)
          Get the 1 and only implementor for the endpoint.
 INode getLocalNode()
           
 void invoke(java.lang.String endPointName, RemoteMethodCall call)
          invoke without waiting for remote nodes to respond
 games.strategy.engine.message.RemoteMethodCallResults invokeAndWait(java.lang.String endPointName, RemoteMethodCall remoteCall)
          Invoke and wait for all implementors on all vms to finish executing.
 boolean isServer()
           
 void waitForAllJobs()
           
 void waitForLocalImplement(java.lang.String endPointName, long timeoutMS)
          Wait for the messenger to know about the given endpoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnifiedMessenger

public UnifiedMessenger(IMessenger messenger)
Parameters:
messenger -
Method Detail

invokeAndWait

public games.strategy.engine.message.RemoteMethodCallResults invokeAndWait(java.lang.String endPointName,
                                                                           RemoteMethodCall remoteCall)
Invoke and wait for all implementors on all vms to finish executing.


invoke

public void invoke(java.lang.String endPointName,
                   RemoteMethodCall call)
invoke without waiting for remote nodes to respond


addImplementor

public void addImplementor(RemoteName endPointDescriptor,
                           java.lang.Object implementor,
                           boolean singleThreaded)

getLocalNode

public INode getLocalNode()

getImplementor

public java.lang.Object getImplementor(java.lang.String name)
Get the 1 and only implementor for the endpoint. throws an exception if there are not exctly 1 implementors


isServer

public boolean isServer()

waitForLocalImplement

public void waitForLocalImplement(java.lang.String endPointName,
                                  long timeoutMS)
Wait for the messenger to know about the given endpoint.

Parameters:
endPointName -
timeout -

dumpState

public void dumpState(java.io.PrintStream stream)

waitForAllJobs

public void waitForAllJobs()