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;
nullbefore (or when none does), and the members then callsuperdirectly.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
adviceas the innermost advice of every member, wrapped in aDefaultPointcutAdvisorwith aTruePointcut(as Spring'saddAdvicedoes). Throws like addAdvisor.override -
addAdvisor(
PointcutAdvisor advisor) → void -
Appends
advisoras 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); returnsfalsewhen there is none.override -
removeAdvisor(
PointcutAdvisor advisor) → bool -
Removes
advisor; returnsfalsewhen it was not there.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited