org.springframework.aop.support
Class DelegatingIntroductionInterceptor


public class DelegatingIntroductionInterceptor
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.

Author:
Rod Johnson
Version: $Id: DelegatingIntroductionInterceptor.java,v 1.1 2003/11/16 12:54:58 johnsonr Exp $

Constructor Summary
DelegatingIntroductionInterceptor(Object delegate)
          Construct a new DelegatingIntroductionInterceptor, providing a delegate that implements the interfaces to be introduced.

Method Summary
 Class[]getIntroducedInterfaces()
           
 booleanimplementsInterface(Class intf)
           
 Objectinvoke(MethodInvocation mi)
          Subclasses may need to override this if they want to perform custom behaviour in around advice.
 voidsuppressInterface(Class intf)
          Suppress the specified interface, which will have been autodetected due to its implementation by the delegate.

Constructor Detail

DelegatingIntroductionInterceptor

public DelegatingIntroductionInterceptor(Object delegate)
Construct a new DelegatingIntroductionInterceptor, providing a delegate that implements the interfaces to be introduced.
Parameters:
delegate - the delegate that implements the introduced interfaces
Method Detail

getIntroducedInterfaces

public Class[] getIntroducedInterfaces()

implementsInterface

public boolean implementsInterface(Class intf)
See Also:
org.springframework.aop.IntroductionInterceptor.implementsInterface(java.lang.Class)

invoke

public Object invoke(MethodInvocation mi)
throws java.lang.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.

suppressInterface

public void suppressInterface(Class intf)
Suppress the specified interface, which will have been autodetected due to its implementation by the delegate. Does nothing if it's not implemented by the delegate
Parameters:
intf - interface to suppress

Association Links

to Class java.util.Set

Set of Class