public interface MethodInvocation extends MethodInvocationResult, AnnotationAccess
MethodAdvice
Modifier and Type | Method and Description |
---|---|
Object |
getInstance()
The instance on which the method was originally invoked.
|
InstanceContext |
getInstanceContext() |
Method |
getMethod()
Returns the method being invoked.
|
Object |
getParameter(int index)
Returns the parameter at the given index.
|
MethodInvocation |
proceed()
Proceed with the method invocation, either chaining into the next
MethodAdvice added to the method, or
ultimately into the actual method implementation. |
MethodInvocation |
setCheckedException(Exception exception)
Sets the checked exception; this can be used to indicate failure for the method, or
to cancel the thrown exception (by setting the exception to null).
|
MethodInvocation |
setParameter(int index,
Object newValue)
Changes a parameter value.
|
MethodInvocation |
setReturnValue(Object returnValue)
Overrides the return value of the method.
|
didThrowCheckedException, getCheckedException, getReturnValue, rethrow
getAnnotation, hasAnnotation
Object getInstance()
InstanceContext getInstanceContext()
MethodInvocation proceed()
MethodAdvice
added to the method, or
ultimately into the actual method implementation. The method may throw a checked exception, which will be caught
and be reported as MethodInvocationResult.didThrowCheckedException()
.MethodInvocation setReturnValue(Object returnValue)
returnValue
- NullPointerException
- if the method's return type is a primitive and null is providedObject getParameter(int index)
index
- of parameter to accessMethodInvocation setParameter(int index, Object newValue)
index
- index of parameter to modifynewValue
- new value for parameterMethodInvocation setCheckedException(Exception exception)
exception
- new checked exception, or null${project.version} - Copyright © 2003-2015 The Apache Software Foundation.