类 DelegatingIntroductionInterceptor
java.lang.Object
infra.aop.support.IntroductionInfoSupport
infra.aop.support.DelegatingIntroductionInterceptor
- 所有已实现的接口:
DynamicIntroductionAdvice,IntroductionInfo,IntroductionInterceptor,Serializable,Advice,Interceptor,MethodInterceptor
public class DelegatingIntroductionInterceptor
extends IntroductionInfoSupport
implements IntroductionInterceptor
Convenient implementation of the
IntroductionInterceptor interface.
Subclasses merely need to extend this class and implement the interfaces to be introduced themselves. In this case the delegate is the subclass instance itself. Alternatively a separate delegate may implement the interface, and be set via the delegate bean property.
Delegates or subclasses may implement any number of interfaces. All interfaces except IntroductionInterceptor are picked up from the subclass or delegate by default.
The suppressInterface method can be used to suppress interfaces
implemented by the delegate but which should not be introduced to the owning
AOP proxy.
An instance of this class is serializable if the delegate is.
- 从以下版本开始:
- 3.0
- 作者:
- Rod Johnson, Juergen Hoeller, TODAY 2021/3/8 22:20
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private ObjectObject that actually implements the interfaces.private static final long从类继承的字段 infra.aop.support.IntroductionInfoSupport
publishedInterfaces -
构造器概要
构造器限定符构造器说明protectedConstruct a new DelegatingIntroductionInterceptor.DelegatingIntroductionInterceptor(Object delegate) Construct a new DelegatingIntroductionInterceptor, providing a delegate that implements the interfaces to be introduced. -
方法概要
修饰符和类型方法说明protected ObjectProceed with the suppliedMethodInterceptor.private voidBoth constructors use this init method, as it is impossible to pass a "this" reference from one constructor to another.Subclasses may need to override this if they want to perform custom behaviour in around advice.从类继承的方法 infra.aop.support.IntroductionInfoSupport
getInterfaces, implementInterfacesOnObject, implementsInterface, isMethodOnIntroducedInterface, suppressInterface从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 infra.aop.DynamicIntroductionAdvice
implementsInterface
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
delegate
Object that actually implements the interfaces. May be "this" if a subclass implements the introduced interfaces.
-
-
构造器详细资料
-
DelegatingIntroductionInterceptor
Construct a new DelegatingIntroductionInterceptor, providing a delegate that implements the interfaces to be introduced.- 参数:
delegate- the delegate that implements the introduced interfaces
-
DelegatingIntroductionInterceptor
protected DelegatingIntroductionInterceptor()Construct a new DelegatingIntroductionInterceptor. The delegate will be the subclass, which must implement additional interfaces.
-
-
方法详细资料
-
init
Both constructors use this init method, as it is impossible to pass a "this" reference from one constructor to another.- 参数:
delegate- the delegate object
-
invoke
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.- 指定者:
invoke在接口中MethodInterceptor- 参数:
mi- the method invocation joinpoint- 返回:
- the result of the call to
Joinpoint.proceed(), might be intercepted by the interceptor. - 抛出:
Throwable- if the interceptors or the target-object throws an exception.
-
doProceed
Proceed with the suppliedMethodInterceptor. 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 forMethodInvocationson the introduced interfaces.- 抛出:
Throwable
-