类 ExposeBeanNameAdvisors
java.lang.Object
infra.aop.interceptor.ExposeBeanNameAdvisors
Convenient methods for creating advisors that may be used when autoproxying beans
created with the IoC container, binding the bean name to the current
invocation. May support a
bean() pointcut designator with AspectJ.
Typically used in auto-proxying, where the bean name is known at proxy creation time.
- 从以下版本开始:
- 4.0 2022/3/9 22:22
- 作者:
- Rod Johnson, Juergen Hoeller, Harry Yang
- 另请参阅:
-
NamedBean
-
嵌套类概要
嵌套类修饰符和类型类说明private static final recordInterceptor that exposes the specified bean name as invocation attribute.private static classIntroduction that exposes the specified bean name as invocation attribute. -
字段概要
字段修饰符和类型字段说明private static final StringBinding for the bean name of the bean which is currently being invoked in the ReflectiveMethodInvocation userAttributes Map. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static AdvisorcreateAdvisorIntroducingNamedBean(String beanName) Create a new advisor that will expose the given bean name, introducing the NamedBean interface to make the bean name accessible without forcing the target object to be aware of this IoC concept.static AdvisorcreateAdvisorWithoutIntroduction(String beanName) Create a new advisor that will expose the given bean name, with no introduction.static StringFind the bean name for the current invocation.static StringFind the bean name for the given invocation.
-
字段详细资料
-
BEAN_NAME_ATTRIBUTE
Binding for the bean name of the bean which is currently being invoked in the ReflectiveMethodInvocation userAttributes Map.
-
-
构造器详细资料
-
ExposeBeanNameAdvisors
public ExposeBeanNameAdvisors()
-
-
方法详细资料
-
getBeanName
Find the bean name for the current invocation. Assumes that an ExposeBeanNameAdvisor has been included in the interceptor chain, and that the invocation is exposed with ExposeInvocationInterceptor.- 返回:
- the bean name (never
null) - 抛出:
IllegalStateException- if the bean name has not been exposed
-
getBeanName
Find the bean name for the given invocation. Assumes that an ExposeBeanNameAdvisor has been included in the interceptor chain.- 参数:
mi- the MethodInvocation that should contain the bean name as an attribute- 返回:
- the bean name (never
null) - 抛出:
IllegalStateException- if the bean name has not been exposed
-
createAdvisorWithoutIntroduction
Create a new advisor that will expose the given bean name, with no introduction.- 参数:
beanName- bean name to expose
-
createAdvisorIntroducingNamedBean
Create a new advisor that will expose the given bean name, introducing the NamedBean interface to make the bean name accessible without forcing the target object to be aware of this IoC concept.- 参数:
beanName- the bean name to expose
-