AdvisedSubclass mixin

The Advised members of a generated subclass proxy, the bean itself: its members call super directly until advice is attached by setting aopInvoker.

Generated code mixes it in, so each proxy class declares only its constructor and the bean's members. Applications never use it.

// The shape of a generated subclass proxy.
class _$CounterProxy extends Counter with AdvisedSubclass {
  @override
  int next() {
    final ProxyInvoker? _$invoker = this.aopInvoker;
    return _$invoker == null
        ? super.next()
        : _$invoker.invoke(
            proxy: this,
            target: this,
            methodIndex: 0,
            arguments: const [],
            original: (args) => super.next(),
          ) as int;
  }
}

Spring (Java): a CGLIB proxy, whose Advised methods its AdvisedSupport callbacks implement.

Implemented types

Properties

aopAdvisors → List<PointcutAdvisor>
The advisors that apply to this proxy, outermost first; empty for a subclass proxy no advice matched.
no setteroverride
aopInvoker ↔ ProxyInvoker?
The invoker the auto proxy creator attaches when advice matches the bean; null before (or when none does), and the members then call super directly.
getter/setter pair
aopTarget → Object
The bean behind the proxy; the proxy itself for a generated subclass proxy.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAdvice(MethodInterceptor advice) → void
Appends advice as the innermost advice of every member, wrapped in a DefaultPointcutAdvisor with a TruePointcut (as Spring's addAdvice does). Throws like addAdvisor.
override
addAdvisor(PointcutAdvisor advisor) → void
Appends advisor as the innermost one; the next calls of the members its pointcut matches run it.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAdvice(MethodInterceptor advice) → bool
Removes the first advisor whose advice is advice (the same object); returns false when there is none.
override
removeAdvisor(PointcutAdvisor advisor) → bool
Removes advisor; returns false when it was not there.
override
toString() → String
A string representation of this object.
inherited

Operators

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