Class RemoteInvocationTraceInterceptor

  • java.lang.Object
  • All Implemented Interfaces:
    Advice, Interceptor, MethodInterceptor

    public class RemoteInvocationTraceInterceptor
    extends java.lang.Object
    implements 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).

    Juergen Hoeller
    See Also:
    RemoteExporter.setRegisterTraceInterceptor(boolean), RemoteExporter.getProxyForService()
    • Field Summary

      Modifier and Type Field and Description
      protected static Log logger 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Object invoke(MethodInvocation invocation)
      Implement this method to perform extra treatments before and after the invocation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        protected static final Log logger
    • Constructor Detail

      • RemoteInvocationTraceInterceptor

        public RemoteInvocationTraceInterceptor()
        Create a new RemoteInvocationTraceInterceptor.
      • RemoteInvocationTraceInterceptor

        public RemoteInvocationTraceInterceptor(java.lang.String exporterName)
        Create a new RemoteInvocationTraceInterceptor.
        exporterName - the name of the remote exporter (to be used as context information in log messages)
    • Method Detail

      • invoke

        public java.lang.Object invoke(MethodInvocation invocation)
                                throws java.lang.Throwable
        Description copied from interface: MethodInterceptor
        Implement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invoke Joinpoint.proceed().
        Specified by:
        invoke in interface MethodInterceptor
        invocation - the method invocation joinpoint
        the result of the call to Joinpoint.proceed(); might be intercepted by the interceptor
        java.lang.Throwable - if the interceptors or the target object throws an exception