public class DynamicSmartStub extends Object implements ProxyInvocationHandler, InvocationHandler, Serializable, Remote, Externalizable, ILRMIProxy
Proxy this class serves as Interceptor of invoked methods. The invoked method injected by
 dynamic-proxy delegates to the direct reference reflection call of exported object, only in case
 this DynamicSmartStub still handles a direct reference of exported object getLocalObjImpl().  If DynamicSmartStub is serializing, as part writeExternal(java.io.ObjectOutput) method the getLocalObjImpl() will be exported to
 the underlying transport protocol. The serialization process is an indication for
 DynamicSmartStub about exiting out side from local JVM.
 On deserialization the
 DynamicSmartStub will try to aquire the direct localObject reference from the underlying
 transport protocol. If direct reference wasn't acquired, it means the stub instance is not in
 local JVM. Every future injected method will be called remotely.
LRMIRuntime, 
Serialized Form| Modifier and Type | Field and Description | 
|---|---|
| static ThreadLocal<Boolean> | markProxyAsClosed | 
INTERNAL_NAME| Constructor and Description | 
|---|
| DynamicSmartStub() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | closeProxy()Close the underline proxy connection and resources, this proxy will no longer be usable. | 
| void | disable()Force this stub to be disabled (disconnected from its target) | 
| void | enable()Removes state of any previously called  ILRMIProxy.disable() | 
| boolean | equals(Object obj)Equals the DynamicSmartStub instances by direct obj reference if the stubs in local VM,
 otherwise equals by remoteObjId | 
| static DynamicSmartStub | extractDynamicSmartStubFrom(Object obj) | 
| protected void | finalize() | 
| String | getConnectionUrl()Returns the connectionURL of exported remote object. | 
| long | getGeneratedTraffic() | 
| protected MethodCachedInvocationHandler | getInvocationHandler()returns the initialized remote InvocationHandler | 
| Object | getLocalObjImpl() | 
| static LRMIOutboundMonitoringDetailsImpl | getMonitoringDetails() | 
| long | getReceivedTraffic() | 
| String | getRemoteHostAddress() | 
| String | getRemoteHostName() | 
| InetSocketAddress | getRemoteNetworkAddress() | 
| long | getRemoteObjID() | 
| long | getRemoteProcessId() | 
| PlatformLogicalVersion | getServicePlatformLogicalVersion() | 
| StubId | getStubId() | 
| int | hashCode() | 
| Object | invoke(Object proxy,
      IMethod method,
      Object[] args)Processes a method invocation on a proxy instance and returns the result. | 
| Object | invoke(Object proxy,
      Method method,
      Object[] args)Needed for standard java dynamic proxy. | 
| protected Object | invokeRemote(Object proxy,
            IMethod method,
            Object[] args)performs remote invocation method | 
| boolean | isClosed() | 
| boolean | isCollocated() | 
| boolean | isRemote() | 
| boolean | isUnexported() | 
| void | overrideMethodsMetadata(Map<String,LRMIMethodMetadata> methodsMetadata)Overrides the LRMI methods metadata. | 
| void | readExternal(ObjectInput in) | 
| static void | simulatedDisconnectionByPID(int pid) | 
| static void | simulatedReconnectionByPID(int pid) | 
| static void | throwProxyClosedExeption(String connectionUrl) | 
| String | toString() | 
| void | writeExternal(ObjectOutput out) | 
public static final transient ThreadLocal<Boolean> markProxyAsClosed
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke in interface InvocationHandlerThrowablepublic Object invoke(Object proxy, IMethod method, Object[] args) throws Throwable
invoke in interface ProxyInvocationHandlerproxy - the proxy instance that the method was invoked onmethod - the IMethod instance corresponding to the interface method invoked
               on the proxy instance.  The declaring class of the IMethod object
               will be the interface that the method was declared in, which may be a
               superinterface of the proxy interface that the proxy class inherits the method
               through.args - an array of objects containing the values of the arguments passed in the method
               invocation on the proxy instance, or null if interface method
               takes no arguments. Arguments of primitive types are wrapped in instances of
               the appropriate primitive wrapper class, such as java.lang.Integer
               or java.lang.Boolean.null and the interface method's return type is primitive, then a
 NullPointerException will be thrown by the method invocation on the proxy
 instance.  If the value returned by this method is otherwise not compatible with the
 interface method's declared return type as described above, a ClassCastException
 will be thrown by the method invocation on the proxy instance.Throwable - the exception to throw from the method invocation on the proxy instance.
                   The exception's type must be assignable either to any of the exception
                   types declared in the throws clause of the interface method or
                   to the unchecked exception types java.lang.RuntimeException or
                   java.lang.Error.  If a checked exception is thrown by this
                   method that is not assignable to any of the exception types declared in the
                   throws clause of the interface method, then an UndeclaredThrowableException containing the exception that was thrown by
                   this method will be thrown by the method invocation on the proxy instance.UndeclaredThrowableExceptionprotected Object invokeRemote(Object proxy, IMethod method, Object[] args) throws Throwable
Throwableprotected MethodCachedInvocationHandler getInvocationHandler() throws RemoteException
RemoteExceptionpublic long getRemoteObjID()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic Object getLocalObjImpl()
null if this Stub doesn't exist in
 local exported VMpublic static DynamicSmartStub extractDynamicSmartStubFrom(Object obj)
obj - the object to extract DynamicSmartStub instance.null supplied object is not
 DynamicSmartStub invocation handler and not Proxy.public boolean isCollocated()
true if this instance of DynamicSmartStub is collocated with
 exported endpoint object, otherwise false if this stub is remote.public int hashCode()
public boolean equals(Object obj)
public boolean isUnexported()
true if DynamicSmartStub was closedpublic void closeProxy()
ILRMIProxycloseProxy in interface ILRMIProxypublic boolean isClosed()
isClosed in interface ILRMIProxypublic boolean isRemote()
isRemote in interface ILRMIProxypublic PlatformLogicalVersion getServicePlatformLogicalVersion()
getServicePlatformLogicalVersion in interface ILRMIProxypublic long getGeneratedTraffic()
getGeneratedTraffic in interface ILRMIProxypublic long getReceivedTraffic()
getReceivedTraffic in interface ILRMIProxypublic String getConnectionUrl()
getConnectionUrl in interface ILRMIProxypublic long getRemoteProcessId()
getRemoteProcessId in interface ILRMIProxypublic String getRemoteHostName()
getRemoteHostName in interface ILRMIProxypublic String getRemoteHostAddress()
getRemoteHostAddress in interface ILRMIProxypublic InetSocketAddress getRemoteNetworkAddress()
getRemoteNetworkAddress in interface ILRMIProxypublic StubId getStubId()
getStubId in interface ILRMIProxypublic void disable()
             throws RemoteException
ILRMIProxydisable in interface ILRMIProxyRemoteExceptionpublic void enable()
            throws RemoteException
ILRMIProxyILRMIProxy.disable()enable in interface ILRMIProxyRemoteExceptionpublic void overrideMethodsMetadata(Map<String,LRMIMethodMetadata> methodsMetadata)
ILRMIProxyoverrideMethodsMetadata in interface ILRMIProxypublic static void throwProxyClosedExeption(String connectionUrl) throws ProxyClosedException
ProxyClosedExceptionpublic static LRMIOutboundMonitoringDetailsImpl getMonitoringDetails()
protected void finalize()
                 throws Throwable
public static void simulatedDisconnectionByPID(int pid)
public static void simulatedReconnectionByPID(int pid)
Copyright © GigaSpaces.