类 SimpleTraceInterceptor
- java.lang.Object
- org.springframework.aop.interceptor.AbstractTraceInterceptor
- org.springframework.aop.interceptor.SimpleTraceInterceptor
- 所有已实现的接口:
Serializable,Advice,Interceptor,MethodInterceptor
- 直接已知子类:
DebugInterceptor
public class SimpleTraceInterceptor extends AbstractTraceInterceptor
Simple AOP AllianceMethodInterceptorthat can be introduced in a chain to display verbose trace information about intercepted method invocations, with method entry and method exit info.Consider using
CustomizableTraceInterceptorfor more advanced needs.- 从以下版本开始:
- 1.2
- 作者:
- Dmitriy Kopylenko, Juergen Hoeller
- 另请参阅:
CustomizableTraceInterceptor, 序列化表格
字段概要
从类继承的字段 org.springframework.aop.interceptor.AbstractTraceInterceptor
defaultLogger
构造器概要
构造器 构造器 说明 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 StringgetInvocationDescription(MethodInvocation invocation)Return a description for the given method invocation.protected ObjectinvokeUnderTrace(MethodInvocation invocation, Log logger)Subclasses must override this method to perform any tracing around the suppliedMethodInvocation.从类继承的方法 org.springframework.aop.interceptor.AbstractTraceInterceptor
getClassForLogging, getLoggerForInvocation, invoke, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLogExceptionStackTrace, setLoggerName, setUseDynamicLogger, writeToLog, writeToLog
构造器详细资料
SimpleTraceInterceptor
public SimpleTraceInterceptor()
Create a new SimpleTraceInterceptor with a static logger.
SimpleTraceInterceptor
public SimpleTraceInterceptor(boolean useDynamicLogger)
Create a new SimpleTraceInterceptor with dynamic or static logger, according to the given flag.- 参数:
useDynamicLogger- whether to use a dynamic logger or a static logger- 另请参阅:
AbstractTraceInterceptor.setUseDynamicLogger(boolean)
方法详细资料
invokeUnderTrace
protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable
从类复制的说明:AbstractTraceInterceptorSubclasses must override this method to perform any tracing around the suppliedMethodInvocation. Subclasses are responsible for ensuring that theMethodInvocationactually executes by callingMethodInvocation.proceed().By default, the passed-in
Loginstance will have log level "trace" enabled. Subclasses do not have to check for this again, unless they overwrite theisInterceptorEnabledmethod to modify the default behavior, and may delegate towriteToLogfor actual messages to be written.- 指定者:
invokeUnderTrace在类中AbstractTraceInterceptorlogger- theLogto write trace messages to- 返回:
- the result of the call to
MethodInvocation.proceed() - 抛出:
Throwable- if the call toMethodInvocation.proceed()encountered any errors- 另请参阅:
AbstractTraceInterceptor.isLogEnabled(org.apache.commons.logging.Log),AbstractTraceInterceptor.writeToLog(Log, String),AbstractTraceInterceptor.writeToLog(Log, String, Throwable)
getInvocationDescription
protected String getInvocationDescription(MethodInvocation invocation)
Return a description for the given method invocation.- 参数:
invocation- the invocation to describe- 返回:
- the description