Class ObjectMessageDelegator<S extends MessageConnection>

java.lang.Object
com.jme3.network.util.AbstractMessageDelegator<S>
com.jme3.network.util.ObjectMessageDelegator<S>
Type Parameters:
S - the message connection type handled by this delegator
All Implemented Interfaces:
MessageListener<S>

public class ObjectMessageDelegator<S extends MessageConnection> extends AbstractMessageDelegator<S>
A MessageListener implementation that will forward messages to methods of a specified delegate object. These methods can be automapped or manually specified.
Author:
Paul Speed
  • Constructor Details

    • ObjectMessageDelegator

      public ObjectMessageDelegator(Object delegate, boolean automap)
      Creates a MessageListener that will forward mapped message types to methods of the specified object. If automap is true then all methods with the proper signature will be mapped.

      Methods of the following signatures are allowed:

      • void someName(S conn, SomeMessage msg)
      • void someName(Message msg)
      Where S is the type of MessageConnection and SomeMessage is some specific concrete Message subclass.
      Parameters:
      delegate - the object that will receive forwarded calls
      automap - true to automatically map compatible methods on the delegate
  • Method Details