public class

DefaultIntroductionAdvisor

extends Object
implements Serializable ClassFilter IntroductionAdvisor Ordered
java.lang.Object
   ↳ org.springframework.aop.support.DefaultIntroductionAdvisor

Class Overview

Simple IntroductionAdvisor implementation that by default applies to any class.

Summary

[Expand]
Inherited Constants
From interface org.springframework.core.Ordered
[Expand]
Inherited Fields
From interface org.springframework.aop.ClassFilter
Public Constructors
DefaultIntroductionAdvisor(Advice advice)
Create a DefaultIntroductionAdvisor for the given advice.
DefaultIntroductionAdvisor(Advice advice, IntroductionInfo introductionInfo)
Create a DefaultIntroductionAdvisor for the given advice.
DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice, Class intf)
Create a DefaultIntroductionAdvisor for the given advice.
Public Methods
void addInterface(Class intf)
Add the specified interface to the list of interfaces to introduce.
boolean equals(Object other)
Advice getAdvice()
Return the advice part of this aspect.
ClassFilter getClassFilter()
Return the filter determining which target classes this introduction should apply to.
Class[] getInterfaces()
Return the additional interfaces introduced by this Advisor or Advice.
int getOrder()
Return the order value of this object, with a higher value meaning greater in terms of sorting.
int hashCode()
boolean isPerInstance()
Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.
boolean matches(Class clazz)
void setOrder(int order)
String toString()
void validateInterfaces()
Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.aop.Advisor
From interface org.springframework.aop.ClassFilter
From interface org.springframework.aop.IntroductionAdvisor
From interface org.springframework.aop.IntroductionInfo
From interface org.springframework.core.Ordered

Public Constructors

public DefaultIntroductionAdvisor (Advice advice)

Create a DefaultIntroductionAdvisor for the given advice.

Parameters
advice the Advice to apply (may implement the IntroductionInfo interface)

public DefaultIntroductionAdvisor (Advice advice, IntroductionInfo introductionInfo)

Create a DefaultIntroductionAdvisor for the given advice.

Parameters
advice the Advice to apply
introductionInfo the IntroductionInfo that describes the interface to introduce (may be null)

public DefaultIntroductionAdvisor (DynamicIntroductionAdvice advice, Class intf)

Create a DefaultIntroductionAdvisor for the given advice.

Parameters
advice the Advice to apply
intf the interface to introduce

Public Methods

public void addInterface (Class intf)

Add the specified interface to the list of interfaces to introduce.

Parameters
intf the interface to introduce

public boolean equals (Object other)

public Advice getAdvice ()

Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Returns
  • the advice that should apply if the pointcut matches

public ClassFilter getClassFilter ()

Return the filter determining which target classes this introduction should apply to.

This represents the class part of a pointcut. Note that method matching doesn't make sense to introductions.

Returns
  • the class filter

public Class[] getInterfaces ()

Return the additional interfaces introduced by this Advisor or Advice.

Returns
  • the introduced interfaces

public int getOrder ()

Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Returns
  • the order value

public int hashCode ()

public boolean isPerInstance ()

Return whether this advice is associated with a particular instance (for example, creating a mixin) or shared with all instances of the advised class obtained from the same Spring bean factory.

Note that this method is not currently used by the framework. Typical Advisor implementations always return true. Use singleton/prototype bean definitions or appropriate programmatic proxy creation to ensure that Advisors have the correct lifecycle model.

Returns
  • whether this advice is associated with a particular target instance

public boolean matches (Class clazz)

public void setOrder (int order)

public String toString ()

public void validateInterfaces ()

Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.