public class

DebugInterceptor

extends SimpleTraceInterceptor
java.lang.Object
   ↳ org.springframework.aop.interceptor.AbstractTraceInterceptor
     ↳ org.springframework.aop.interceptor.SimpleTraceInterceptor
       ↳ org.springframework.aop.interceptor.DebugInterceptor

Class Overview

AOP Alliance MethodInterceptor that can be introduced in a chain to display verbose information about intercepted invocations to the logger.

Logs full invocation details on method entry and method exit, including invocation arguments and invocation count. This is only intended for debugging purposes; use SimpleTraceInterceptor or CustomizableTraceInterceptor for pure tracing purposes.

Summary

[Expand]
Inherited Fields
From class org.springframework.aop.interceptor.AbstractTraceInterceptor
Public Constructors
DebugInterceptor()
Create a new DebugInterceptor with a static logger.
DebugInterceptor(boolean useDynamicLogger)
Create a new DebugInterceptor with dynamic or static logger, according to the given flag.
Public Methods
long getCount()
Return the number of times this interceptor has been invoked.
Object invoke(MethodInvocation invocation)
Determines whether or not logging is enabled for the particular MethodInvocation.
synchronized void resetCount()
Reset the invocation count to zero.
Protected Methods
String getInvocationDescription(MethodInvocation invocation)
Return a description for the given method invocation.
[Expand]
Inherited Methods
From class org.springframework.aop.interceptor.SimpleTraceInterceptor
From class org.springframework.aop.interceptor.AbstractTraceInterceptor
From class java.lang.Object

Public Constructors

public DebugInterceptor ()

Create a new DebugInterceptor with a static logger.

public DebugInterceptor (boolean useDynamicLogger)

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

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

Public Methods

public long getCount ()

Return the number of times this interceptor has been invoked.

public Object invoke (MethodInvocation invocation)

Determines whether or not logging is enabled for the particular MethodInvocation. If not, the method invocation proceeds as normal, otherwise the method invocation is passed to the invokeUnderTrace method for handling.

Throws
Throwable

public synchronized void resetCount ()

Reset the invocation count to zero.

Protected Methods

protected String getInvocationDescription (MethodInvocation invocation)

Return a description for the given method invocation.

Parameters
invocation the invocation to describe
Returns
  • the description