org.jboss.webbeans.bean.proxy
Class ProxyMethodHandler

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

public class ProxyMethodHandler
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:
ProxyPool, Serialized Form

Constructor Summary
ProxyMethodHandler(Bean<?> bean, int beanIndex)
          Constructor
 
Method Summary
 java.lang.Object invoke(java.lang.Object self, java.lang.reflect.Method method, java.lang.reflect.Method proceed, java.lang.Object[] args)
          The method proxy Uses reflection to look up the corresponding method on the proxy and executes that method with the same parameters.
 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

ProxyMethodHandler

public ProxyMethodHandler(Bean<?> bean,
                          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 method,
                               java.lang.reflect.Method proceed,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
The method proxy Uses reflection to look up the corresponding method on the proxy and executes that method with the same parameters.

Specified by:
invoke in interface javassist.util.proxy.MethodHandler
Parameters:
self - A reference to the proxy
method - The method to execute
process - The next method to proceed to
args - The method calling arguments
Throws:
java.lang.Throwable

toString

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

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


Copyright © 2008. All Rights Reserved.