@Documented @Retention(value=RUNTIME) @Target(value=METHOD) public static @interface Advice.OnMethodExit
Indicates that this method should be executed before exiting the instrumented method. Any class must declare at most one method with this annotation. The annotated method must be static.
By default, the annotated method is not invoked if the instrumented method terminates exceptionally. This behavior
can be changed by setting the onThrowable()
property to an exception type for which this advice
method should be invoked. By setting the value to Throwable
, the advice method is always invoked.
Advice
,
Advice.Argument
,
Advice.This
,
Advice.Enter
,
Advice.Return
,
Advice.Thrown
Modifier and Type | Optional Element and Description |
---|---|
boolean |
inline
Determines if the annotated method should be inlined into the instrumented method or invoked from it.
|
Class<? extends Throwable> |
onThrowable
Indicates a
Throwable super type for which this exit advice is invoked if it was thrown from the instrumented method. |
Class<? extends Throwable> |
suppress
Indicates that this advice should suppress any
Throwable type being thrown during the advice's execution. |
public abstract Class<? extends Throwable> onThrowable
Throwable
super type for which this exit advice is invoked if it was thrown from the instrumented method.
If an exception is thrown, it is available via the Advice.Thrown
parameter annotation. If a method returns exceptionally,
any parameter annotated with Advice.Return
is assigned the parameter type's default value.Throwable
for which this exit advice handler is invoked.public abstract boolean inline
true
if the annotated method should be inlined into the instrumented method.public abstract Class<? extends Throwable> suppress
Throwable
type being thrown during the advice's execution. By default,
any such exception is silently suppressed. Custom behavior can be configured by using Advice.withExceptionHandler(StackManipulation)
.Throwable
to suppress.Advice.withExceptionPrinting()
Copyright © 2014–2017. All rights reserved.