Exposes contextual information about the intercepted invocation and operations that enable interceptor methods to control the behavior of the invocation chain.
@AroundInvoke
public Object logInvocation(InvocationContext ctx) throws Exception {
String class = ctx.getMethod().getDeclaringClass().getName();
String method = ctx.getMethod().getName();
Logger.global.entering(class, method, ctx.getParameters());
try {
Object result = ctx.proceed();
Logger.global.exiting(class, method, result);
return result;
}
catch (Exception e) {
Logger.global.throwing(class, method, e);
throw e;
}
}
| Modifier and Type | Method and Description |
|---|---|
| public Constructor | Returns: the constructor, or a null valueReturns the constructor of the target class for which the
|
| public Map | Returns: the context data associated with this invocation or lifecycle callback. If there is no context data, an emptyMap<String,Object> object will be returned.Enables an interceptor to retrieve or update the data associated with the invocation by another interceptor, business method, and/or webservices endpoint in the invocation chain. |
| public Method | Returns: the method, or a null valueReturns the method of the target class for which the interceptor was invoked. |
| public Object[] | Returns: the parameter values, as an arrayReturns the parameter values that will be passed to the method or constructor of the target class. |
| public Object | |
| public Object | Returns: the timer object or a null valueReturns the timer object associated with a timeout
method invocation on the target class, or a null value for
interceptor method types other than |
| public Object | Returns: the return value of the next method in the chainProceed to the next interceptor in the interceptor chain. |
| public void | setParameters(Object[]
the parameter values, as an array params)Sets the parameter values that will be passed to the method or constructor of the target class. |
| getConstructor | back to summary |
|---|---|
| public Constructor Returns the constructor of the target class for which the
| |
| getContextData | back to summary |
|---|---|
| public Map Enables an interceptor to retrieve or update the data associated with
the invocation by another interceptor, business method, and/or
webservices endpoint in the invocation chain. If interceptors
are invoked as a result of the invocation on a web service endpoint,
the returned value will be an instance of | |
| getMethod | back to summary |
|---|---|
| public Method getMethod() Returns the method of the target class for which the interceptor
was invoked. Returns null in a lifecycle callback interceptor
for which there is no corresponding lifecycle callback method
declared in the target class (or inherited from a superclass)
or in an
| |
| getParameters | back to summary |
|---|---|
| public Object[] getParameters() Returns the parameter values that will be passed to the method or
constructor of the target class. If
| |
| getTarget | back to summary |
|---|---|
| public Object getTarget() Returns the target instance. For
| |
| getTimer | back to summary |
|---|---|
| public Object getTimer() Returns the timer object associated with a timeout
method invocation on the target class, or a null value for
interceptor method types other than
| |
| proceed | back to summary |
|---|---|
| public Object proceed() throws Exception Proceed to the next interceptor in the interceptor chain. For
around-invoke or around-timeout interceptor methods, the invocation of
Return the result of the next method invoked, or a null value if the method has return type void.
| |
| setParameters | back to summary |
|---|---|
| public void setParameters(Object[] params) Sets the parameter values that will be passed to the method or constructor of the target class.
| |