public class RemoteInvocationTraceInterceptor extends java.lang.Object implements MethodInterceptor
Logs an incoming remote call as well as the finished processing of a remote call at DEBUG level. If the processing of a remote call results in a checked exception, the exception will get logged at INFO level; if it results in an unchecked exception (or error), the exception will get logged at WARN level.
The logging of exceptions is particularly useful to save the stacktrace information on the server-side rather than just propagating the exception to the client (who might or might not log it properly).
RemoteExporter.setRegisterTraceInterceptor(boolean)
,
RemoteExporter.getProxyForService()
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
exporterNameClause |
protected static Log |
logger |
Constructor and Description |
---|
RemoteInvocationTraceInterceptor()
Create a new RemoteInvocationTraceInterceptor.
|
RemoteInvocationTraceInterceptor(java.lang.String exporterName)
Create a new RemoteInvocationTraceInterceptor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
invoke(MethodInvocation invocation)
Implement this method to perform extra treatments before and
after the invocation.
|
protected static final Log logger
private final java.lang.String exporterNameClause
public RemoteInvocationTraceInterceptor()
public RemoteInvocationTraceInterceptor(java.lang.String exporterName)
exporterName
- the name of the remote exporter
(to be used as context information in log messages)public java.lang.Object invoke(MethodInvocation invocation) throws java.lang.Throwable
MethodInterceptor
Joinpoint.proceed()
.invoke
in interface MethodInterceptor
invocation
- the method invocation joinpointjava.lang.Throwable
- if the interceptors or the target object
throws an exception