Class RmiRegistry

java.lang.Object
com.jme3.network.service.rmi.RmiRegistry

public class RmiRegistry extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    RmiRegistry(HostedConnection context, RpcConnection rpc, short rmiId, byte defaultChannel)
     
    RmiRegistry(RpcConnection rpc, short rmiId, byte defaultChannel)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected void
    addRemoteObject(byte channel, short objectId, String name, ClassInfo typeInfo)
     
    <T> T
    Returns a local object that was previously registered with share() using just type registration.
    <T> T
    getLocalObject(String name, Class<T> type)
    Returns a local object that was previously registered with share() using name registration.
    <T> T
    Looks up a remote object by type and returns a local proxy to the remote object that was shared on the other end of the network connection.
    <T> T
    getRemoteObject(String name, Class<T> type)
    Looks up a remote object by name and returns a local proxy to the remote object that was shared on the other end of the network connection.
    protected Object
    invokeLocal(short objectId, short procId, Object[] args)
    Handle the actual remote object method calls.
    protected Object
    invokeRemote(byte channel, short objectId, short procId, CallType callType, Object[] args)
     
    protected void
    removeRemoteObject(short objectId)
     
    protected void
    rmiUpdate(short procId, Object[] args)
    Handle remote object registry updates from the other end.
    <T> void
    share(byte channel, String name, T object, Class<? super T> type)
    Exposes, through a specific connection channel, the specified object to the other end of the connection as the specified interface type and associates it with the specified name.
    <T> void
    share(byte channel, T object, Class<? super T> type)
    Exposes, through a specific connection channel, the specified object to the other end of the connection as the specified interface type.
    <T> void
    share(String name, T object, Class<? super T> type)
    Exposes the specified object to the other end of the connection as the specified interface type and associates it with the specified name.
    <T> void
    share(T object, Class<? super T> type)
    Exposes the specified object to the other end of the connection as the specified interface type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • share

      public <T> void share(T object, Class<? super T> type)
      Exposes the specified object to the other end of the connection as the specified interface type. The object can be looked up by type on the other end.
    • share

      public <T> void share(byte channel, T object, Class<? super T> type)
      Exposes, through a specific connection channel, the specified object to the other end of the connection as the specified interface type. The object can be looked up by type on the other end. The specified channel will be used for all network communication specific to this object.
    • share

      public <T> void share(String name, T object, Class<? super T> type)
      Exposes the specified object to the other end of the connection as the specified interface type and associates it with the specified name. The object can be looked up by the associated name on the other end of the connection.
    • share

      public <T> void share(byte channel, String name, T object, Class<? super T> type)
      Exposes, through a specific connection channel, the specified object to the other end of the connection as the specified interface type and associates it with the specified name. The object can be looked up by the associated name on the other end of the connection. The specified channel will be used for all network communication specific to this object.
    • getLocalObject

      public <T> T getLocalObject(Class<T> type)
      Returns a local object that was previously registered with share() using just type registration.
    • getLocalObject

      public <T> T getLocalObject(String name, Class<T> type)
      Returns a local object that was previously registered with share() using name registration.
    • getRemoteObject

      public <T> T getRemoteObject(Class<T> type)
      Looks up a remote object by type and returns a local proxy to the remote object that was shared on the other end of the network connection. If this is called from a client then it is accessing a shared object registered on the server. If this is called from the server then it is accessing a shared object registered on the client.
    • getRemoteObject

      public <T> T getRemoteObject(String name, Class<T> type)
      Looks up a remote object by name and returns a local proxy to the remote object that was shared on the other end of the network connection. If this is called from a client then it is accessing a shared object registered on the server. If this is called from the server then it is accessing a shared object registered on the client.
    • addRemoteClass

      protected void addRemoteClass(ClassInfo info)
    • removeRemoteObject

      protected void removeRemoteObject(short objectId)
    • addRemoteObject

      protected void addRemoteObject(byte channel, short objectId, String name, ClassInfo typeInfo)
    • invokeRemote

      protected Object invokeRemote(byte channel, short objectId, short procId, CallType callType, Object[] args)
    • rmiUpdate

      protected void rmiUpdate(short procId, Object[] args)
      Handle remote object registry updates from the other end.
    • invokeLocal

      protected Object invokeLocal(short objectId, short procId, Object[] args)
      Handle the actual remote object method calls.