|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Invocation
A method invocation passed to a MethodAdvice.
| Method Summary | ||
|---|---|---|
java.lang.String |
getMethodName()
Returns the name of the method being invoked. |
|
java.lang.Object |
getParameter(int index)
Returns the indicated parameter (may return null if the parameter is null). |
|
int |
getParameterCount()
Returns the number of parameters passed to the method. |
|
java.lang.Class |
getParameterType(int index)
Returns the type of the parameter at the index. |
|
java.lang.Object |
getResult()
The return value after proceed(), which may be null. |
|
java.lang.Class |
getResultType()
Returns the type of the method result, which may be a primitive type (i.e., int.class) or even void (void.class). |
|
|
getThrown(java.lang.Class<T> throwableClass)
After invoking proceed(), used to obtain the thrown (checked) exception, if assignable to the provided
type. |
|
boolean |
isFail()
If true, then the proceeded invocation threw a checked exception. |
|
void |
override(int index,
java.lang.Object newParameter)
Replaces a parameter in the invocation. |
|
void |
overrideResult(java.lang.Object newResult)
Overrides the result. |
|
void |
overrideThrown(java.lang.Exception thrown)
Overrides the thrown exception. |
|
void |
proceed()
Proceed with the invocation of the advised method. |
|
void |
rethrow()
If the invocation failed (with a checked exception), then rethrow the exception wrapped in a RuntimeException. |
|
| Method Detail |
|---|
java.lang.String getMethodName()
java.lang.Class getResultType()
int getParameterCount()
java.lang.Class getParameterType(int index)
java.lang.Object getParameter(int index)
void override(int index,
java.lang.Object newParameter)
index - of parameter to updatenewParameter - new parameter value (may be null)void proceed()
isFail().
boolean isFail()
void rethrow()
<T extends java.lang.Throwable> T getThrown(java.lang.Class<T> throwableClass)
proceed(), used to obtain the thrown (checked) exception, if assignable to the provided
type.
throwableClass - the type of exception to match
void overrideThrown(java.lang.Exception thrown)
Errors, those can just be thrown. Sets the fail flag.
thrown -
java.lang.IllegalArgumentException - if thrown is null, or not a declared exception of the methodjava.lang.Object getResult()
proceed(), which may be null.
void overrideResult(java.lang.Object newResult)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||