类 AutoProxyUtils
java.lang.Object
infra.aop.framework.autoproxy.AutoProxyUtils
Utilities for auto-proxy aware components.
Mainly for internal use within the framework.
- 从以下版本开始:
- 4.0 2022/3/9 16:34
- 作者:
- Juergen Hoeller, Harry Yang
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明static final StringBean definition attribute that indicates the original target class of an auto-proxied bean, e.g. to be used for the introspection of annotations on the target class behind an interface-based proxy.static final StringBean definition attribute that may indicate whether a given bean is supposed to be proxied with its target class (in case of it getting proxied in the first place). -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static Class<?>determineTargetClass(infra.beans.factory.config.ConfigurableBeanFactory beanFactory, String beanName) Determine the original target class for the specified bean, if possible, otherwise falling back to a regulargetTypelookup.(专用程序包) static voidexposeTargetClass(infra.beans.factory.config.ConfigurableBeanFactory beanFactory, String beanName, Class<?> targetClass) Expose the given target class for the specified bean, if possible.(专用程序包) static booleanisOriginalInstance(String beanName, Class<?> beanClass) Determine whether the given bean name indicates an "original instance" according toAutowireCapableBeanFactory.ORIGINAL_INSTANCE_SUFFIX, skipping any proxy attempts for it.static booleanshouldProxyTargetClass(infra.beans.factory.config.ConfigurableBeanFactory beanFactory, String beanName) Determine whether the given bean should be proxied with its target class rather than its interfaces.
-
字段详细资料
-
PRESERVE_TARGET_CLASS_ATTRIBUTE
Bean definition attribute that may indicate whether a given bean is supposed to be proxied with its target class (in case of it getting proxied in the first place). The value isBoolean.TRUEorBoolean.FALSE.Proxy factories can set this attribute if they built a target class proxy for a specific bean, and want to enforce that bean can always be cast to its target class (even if AOP advices get applied through auto-proxying).
-
ORIGINAL_TARGET_CLASS_ATTRIBUTE
Bean definition attribute that indicates the original target class of an auto-proxied bean, e.g. to be used for the introspection of annotations on the target class behind an interface-based proxy.
-
-
构造器详细资料
-
AutoProxyUtils
public AutoProxyUtils()
-
-
方法详细资料
-
shouldProxyTargetClass
public static boolean shouldProxyTargetClass(infra.beans.factory.config.ConfigurableBeanFactory beanFactory, @Nullable String beanName) Determine whether the given bean should be proxied with its target class rather than its interfaces. Checks the"preserveTargetClass" attributeof the corresponding bean definition.- 参数:
beanFactory- the containing ConfigurableBeanFactorybeanName- the name of the bean- 返回:
- whether the given bean should be proxied with its target class
-
determineTargetClass
@Nullable public static Class<?> determineTargetClass(infra.beans.factory.config.ConfigurableBeanFactory beanFactory, @Nullable String beanName) Determine the original target class for the specified bean, if possible, otherwise falling back to a regulargetTypelookup.- 参数:
beanFactory- the containing ConfigurableBeanFactorybeanName- the name of the bean- 返回:
- the original target class as stored in the bean definition, if any
- 另请参阅:
-
BeanFactory.getType(String)
-
exposeTargetClass
static void exposeTargetClass(infra.beans.factory.config.ConfigurableBeanFactory beanFactory, @Nullable String beanName, Class<?> targetClass) Expose the given target class for the specified bean, if possible.- 参数:
beanFactory- the containing ConfigurableBeanFactorybeanName- the name of the beantargetClass- the corresponding target class
-
isOriginalInstance
Determine whether the given bean name indicates an "original instance" according toAutowireCapableBeanFactory.ORIGINAL_INSTANCE_SUFFIX, skipping any proxy attempts for it.- 参数:
beanName- the name of the beanbeanClass- the corresponding bean class- 另请参阅:
-
AutowireCapableBeanFactory.ORIGINAL_INSTANCE_SUFFIX
-