@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 default <T extends Annotation> T | Returns: the interceptor binding annotation of given type, may benulltype of the interceptor binding annotation, must not be annotationType)nullReturns the single annotation of given type present in the full set of interceptor binding annotations. |
| public default Set | Returns: immutable set of interceptor binding annotations, nevernullReturns the set of interceptor binding annotations for the method or constructor whose invocation is being intercepted. |
| public default <T extends Annotation> Set | Returns: immutable set of interceptor binding annotations of given type, nevernulltype of the interceptor binding annotations, must not be annotationType)nullReturns all annotations of given type present in the full set of interceptor binding annotations. |
| 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. | |
| getInterceptorBinding | back to summary |
|---|---|
| public default <T extends Annotation> T getInterceptorBinding(Class<T> annotationType) Returns the single annotation of given type present in the full set of interceptor binding annotations.
Returns
In case of repeatable interceptor binding
annotations,
| |
| getInterceptorBindings | back to summary |
|---|---|
| public default Set Returns the set of interceptor binding annotations for the method or constructor whose invocation is being intercepted. In case there is no target method or target constructor, interceptor binding annotations applied to the target class are returned. All interceptor binding annotations are returned, including inherited interceptor binding annotations, transitive interceptor binding annotations, interceptor binding annotations that associate interceptors of a different interceptor method type, as well as interceptor binding annotations that associate no interceptor.
Returns an empty set if no interceptor binding annotation is applied and all interceptors
were associated using the
| |
| getInterceptorBindings | back to summary |
|---|---|
| public default <T extends Annotation> Set Returns all annotations of given type present in the full set of interceptor binding annotations. Returns an empty set if the full set of interceptor binding annotations does not contain any annotation of given type. | |
| 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.
| |