One intercepted call, as advice sees it: which member is called, on which bean, with which arguments.
Advice methods receive it when they declare a parameter of this type;
@Before, @After, @AfterReturning and @AfterThrowing advice may,
@Around advice takes a ProceedingJoinPoint instead. Use it to log
the call, to name a metric after the member, or to read the member's
annotations through signature. Its args are a copy: changing them
does not change the call.
// Logs each call to the `calculator` bean with its arguments.
@Before('bean(calculator)')
void before(JoinPoint joinPoint) =>
log.info('${joinPoint.toShortString()} with ${joinPoint.args}');
Spring (Java):
@Before("bean(calculator)")
void before(JoinPoint joinPoint) {
log.info(joinPoint.toShortString() + " with "
+ Arrays.toString(joinPoint.getArgs()));
}
Properties
-
args
→ List<
Object?> -
The arguments in declaration order: positional ones, then named ones
(in the order of MethodSignature.parameterNames).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- proxy → Object
-
The proxy the caller called, the object other beans hold. For a
generated subclass proxy it is the bean itself, like target.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signature → MethodSignature
-
The called member: its name, types and annotations.
no setter
- target → Object
-
The bean whose member runs: the object behind the proxy.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toShortString(
) → String -
A short description for logs, such as
execution(Greeter.greet(..)). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited