org.springframework.aop.framework
Class JdkDynamicAopProxy


final class JdkDynamicAopProxy
implements AopProxy, InvocationHandler

InvocationHandler implementation for the Spring AOP framework, based on J2SE 1.3+ dynamic proxies.

Creates a J2SE proxy, implementing the interfaces exposed by the proxy. Dynamic proxies cannot be used to proxy methods defined in classes, rather than interface.

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

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

Author:
Rod Johnson, Juergen Hoeller
Version: $Id: JdkDynamicAopProxy.java,v 1.8 2003/12/19 11:54:59 jhoeller Exp $
See Also: Proxy, AdvisedSupport, ProxyFactory

Method Summary
 booleanequals(Object other)
          Equality means interceptors and interfaces and TargetSource are equal.
 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.
 Objectinvoke(Object proxy, Method method, Object[] args)
          Implementation of InvocationHandler.invoke.

Method Detail

equals

public boolean equals(Object other)
Equality means interceptors and interfaces and TargetSource are equal.
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.

invoke

public Object invoke(Object proxy, Method method, Object[] args)
throws java.lang.Throwable
Implementation of InvocationHandler.invoke. 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