|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.aop.framework.JdkDynamicAopProxy
final class JdkDynamicAopProxy
InvocationHandler implementation for the Spring AOP framework, based on JDK 1.3+ dynamic proxies.
Creates a JDK proxy, implementing the interfaces exposed by the proxy. Dynamic proxies cannot be used to proxy methods defined in classes, rather than interfaces.
Objects of this type should be obtained through proxy factories,
configured by an AdvisedSupport
class. This class is internal
to Spring's AOP framework and need not be used directly by client code.
Proxies created using this class will be thread-safe if the underlying (target) class is threadsafe.
Proxies are serializable so long as all Advisors are serializable (including Advices and Pointcuts) and the TargetSource is serializable.
Proxy
,
AdvisedSupport
,
ProxyFactory
Constructor Summary | |
---|---|
JdkDynamicAopProxy(AdvisedSupport config)
Construct a new JDK proxy. |
Method Summary | |
---|---|
boolean |
equals(Object other)
Equality means interfaces, advisors and TargetSource are equal. |
Object |
getProxy()
Create a new proxy object. |
Object |
getProxy(ClassLoader classLoader)
Create a new proxy object. |
int |
hashCode()
Proxy uses the hash code of the TargetSource. |
Object |
invoke(Object proxy,
Method method,
Object[] args)
Implementation of InvocationHandler.invoke . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JdkDynamicAopProxy(AdvisedSupport config) throws AopConfigException
AopConfigException
- if the config is invalid.
We try to throw an informative exception in this case,
rather than let a mysterious failure happen later.Method Detail |
---|
public Object getProxy()
AopProxy
Uses the most optimal default class loader (if necessary for proxy creation): usually, the thread context class loader.
getProxy
in interface AopProxy
Thread.getContextClassLoader()
public Object getProxy(ClassLoader classLoader)
AopProxy
Uses the given class loader (if necessary for proxy creation).
null
will simply be passed down and thus lead to the low-level
proxy facility's default, which is usually different from the default chosen
by the AopProxy implementation's getProxy
method.
getProxy
in interface AopProxy
classLoader
- the class loader to create the proxy with
(or null
for the low-level proxy facility's default)public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
InvocationHandler.invoke
.
Callers will see exactly the exception thrown by the target, unless a hook method throws an exception.
invoke
in interface InvocationHandler
Throwable
public int hashCode()
hashCode
in class Object
public boolean equals(Object other)
equals
in class Object
other
- may be a dynamic proxy wrapping an instance of this classObject.equals(java.lang.Object)
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |