com.jproxy.proxy
Class TunnelInvocationHandler

java.lang.Object
  extended bycom.jproxy.proxy.TunnelInvocationHandler
All Implemented Interfaces:
java.io.Serializable

public class TunnelInvocationHandler
extends java.lang.Object
implements java.io.Serializable

Implementation of InvocationHandler used by DynamicProxyStub. The class implements handler for remote interface. All methods of remote interface are delegated to the handler. The class supports packaging requests with DataStack. It also recognizes Callbacks and creates for them proxies stubs. The class is used by client and created by Tunneling server.

See Also:
Invocator, Tunnel, Proxy, Serialized Form

Field Summary
 java.lang.Object object
          reference to target object to handle direct proxy calls
 
Constructor Summary
TunnelInvocationHandler(long _sessionId, java.lang.String[] _interfaceNames, long _objectId, java.lang.String _objectClassName, Tunnel _tunnel)
          Constructor for TunnelInvocationHandler
 
Method Summary
static java.lang.Object createTIHDescriptor(TunnelInvocationHandler baseHandler)
           
static IClientInvocationInterceptor getClientInvocationInterceptor()
           
 java.lang.String[] getInterfaceNames()
          Tunnelizable implementation
 java.lang.String getObjectClassName()
           
 long getObjectId()
          Tunnelizable implementation
 long getSessionId()
           
 Tunnel getTunnel()
          Tunnelizable implementation
 java.lang.Object invoke(Tunnelizable proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          The implementation of InvocationHandler Processes a method invocation on a proxy instance and returns the result.
 java.lang.Object invokeMethod(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          The method delegates calls to Tunnel object.
static void setClientInvocationInterceptor(IClientInvocationInterceptor interceptor)
           
 void setSessionId(long _sessionId)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

object

public transient java.lang.Object object
reference to target object to handle direct proxy calls

Constructor Detail

TunnelInvocationHandler

public TunnelInvocationHandler(long _sessionId,
                               java.lang.String[] _interfaceNames,
                               long _objectId,
                               java.lang.String _objectClassName,
                               Tunnel _tunnel)
                        throws TunnelException
Constructor for TunnelInvocationHandler

Method Detail

setClientInvocationInterceptor

public static void setClientInvocationInterceptor(IClientInvocationInterceptor interceptor)

getClientInvocationInterceptor

public static IClientInvocationInterceptor getClientInvocationInterceptor()

createTIHDescriptor

public static java.lang.Object createTIHDescriptor(TunnelInvocationHandler baseHandler)

invoke

public java.lang.Object invoke(Tunnelizable proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
The implementation of InvocationHandler Processes a method invocation on a proxy instance and returns the result. The method implements virtual method for Object class of the stub.

Parameters:
proxy - the proxy instance that the method was invoked on
method - the Method instance corresponding to the interface method invoked on the proxy
args - an array of objects containing the values of the arguments passed in the method
Throws:
java.lang.Throwable

getSessionId

public long getSessionId()

setSessionId

public void setSessionId(long _sessionId)

getObjectId

public long getObjectId()
Tunnelizable implementation


getTunnel

public Tunnel getTunnel()
Tunnelizable implementation


getInterfaceNames

public java.lang.String[] getInterfaceNames()
Tunnelizable implementation


getObjectClassName

public java.lang.String getObjectClassName()

invokeMethod

public java.lang.Object invokeMethod(java.lang.Object proxy,
                                     java.lang.reflect.Method method,
                                     java.lang.Object[] args)
                              throws java.lang.Throwable
The method delegates calls to Tunnel object. The method supports packaging requests with DataStack. It also recognizes Callbacks and creates for them proxies stubs.

Parameters:
proxy - Proxy stub object
method - reflected method of the proxy
args - arguments for method call
Throws:
java.lang.Throwable


Copyright © JProxy LLC. All Rights Reserved.