spring-framework / org.springframework.aop.support

Package org.springframework.aop.support

Types

AbstractExpressionPointcut

abstract class AbstractExpressionPointcut : ExpressionPointcut, Serializable

Abstract superclass for expression pointcuts, offering location and expression properties.

AbstractRegexpMethodPointcut

abstract class AbstractRegexpMethodPointcut : StaticMethodMatcherPointcut, Serializable

Abstract base regular expression pointcut bean. JavaBean properties are:

  • pattern: regular expression for the fully-qualified method names to match. The exact regexp syntax will depend on the subclass (e.g. Perl5 regular expressions)
  • patterns: alternative property taking a String array of patterns. The result will be the union of these patterns.

Note: the regular expressions must be a match. For example, .*get.* will match com.mycom.Foo.getBar(). get.* will not.

This base class is serializable. Subclasses should declare all fields transient; the #initPatternRepresentation method will be invoked again on deserialization.

AopUtils

abstract class AopUtils

Utility methods for AOP support code.

Mainly for internal use within Spring's AOP support.

See org.springframework.aop.framework.AopProxyUtils for a collection of framework-specific AOP utility methods which depend on internals of Spring's AOP framework implementation.

ClassFilters

abstract class ClassFilters

Static utility methods for composing ClassFilter.

ComposablePointcut

open class ComposablePointcut : Pointcut, Serializable

Convenient class for building up pointcuts. All methods return ComposablePointcut, so we can use a concise idiom like: Pointcut pc = new ComposablePointcut().union(classFilter).intersection(methodMatcher).intersection(pointcut);

ControlFlowPointcut

open class ControlFlowPointcut : Pointcut, ClassFilter, MethodMatcher, Serializable

Pointcut and method matcher for use in simple cflow-style pointcut. Note that evaluating such pointcuts is 10-15 times slower than evaluating normal pointcuts, but they are useful in some cases.

DefaultBeanFactoryPointcutAdvisor

open class DefaultBeanFactoryPointcutAdvisor : AbstractBeanFactoryPointcutAdvisor

Concrete BeanFactory-based PointcutAdvisor that allows for any Advice to be configured as reference to an Advice bean in the BeanFactory, as well as the Pointcut to be configured through a bean property.

Specifying the name of an advice bean instead of the advice object itself (if running within a BeanFactory) increases loose coupling at initialization time, in order to not initialize the advice object until the pointcut actually matches.

DefaultIntroductionAdvisor

open class DefaultIntroductionAdvisor : IntroductionAdvisor, ClassFilter, Ordered, Serializable

Simple org.springframework.aop.IntroductionAdvisor implementation that by default applies to any class.

DefaultPointcutAdvisor

open class DefaultPointcutAdvisor : AbstractGenericPointcutAdvisor, Serializable

Convenient Pointcut-driven Advisor implementation.

This is the most commonly used Advisor implementation. It can be used with any pointcut and advice type, except for introductions. There is normally no need to subclass this class, or to implement custom Advisors.

DelegatePerTargetObjectIntroductionInterceptor

open class DelegatePerTargetObjectIntroductionInterceptor : IntroductionInfoSupport, IntroductionInterceptor

Convenient implementation of the 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.

DelegatingIntroductionInterceptor

open class DelegatingIntroductionInterceptor : IntroductionInfoSupport, IntroductionInterceptor

Convenient implementation of the org.springframework.aop.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.

DynamicMethodMatcherPointcut

abstract class DynamicMethodMatcherPointcut : DynamicMethodMatcher, Pointcut

Convenient superclass when we want to force subclasses to implement MethodMatcher interface, but subclasses will want to be pointcuts. The getClassFilter() method can be overriden to customize ClassFilter behaviour as well.

ExpressionPointcut

interface ExpressionPointcut : Pointcut

Interface to be implemented by pointcuts that use String expressions.

JdkRegexpMethodPointcut

open class JdkRegexpMethodPointcut : AbstractRegexpMethodPointcut

Regular expression pointcut based on the java.util.regex package. Supports the following JavaBean properties:

  • pattern: regular expression for the fully-qualified method names to match
  • patterns: alternative property taking a String array of patterns. The result will be the union of these patterns.

Note: the regular expressions must be a match. For example, .*get.* will match com.mycom.Foo.getBar(). get.* will not.

MethodMatchers

abstract class MethodMatchers

Static utility methods for composing MethodMatcher.

A MethodMatcher may be evaluated statically (based on method and target class) or need further evaluation dynamically (based on arguments at the time of method invocation).

NameMatchMethodPointcut

open class NameMatchMethodPointcut : StaticMethodMatcherPointcut, Serializable

Pointcut bean for simple method name matches, as alternative to regexp patterns. Does not handle overloaded methods: all methods with a given name will be eligible.

NameMatchMethodPointcutAdvisor

open class NameMatchMethodPointcutAdvisor : AbstractGenericPointcutAdvisor

Convenient class for name-match method pointcuts that hold an Advice, making them an Advisor.

Pointcuts

abstract class Pointcuts

Pointcut constants for matching getters and setters, and static methods useful for manipulating and evaluating pointcuts. These methods are particularly useful for composing pointcuts using the union and intersection methods.

RegexpMethodPointcutAdvisor

open class RegexpMethodPointcutAdvisor : AbstractGenericPointcutAdvisor

Convenient class for regexp method pointcuts that hold an Advice, making them an org.springframework.aop.Advisor.

Configure this class using the "pattern" and "patterns" pass-through properties. These are analogous to the pattern and patterns properties of AbstractRegexpMethodPointcut.

Can delegate to any AbstractRegexpMethodPointcut subclass. By default, JdkRegexpMethodPointcut will be used. To choose a specific one, override the #createPointcut method.

RootClassFilter

open class RootClassFilter : ClassFilter, Serializable

Simple ClassFilter implementation that passes classes (and optionally subclasses)

StaticMethodMatcherPointcutAdvisor

abstract class StaticMethodMatcherPointcutAdvisor : StaticMethodMatcherPointcut, PointcutAdvisor, Ordered, Serializable

Convenient base class for Advisors that are also static pointcuts. Serializable if Advice and subclass are.