类 JdkDynamicAopProxy
- 所有已实现的接口:
AopProxy,Serializable,InvocationHandler
AopProxy implementation for the 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 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.
- 从以下版本开始:
- 3.0 2021/2/1 22:42
- 作者:
- Rod Johnson, Juergen Hoeller, Rob Harrop, Dave Syer, Harry Yang
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明(专用程序包) static final classHolder for the complete proxied interfaces and derived metadata, to be cached inAdvisedSupport.proxyMetadataCache. -
字段概要
字段修饰符和类型字段说明private final AdvisedSupportConfig used to configure this proxy.Cached inAdvisedSupport.proxyMetadataCache.private static final infra.logging.LoggerWe use a static Log to avoid serialization issues.private static final long -
构造器概要
构造器构造器说明JdkDynamicAopProxy(AdvisedSupport config) Construct a new JdkDynamicAopProxy for the given AOP configuration. -
方法概要
修饰符和类型方法说明private ClassLoaderdetermineClassLoader(ClassLoader classLoader) Determine whether the JDK bootstrap or platform loader has been suggested -> use higher-level loader which can see infrastructure classes instead.booleanEquality means interfaces, advisors and TargetSource are equal.getProxy()Create a new proxy object.getProxy(ClassLoader classLoader) Create a new proxy object.Class<?>getProxyClass(ClassLoader classLoader) Determine the proxy class.inthashCode()Proxy uses the hash code of the TargetSource.Implementation ofInvocationHandler.invoke.private void
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
logger
private static final infra.logging.Logger loggerWe use a static Log to avoid serialization issues. -
advised
Config used to configure this proxy. -
cache
Cached inAdvisedSupport.proxyMetadataCache.
-
-
构造器详细资料
-
JdkDynamicAopProxy
Construct a new JdkDynamicAopProxy for the given AOP configuration.- 参数:
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.
-
-
方法详细资料
-
getProxy
从接口复制的说明:AopProxyCreate a new proxy object.Uses the AopProxy's default class loader (if necessary for proxy creation): usually, the thread context class loader.
-
getProxy
从接口复制的说明:AopProxyCreate a new proxy object.Uses the given class loader (if necessary for proxy creation).
nullwill 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'sAopProxy.getProxy()method. -
getProxyClass
从接口复制的说明:AopProxyDetermine the proxy class.- 指定者:
getProxyClass在接口中AopProxy- 参数:
classLoader- the class loader to create the proxy class with (ornullfor the low-level proxy facility's default)- 返回:
- the proxy class
-
determineClassLoader
Determine whether the JDK bootstrap or platform loader has been suggested -> use higher-level loader which can see infrastructure classes instead. -
invoke
Implementation ofInvocationHandler.invoke.Callers will see exactly the exception thrown by the target, unless a hook method throws an exception.
- 指定者:
invoke在接口中InvocationHandler- 抛出:
Throwable
-
equals
Equality means interfaces, advisors and TargetSource are equal.The compared object may be a JdkDynamicAopProxy instance itself or a dynamic proxy wrapping a JdkDynamicAopProxy instance.
-
hashCode
public int hashCode()Proxy uses the hash code of the TargetSource. -
readObject
-