org.springframework.aop.support
Class DelegatePerTargetObjectDelegatingIntroductionInterceptor
java.lang.Object
org.springframework.aop.support.IntroductionInfoSupport
org.springframework.aop.support.DelegatePerTargetObjectDelegatingIntroductionInterceptor
- All Implemented Interfaces:
- Serializable, org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, DynamicIntroductionAdvice, IntroductionInfo, IntroductionInterceptor
public class DelegatePerTargetObjectDelegatingIntroductionInterceptor
- extends IntroductionInfoSupport
- implements IntroductionInterceptor
Convenient implementation of the 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.
A DelegatePerTargetObjectDelegatingIntroductionInterceptor 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.
- Since:
- 2.0
- Author:
- Adrian Colyer
- See Also:
IntroductionInfoSupport.suppressInterface(java.lang.Class)
,
DelegatingIntroductionInterceptor
,
Serialized Form
Method Summary |
protected Object |
doProceed(org.aopalliance.intercept.MethodInvocation mi)
Proceed with the supplied MethodInterceptor . |
Object |
invoke(org.aopalliance.intercept.MethodInvocation mi)
Subclasses may need to override this if they want to perform custom
behaviour in around advice. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DelegatePerTargetObjectDelegatingIntroductionInterceptor
public DelegatePerTargetObjectDelegatingIntroductionInterceptor(Class defaultImplType,
Class interfaceType)
invoke
public Object invoke(org.aopalliance.intercept.MethodInvocation mi)
throws Throwable
- 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.
- Specified by:
invoke
in interface org.aopalliance.intercept.MethodInterceptor
- Throws:
Throwable
doProceed
protected Object doProceed(org.aopalliance.intercept.MethodInvocation mi)
throws Throwable
- Proceed with the supplied
MethodInterceptor
.
Subclasses can override this method to intercept method invocations on the
target object which is useful when an introduction needs to monitor the object
that it is introduced into. This method is never called for
MethodInvocations
on the introduced interfaces.
- Throws:
Throwable
Copyright © 2002-2006 The Spring Framework.