DefaultPointcutAdvisor class final

The standard PointcutAdvisor: a pointcut, an interceptor and an order.

Create one in a @Bean method to advise beans without an @Aspect. When several advisors and aspects apply to one call, the lower order is the outer one (it runs first on the way in, last on the way out). The default is Ordered.lowestPrecedence, so it runs inside ordered aspects. Set it here: since the advisor implements Ordered, an @Order on its @Bean method is ignored, as in Spring.

// Times every method marked @Timed(), outside advice of order > 10.
@Bean()
PointcutAdvisor timingAdvisor() => DefaultPointcutAdvisor(
  const AnnotationMatchingPointcut<Timed>(),
  TimingInterceptor(),
  order: 10,
);

Spring (Java):

@Bean
Advisor timingAdvisor() {
  DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(
      AnnotationMatchingPointcut.forMethodAnnotation(Timed.class),
      new TimingInterceptor());
  advisor.setOrder(10);
  return advisor;
}
Implemented types

Constructors

DefaultPointcutAdvisor(AopPointcut pointcut, MethodInterceptor advice, {int order = Ordered.lowestPrecedence})
Runs advice around calls of the members pointcut matches, at order (default Ordered.lowestPrecedence, the innermost).

Properties

advice → MethodInterceptor
The interceptor that runs around each advised call.
final
hashCode → int
The hash code for this object.
no setterinherited
order → int
Where this object goes: lower values come first. Values are usually small numbers, or offsets from highestPrecedence and lowestPrecedence.
final
pointcut → AopPointcut
Decides which members of which beans advice runs for.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited