public class

SimpleTraceInterceptor

extends AbstractTraceInterceptor
java.lang.Object
   ↳ org.springframework.aop.interceptor.AbstractTraceInterceptor
     ↳ org.springframework.aop.interceptor.SimpleTraceInterceptor
Known Direct Subclasses

Class Overview

Simple AOP Alliance MethodInterceptor that can be introduced in a chain to display verbose trace information about intercepted method invocations, with method entry and method exit info.

Consider using CustomizableTraceInterceptor for more advanced needs.

Summary

[Expand]
Inherited Fields
From class org.springframework.aop.interceptor.AbstractTraceInterceptor
Public Constructors
SimpleTraceInterceptor()
Create a new SimpleTraceInterceptor with a static logger.
SimpleTraceInterceptor(boolean useDynamicLogger)
Create a new SimpleTraceInterceptor with dynamic or static logger, according to the given flag.
Protected Methods
String getInvocationDescription(MethodInvocation invocation)
Return a description for the given method invocation.
Object invokeUnderTrace(MethodInvocation invocation, Log logger)
Subclasses must override this method to perform any tracing around the supplied MethodInvocation.
[Expand]
Inherited Methods
From class org.springframework.aop.interceptor.AbstractTraceInterceptor
From class java.lang.Object

Public Constructors

public SimpleTraceInterceptor ()

Create a new SimpleTraceInterceptor with a static logger.

public SimpleTraceInterceptor (boolean useDynamicLogger)

Create a new SimpleTraceInterceptor with dynamic or static logger, according to the given flag.

Parameters
useDynamicLogger whether to use a dynamic logger or a static logger

Protected Methods

protected String getInvocationDescription (MethodInvocation invocation)

Return a description for the given method invocation.

Parameters
invocation the invocation to describe
Returns
  • the description

protected Object invokeUnderTrace (MethodInvocation invocation, Log logger)

Subclasses must override this method to perform any tracing around the supplied MethodInvocation. Subclasses are responsible for ensuring that the MethodInvocation actually executes by calling MethodInvocation.proceed().

By default, the passed-in Log instance will have log level "trace" enabled. Subclasses do not have to check for this again, unless they overwrite the isInterceptorEnabled method to modify the default behavior.

Parameters
logger the Log to write trace messages to
Returns
  • the result of the call to MethodInvocation.proceed()
Throws
Throwable