Package com.gigaspaces.lrmi
Class LRMIRuntime
java.lang.Object
com.gigaspaces.lrmi.LRMIRuntime
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintcountRemoteObjectConnections(long remoteObjID) createDynamicProxy(Remote remoteObj, ITransportConfig config, boolean allowCache) Returns an instance of a dynamicProxywhich represents DynamicSmartStub and castable to any remote declared interface of passedobj.longgetID()getMonitoringDetails(ITransportConfig config) Gets the network mapperintgetPort(ITransportConfig config) Returns the protocol registry of this LRMI Runtime.getRegistryObject(long objectId) Returns the object registry info of bound remote object in remote LRMI stack.getRemoteObjectConnectionsList(long remoteObjID) static LRMIRuntimestatic LRMIRuntimegetRuntime(ITransportConfig config, ProtocolAdapter.Side initSide) Returns the LRMIRuntime instance.voidThis method is called by a Server Peer after extracting the method name and arguments.booleanbooleanvoidsetMonitorActivity(boolean trackActivity) voidsetUseNetworkInJVM(boolean useNetworkInJVM) If set Network socket will be used even when the client and the server share the same JVM.voidshutdown()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.voidsimulatedDisconnectionByPID(int pid) voidsimulatedReconnectionByPID(int pid) voidUnexports the remote object from the specified protocol.
-
Field Details
-
DUMMY_OBJECT_ID
public static final int DUMMY_OBJECT_IDDummy object id- See Also:
-
-
Method Details
-
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 initializationProtocolAdapter.SideClient or Server.- Returns:
- the instance of LRMIRuntime
- Throws:
ConfigurationException- failed to initialize the runtime of LRMI.
-
getID
public long getID() -
getThreadPool
-
getMonitoringPriorityThreadPool
-
getLivenessPriorityThreadPool
-
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
Returns the protocol registry of this LRMI Runtime.- Returns:
- the protocol registry of this LRMI Runtime.
-
getPort
-
getMonitoringDetails
-
initServerSide
- Throws:
ConfigurationException
-
createDynamicProxy
Returns an instance of a dynamicProxywhich represents DynamicSmartStub and castable to any remote declared interface of passedobj.- 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- iftrueunexport 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
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
nullif 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:
RemoteExceptionApplicationException
-
getRemoteObjectConnectionsList
public List<ITransportConnection> getRemoteObjectConnectionsList(long remoteObjID) throws NoSuchObjectException - Returns:
- the Transport connection info list for supplied remote objectID.
- Throws:
NoSuchObjectException
-
countRemoteObjectConnections
- Throws:
NoSuchObjectException
-
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
Gets the network mapper -
simulatedDisconnectionByPID
public void simulatedDisconnectionByPID(int pid) -
simulatedReconnectionByPID
public void simulatedReconnectionByPID(int pid)
-