spring-framework / org.springframework.aop.interceptor / ExposeBeanNameAdvisors

ExposeBeanNameAdvisors

abstract class ExposeBeanNameAdvisors

Convenient methods for creating advisors that may be used when autoproxying beans created with the Spring IoC container, binding the bean name to the current invocation. May support a bean() pointcut designator with AspectJ.

Typically used in Spring auto-proxying, where the bean name is known at proxy creation time.

Author
Rod Johnson

Author
Juergen Hoeller

Since
2.0

See Also
org.springframework.beans.factory.NamedBean

Constructors

<init>

ExposeBeanNameAdvisors()

Convenient methods for creating advisors that may be used when autoproxying beans created with the Spring IoC container, binding the bean name to the current invocation. May support a bean() pointcut designator with AspectJ.

Typically used in Spring auto-proxying, where the bean name is known at proxy creation time.

Functions

createAdvisorIntroducingNamedBean

open static fun createAdvisorIntroducingNamedBean(beanName: String): Advisor

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 Spring IoC concept.

createAdvisorWithoutIntroduction

open static fun createAdvisorWithoutIntroduction(beanName: String): Advisor

Create a new advisor that will expose the given bean name, with no introduction

getBeanName

open static fun getBeanName(): String

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.

open static fun getBeanName(mi: MethodInvocation): String

Find the bean name for the given invocation. Assumes that an ExposeBeanNameAdvisor has been included in the interceptor chain.