Class LRMIRuntime

java.lang.Object
com.gigaspaces.lrmi.LRMIRuntime

public class LRMIRuntime extends Object
LRMI is the main LRMI class, from the developer's perspective. Each JVM has one LRMI Runtime instance, which is obtainable via the getRuntime() static method. The LRMI Runtime provides access to the Protocol Registry, so that protocols can be plugged-in/out, and browsed. The LRMI Runtime provides export/unexport capabilities to servers. A remote object may be exported on several protocols, with different properties. The LRMI Runtime maintains an internal Remote Object Registry table, which keeps information about exported remote objects. Each remote object gets a unique id. in the LRMI Runtime environment. This unique id is the same, for all protocols that the remote object is exported to (although the connection URLs may be different for these protocols). The unique id is the key for the Remote Object Registry.
Since:
4.0
Author:
Igor Goldenberg
  • Field Details

    • DUMMY_OBJECT_ID

      public static final int DUMMY_OBJECT_ID
      Dummy object id
      See Also:
  • Method Details

    • getRuntime

      public static LRMIRuntime getRuntime()
      Returns:
      the instance of LRMIRuntime
    • getRuntime

      public static LRMIRuntime getRuntime(ITransportConfig config, ProtocolAdapter.Side initSide) throws ConfigurationException
      Returns the LRMIRuntime instance.
      Parameters:
      config - the transport protocol configuration.
      initSide - the protocol side initialization ProtocolAdapter.Side Client or Server.
      Returns:
      the instance of LRMIRuntime
      Throws:
      ConfigurationException - failed to initialize the runtime of LRMI.
    • getID

      public long getID()
    • getThreadPool

      public DynamicThreadPoolExecutor getThreadPool()
    • getMonitoringPriorityThreadPool

      public DynamicThreadPoolExecutor getMonitoringPriorityThreadPool()
    • getLivenessPriorityThreadPool

      public DynamicThreadPoolExecutor getLivenessPriorityThreadPool()
    • getCustomThreadPool

      public DynamicThreadPoolExecutor getCustomThreadPool()
    • isUseNetworkInJVM

      public boolean isUseNetworkInJVM()
    • setUseNetworkInJVM

      public void setUseNetworkInJVM(boolean useNetworkInJVM)
      If set Network socket will be used even when the client and the server share the same JVM.
    • setMonitorActivity

      public void setMonitorActivity(boolean trackActivity)
    • isMonitorActivity

      public boolean isMonitorActivity()
    • getProtocolRegistry

      public ProtocolRegistry getProtocolRegistry()
      Returns the protocol registry of this LRMI Runtime.
      Returns:
      the protocol registry of this LRMI Runtime.
    • getPort

      public int getPort(ITransportConfig config)
    • getMonitoringDetails

      public LRMIMonitoringDetails getMonitoringDetails(ITransportConfig config)
    • initServerSide

      public void initServerSide() throws ConfigurationException
      Throws:
      ConfigurationException
    • createDynamicProxy

      public Remote createDynamicProxy(Remote remoteObj, ITransportConfig config, boolean allowCache)
      Returns an instance of a dynamic Proxy which represents DynamicSmartStub and castable to any remote declared interface of passed obj.
      Parameters:
      remoteObj - the remote object to make it available to receive remote method invocation.
      config - the configuration of transport protocol.
      Returns:
      dynamic smart stub.
    • unexport

      public void unexport(Remote object, String protocol, boolean force) throws RemoteException, NoSuchObjectException
      Unexports the remote object from the specified protocol.
      Parameters:
      object - the the object to unexport.
      protocol - the protocol to unexport the object from.
      force - if true unexport should be performed even if the remote object is in the process of serving clients' requests.
      Throws:
      RemoteException - failed to unexport.
      NoSuchObjectException - if the remote object is not currently exported.
    • getRegistryObject

      public ObjectRegistry.Entry getRegistryObject(long objectId)
      Returns the object registry info of bound remote object in remote LRMI stack.
      Parameters:
      objectId - The exported objectId.
      Returns:
      registry object or remote object or null if the supplied objectId was never registered or already unexported.
    • invoked

      public Object invoked(long objectId, IMethod method, Object[] args) throws RemoteException, ApplicationException
      This method is called by a Server Peer after extracting the method name and arguments.
      Throws:
      RemoteException
      ApplicationException
    • getRemoteObjectConnectionsList

      public List<ITransportConnection> getRemoteObjectConnectionsList(long remoteObjID) throws NoSuchObjectException
      Returns:
      the Transport connection info list for supplied remote objectID.
      Throws:
      NoSuchObjectException
    • countRemoteObjectConnections

      public int countRemoteObjectConnections(long remoteObjID) throws NoSuchObjectException
      Throws:
      NoSuchObjectException
    • getStubCache

      public StubCache getStubCache()
    • shutdown

      public void shutdown()
      Shutdown the lrmi runtime, once invoked the LRMI layer is destroyed and cannot be reused in the current class loader which it was created in, as a result this is an irreversible process.
      Since:
      7.1
    • getNetworkMapper

      public INetworkMapper getNetworkMapper()
      Gets the network mapper
    • simulatedDisconnectionByPID

      public void simulatedDisconnectionByPID(int pid)
    • simulatedReconnectionByPID

      public void simulatedReconnectionByPID(int pid)