bean() pointcut designator with AspectJ.
Typically used in Spring auto-proxying, where the bean name is known at proxy creation time.
org.springframework.beans.factory.NamedBean
| Modifier and Type | Class and Description |
|---|---|
| private static class | ExposeBeanNameAdvisors.ExposeBeanNameInterceptor
Interceptor that exposes the specified bean name as invocation attribute. |
| private static class | ExposeBeanNameAdvisors.ExposeBeanNameIntroduction
Introduction that exposes the specified bean name as invocation attribute. |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | BEAN_NAME_ATTRIBUTE
Binding for the bean name of the bean which is currently being invoked in the ReflectiveMethodInvocation userAttributes Map. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Advisor | createAdvisorIntroducingNamedBean(String
the bean name to expose 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 Spring IoC concept. |
| public static Advisor | createAdvisorWithoutIntroduction(String
bean name to expose beanName)Create a new advisor that will expose the given bean name, with no introduction. |
| public static String | |
| public static String | Returns: the bean name (nevernull)the MethodInvocation that should contain the bean name as an attribute mi)Find the bean name for the given invocation. |
| BEAN_NAME_ATTRIBUTE | back to summary |
|---|---|
| private static final String BEAN_NAME_ATTRIBUTE Binding for the bean name of the bean which is currently being invoked in the ReflectiveMethodInvocation userAttributes Map. | |
| ExposeBeanNameAdvisors | back to summary |
|---|---|
| public ExposeBeanNameAdvisors() | |
| createAdvisorIntroducingNamedBean | back to summary |
|---|---|
| public static Advisor createAdvisorIntroducingNamedBean(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 Spring IoC concept.
| |
| createAdvisorWithoutIntroduction | back to summary |
|---|---|
| public static Advisor createAdvisorWithoutIntroduction(String beanName) Create a new advisor that will expose the given bean name, with no introduction.
| |
| getBeanName | back to summary |
|---|---|
| public static String getBeanName() throws IllegalStateException 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.
| |
| getBeanName | back to summary |
|---|---|
| public static String getBeanName(MethodInvocation mi) throws IllegalStateException Find the bean name for the given invocation. Assumes that an ExposeBeanNameAdvisor has been included in the interceptor chain.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | invoke(MethodInvocation
the method invocation joinpoint mi)Implements org. |
| beanName | back to summary |
|---|---|
| private final String beanName | |
| ExposeBeanNameInterceptor | back to summary |
|---|---|
| public ExposeBeanNameInterceptor(String beanName) | |
| invoke | back to summary |
|---|---|
| public Object invoke(MethodInvocation mi) throws Throwable Implements org. Doc from org. Implement this method to perform extra treatments before and
after the invocation. Polite implementations would certainly
like to invoke
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | getBeanName()
Implements org. |
| public Object | invoke(MethodInvocation
the method invocation joinpoint mi)Overrides org. Implements org. |
| beanName | back to summary |
|---|---|
| private final String beanName | |
| ExposeBeanNameIntroduction | back to summary |
|---|---|
| public ExposeBeanNameIntroduction(String beanName) | |
| getBeanName | back to summary |
|---|---|
| public String getBeanName() Implements org. Doc from org. Return the name of this bean in a Spring bean factory, if known.
| |
| invoke | back to summary |
|---|---|
| public Object invoke(MethodInvocation mi) throws Throwable Overrides org. Implements org. Doc from org. Subclasses may need to override this if they want to perform custom behaviour in around advice. However, subclasses should invoke this method, which handles introduced interfaces and forwarding to the target.
| |