org.springframework.aop.IntroductionInterceptor interface.
This differs from DelegatingIntroductionInterceptor in that a single
instance of this class can be used to advise multiple target objects, and each target
object will have its own delegate (whereas DelegatingIntroductionInterceptor
shares the same delegate, and hence the same state across all targets).
The suppressInterface method can be used to suppress interfaces
implemented by the delegate class but which should not be introduced to the
owning AOP proxy.
An instance of this class is serializable if the delegates are.
Note
There are some implementation similarities between this class and
DelegatingIntroductionInterceptor that suggest a possible refactoring
to extract a common ancestor class in the future.
suppressInterface, DelegatingIntroductionInterceptor
| Modifier and Type | Field and Description |
|---|---|
| private final Class | |
| private final Map | delegateMap
Hold weak references to keys as we don't want to interfere with garbage collection.. |
| private final Class |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private Object | |
| protected Object | doProceed(MethodInvocation mi)
Proceed with the supplied |
| private Object | |
| public Object | invoke(MethodInvocation
the method invocation joinpoint mi)Implements org. |
| defaultImplType | back to summary |
|---|---|
| private final Class<?> defaultImplType | |
| delegateMap | back to summary |
|---|---|
| private final Map<Object, Object> delegateMap Hold weak references to keys as we don't want to interfere with garbage collection.. | |
| interfaceType | back to summary |
|---|---|
| private final Class<?> interfaceType | |
| DelegatePerTargetObjectIntroductionInterceptor | back to summary |
|---|---|
| public DelegatePerTargetObjectIntroductionInterceptor(Class<?> defaultImplType, Class<?> interfaceType) | |
| createNewDelegate | back to summary |
|---|---|
| private Object createNewDelegate() | |
| doProceed | back to summary |
|---|---|
| protected Object doProceed(MethodInvocation mi) throws Throwable Proceed with the supplied
| |
| getIntroductionDelegateFor | back to summary |
|---|---|
| private Object getIntroductionDelegateFor(Object targetObject) | |
| invoke | back to summary |
|---|---|
| public Object invoke(MethodInvocation mi) throws Throwable Implements 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.
| |