org.springframework.remoting.support
public class: RemoteInvocationTraceInterceptor [javadoc |
source]
java.lang.Object
org.springframework.remoting.support.RemoteInvocationTraceInterceptor
All Implemented Interfaces:
org.aopalliance.intercept.MethodInterceptor
AOP Alliance MethodInterceptor for tracing remote invocations.
Automatically applied by RemoteExporter and its subclasses.
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).
Also see:
- RemoteExporter#setRegisterTraceInterceptor
- RemoteExporter#getProxyForService
- author:
Juergen - Hoeller
- since:
1.2 -
| Field Summary |
|---|
| protected static final Log | logger | |
| Method from org.springframework.remoting.support.RemoteInvocationTraceInterceptor Summary: |
|---|
|
invoke |
| Method from org.springframework.remoting.support.RemoteInvocationTraceInterceptor Detail: |
public Object invoke(MethodInvocation invocation) throws Throwable {
Method method = invocation.getMethod();
if (logger.isDebugEnabled()) {
logger.debug("Incoming " + this.exporterNameClause + "remote call: " +
ClassUtils.getQualifiedMethodName(method));
}
try {
Object retVal = invocation.proceed();
if (logger.isDebugEnabled()) {
logger.debug("Finished processing of " + this.exporterNameClause + "remote call: " +
ClassUtils.getQualifiedMethodName(method));
}
return retVal;
}
catch (Throwable ex) {
if (ex instanceof RuntimeException || ex instanceof Error) {
if (logger.isWarnEnabled()) {
logger.warn("Processing of " + this.exporterNameClause + "remote call resulted in fatal exception: " +
ClassUtils.getQualifiedMethodName(method), ex);
}
}
else {
if (logger.isInfoEnabled()) {
logger.info("Processing of " + this.exporterNameClause + "remote call resulted in exception: " +
ClassUtils.getQualifiedMethodName(method), ex);
}
}
throw ex;
}
}
|