|
|||||||||
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
JDK-based AopProxy
implementation for the Spring AOP framework,
based on JDK dynamic proxies
.
Creates a dynamic proxy, implementing the interfaces exposed by the AopProxy. 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 thread-safe.
Proxies are serializable so long as all Advisors (including Advices and Pointcuts) and the TargetSource are serializable.
Proxy
,
AdvisedSupport
,
ProxyFactory
Field Summary | |
---|---|
private AdvisedSupport |
advised
Config used to configure this proxy |
private boolean |
equalsDefined
Is the equals(java.lang.Object) method defined on the proxied interfaces? |
private boolean |
hashCodeDefined
Is the hashCode() method defined on the proxied interfaces? |
private static Log |
logger
We use a static Log to avoid serialization issues |
private static long |
serialVersionUID
use serialVersionUID from Spring 1.2 for interoperability |
Constructor Summary | |
---|---|
JdkDynamicAopProxy(AdvisedSupport config)
Construct a new JdkDynamicAopProxy for the given AOP configuration. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object other)
Equality means interfaces, advisors and TargetSource are equal. |
private void |
findDefinedEqualsAndHashCodeMethods(java.lang.Class[] proxiedInterfaces)
Finds any equals(java.lang.Object) or hashCode() method that may be defined
on the supplied set of interfaces. |
java.lang.Object |
getProxy()
Create a new proxy object. |
java.lang.Object |
getProxy(java.lang.ClassLoader classLoader)
Create a new proxy object. |
int |
hashCode()
Proxy uses the hash code of the TargetSource. |
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
Implementation of InvocationHandler.invoke . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static Log logger
private final AdvisedSupport advised
private boolean equalsDefined
equals(java.lang.Object)
method defined on the proxied interfaces?
private boolean hashCodeDefined
hashCode()
method defined on the proxied interfaces?
Constructor Detail |
---|
public JdkDynamicAopProxy(AdvisedSupport config) throws AopConfigException
config
- the AOP configuration as AdvisedSupport object
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 java.lang.Object getProxy()
AopProxy
Uses the AopProxy's default class loader (if necessary for proxy creation): usually, the thread context class loader.
getProxy
in interface AopProxy
null
)Thread.getContextClassLoader()
public java.lang.Object getProxy(java.lang.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 AopProxy.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)
null
)private void findDefinedEqualsAndHashCodeMethods(java.lang.Class[] proxiedInterfaces)
equals(java.lang.Object)
or hashCode()
method that may be defined
on the supplied set of interfaces.
proxiedInterfaces
- the interfaces to introspectpublic java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
InvocationHandler.invoke
.
Callers will see exactly the exception thrown by the target, unless a hook method throws an exception.
invoke
in interface java.lang.reflect.InvocationHandler
java.lang.Throwable
public boolean equals(java.lang.Object other)
The compared object may be a JdkDynamicAopProxy instance itself or a dynamic proxy wrapping a JdkDynamicAopProxy instance.
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |