org.jboss.webbeans.bean.proxy
Class ClientProxyMethodHandler

java.lang.Object
  extended by org.jboss.webbeans.bean.proxy.ClientProxyMethodHandler
All Implemented Interfaces:
java.io.Serializable, javassist.util.proxy.MethodHandler

public class ClientProxyMethodHandler
extends java.lang.Object
implements javassist.util.proxy.MethodHandler, java.io.Serializable

A Javassist MethodHandler that delegates method calls to a proxied bean. If the transient bean has become null, it is looked up from the manager bean list before the invocation.

Author:
Nicklas Karlsson
See Also:
ClientProxyProvider, Serialized Form

Constructor Summary
ClientProxyMethodHandler(Bean<?> bean, ManagerImpl manager, int beanIndex)
          Constructor
 
Method Summary
 java.lang.Object invoke(java.lang.Object self, java.lang.reflect.Method proxiedMethod, java.lang.reflect.Method proceed, java.lang.Object[] args)
          Invokes the method on the correct version of the instance as obtained by a context lookup
 java.lang.String toString()
          Gets a string representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientProxyMethodHandler

public ClientProxyMethodHandler(Bean<?> bean,
                                ManagerImpl manager,
                                int beanIndex)
Constructor

Parameters:
bean - The bean to proxy
beanIndex - The index to the bean in the manager bean list
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object self,
                               java.lang.reflect.Method proxiedMethod,
                               java.lang.reflect.Method proceed,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Invokes the method on the correct version of the instance as obtained by a context lookup

Specified by:
invoke in interface javassist.util.proxy.MethodHandler
Parameters:
self - the proxy instance.
thisMethod - the overridden method declared in the super class or interface.
proceed - the forwarder method for invoking the overridden method. It is null if the overridden mehtod is abstract or declared in the interface.
args - an array of objects containing the values of the arguments passed in the method invocation on the proxy instance. If a parameter type is a primitive type, the type of the array element is a wrapper class.
Returns:
the resulting value of the method invocation.
Throws:
java.lang.Throwable - if the method invocation fails.

toString

public java.lang.String toString()
Gets a string representation

Overrides:
toString in class java.lang.Object
Returns:
The string representation


Copyright © 2011. All Rights Reserved.