类 AopProxyUtils
java.lang.Object
infra.aop.framework.AopProxyUtils
Utility methods for AOP proxy factories.
Mainly for internal use within the AOP framework.
See AopUtils for a collection of
generic AOP utility methods which do not depend on AOP framework internals.
- 从以下版本开始:
- 3.0
- 作者:
- Rod Johnson, Juergen Hoeller, TODAY 2021/2/1 21:49
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static Class<?>[]completeJdkProxyInterfaces(Class<?>... userInterfaces) Complete the set of interfaces that are typically required in a JDK dynamic proxy generated by Infra AOP.static Class<?>[]completeProxiedInterfaces(AdvisedSupport advised) Determine the complete set of interfaces to proxy for the given AOP configuration.static Class<?>[]completeProxiedInterfaces(AdvisedSupport advised, boolean decoratingProxy) Determine the complete set of interfaces to proxy for the given AOP configuration.static booleanCheck equality of the advisors behind the given AdvisedSupport objects.static booleanCheck equality of the proxies behind the given AdvisedSupport objects.static booleanCheck equality of the proxied interfaces behind the given AdvisedSupport objects.static ObjectgetSingletonTarget(Object candidate) Obtain the singleton target object behind the given proxy, if any.static Class<?>[]proxiedUserInterfaces(Object proxy) Extract the user-specified interfaces that the given proxy implements, i.e. all non-Advised interfaces that the proxy implements.static Class<?>ultimateTargetClass(Object candidate) Determine the ultimate target class of the given bean instance, traversing not only a top-level proxy but any number of nested proxies as well — as long as possible without side effects, that is, just for singleton targets.
-
构造器详细资料
-
AopProxyUtils
public AopProxyUtils()
-
-
方法详细资料
-
getSingletonTarget
Obtain the singleton target object behind the given proxy, if any.- 参数:
candidate- the (potential) proxy to check- 返回:
- the singleton target object managed in a
SingletonTargetSource, ornullin any other case (not a proxy, not an existing singleton target) - 另请参阅:
-
ultimateTargetClass
Determine the ultimate target class of the given bean instance, traversing not only a top-level proxy but any number of nested proxies as well — as long as possible without side effects, that is, just for singleton targets.- 参数:
candidate- the instance to check (might be an AOP proxy)- 返回:
- the ultimate target class (or the plain class of the given
object as fallback; never
null) - 另请参阅:
-
completeJdkProxyInterfaces
Complete the set of interfaces that are typically required in a JDK dynamic proxy generated by Infra AOP.Specifically,
StandardProxy,Advised, andDecoratingProxywill be appended to the set of user-specified interfaces.This method can be useful when registering proxy hints for Infra AOT support, as demonstrated in the following example which uses this method via a
staticimport.RuntimeHints hints = ... hints.proxies().registerJdkProxy(completeJdkProxyInterfaces(MyInterface.class));
- 参数:
userInterfaces- the set of user-specified interfaces implemented by the component to be proxied- 返回:
- the complete set of interfaces that the proxy should implement
- 抛出:
IllegalArgumentException- if a suppliedClassisnull, is not an interface, or is a sealed interface- 从以下版本开始:
- 4.0
- 另请参阅:
-
StandardProxyAdvisedDecoratingProxyRuntimeHints.proxies()ProxyHints.registerJdkProxy(Class...)
-
completeProxiedInterfaces
Determine the complete set of interfaces to proxy for the given AOP configuration.This will always add the
Advisedinterface unless the AdvisedSupport's"opaque"flag is on. Always adds theStandardProxymarker interface.- 参数:
advised- the proxy config- 返回:
- the complete set of interfaces to proxy
- 从以下版本开始:
- 3.0
- 另请参阅:
-
completeProxiedInterfaces
Determine the complete set of interfaces to proxy for the given AOP configuration.This will always add the
Advisedinterface unless the AdvisedSupport's"opaque"flag is on. Always adds theStandardProxymarker interface.- 参数:
advised- the proxy configdecoratingProxy- whether to expose theDecoratingProxyinterface- 返回:
- the complete set of interfaces to proxy
- 从以下版本开始:
- 3.0
- 另请参阅:
-
StandardProxyAdvisedDecoratingProxy
-
proxiedUserInterfaces
Extract the user-specified interfaces that the given proxy implements, i.e. all non-Advised interfaces that the proxy implements.- 参数:
proxy- the proxy to analyze (usually a JDK dynamic proxy)- 返回:
- all user-specified interfaces that the proxy implements,
in the original order (never
nullor empty) - 另请参阅:
-
equalsInProxy
Check equality of the proxies behind the given AdvisedSupport objects. Not the same as equality of the AdvisedSupport objects: rather, equality of interfaces, advisors and target sources. -
equalsProxiedInterfaces
Check equality of the proxied interfaces behind the given AdvisedSupport objects. -
equalsAdvisors
Check equality of the advisors behind the given AdvisedSupport objects.
-