org.springframework.aop.framework
Class Cglib2AopProxy


class Cglib2AopProxy
implements AopProxy, CallbackFilter, MethodInterceptor

CGLIB 2 AopProxy implementation for the Spring AOP framework. Also implements the CGLIB MethodInterceptor and CallbackFilter interfaces.

Objects of this type should be obtained through proxy factories, configured by a AdvisedSupport implementation. This class is internal to the Spring framework and need not be used directly by client code.

Proxies created using this class are threadsafe if the underlying (target) class is threadsafe.

Author:
Rod Johnson
Version: $Id: Cglib2AopProxy.java,v 1.1 2003/12/19 10:20:00 johnsonr Exp $

Method Summary
 intaccept(Method method)
          Implementation of CallbackFilter.accept() to return the index of the callback we need.
 booleanequals(Object other)
          Equality means interceptors and interfaces are ==.
 ObjectgetProxy()
          Creates a new Proxy object for the given object, proxying the given interface.
 ObjectgetProxy(ClassLoader cl)
          Creates a new Proxy object for the given object, proxying the given interface.
 Objectintercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy)
          Implementation of MethodInterceptor.

Method Detail

accept

public int accept(Method method)
Implementation of CallbackFilter.accept() to return the index of the callback we need. This will mean either no overriding, AOP_PROXY (run through our intercept method) or INVOKE_TARGET (optimized direct invocation of target without re-evaluating advice chain at runtime).
See Also:
net.sf.cglib.proxy.CallbackFilter#accept(java.lang.reflect.Method)

equals

public boolean equals(Object other)
Equality means interceptors and interfaces are ==.
Parameters:
other - may be a dynamic proxy wrapping an instance of this class
See Also:
java.lang.Object.equals(java.lang.Object)

getProxy

public Object getProxy()
Creates a new Proxy object for the given object, proxying the given interface. Uses the thread context class loader.

getProxy

public Object getProxy(ClassLoader cl)
Creates a new Proxy object for the given object, proxying the given interface. Uses the given class loader.

intercept

public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy)
throws java.lang.Throwable
Implementation of MethodInterceptor. Callers will see exactly the exception thrown by the target, unless a hook method throws an exception.

Association Links

to Class org.springframework.aop.framework.AdvisedSupport

Config used to configure this proxy