A piece of advice packaged as an object: the MethodInterceptor to run around calls of other beans.
Advisors are the form all advice takes at runtime: the container turns
each @Aspect advice method into one, and any bean that is an advisor
is applied too. Applications rarely implement this interface; they
write an @Aspect, or declare a PointcutAdvisor bean (usually a
DefaultPointcutAdvisor) to say which members the advice is for. An
advisor bean that is not a PointcutAdvisor applies to every member of
every proxied bean. Advisor beans are never proxied themselves.
// Logs every call of every proxied bean.
@Configuration()
class AopConfig {
@Bean()
Advisor logging() =>
DefaultPointcutAdvisor(const TruePointcut(), LoggingInterceptor());
}
Spring (Java):
@Bean
Advisor logging() {
return new DefaultPointcutAdvisor(
Pointcut.TRUE, new LoggingInterceptor());
}
Properties
- advice → MethodInterceptor
-
The interceptor that runs around each advised call.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited