类 PerformanceMonitorInterceptor
- java.lang.Object
- org.springframework.aop.interceptor.AbstractTraceInterceptor
- org.springframework.aop.interceptor.AbstractMonitoringInterceptor
- org.springframework.aop.interceptor.PerformanceMonitorInterceptor
- 所有已实现的接口:
Serializable
,Advice
,Interceptor
,MethodInterceptor
public class PerformanceMonitorInterceptor extends AbstractMonitoringInterceptor
Simple AOP AllianceMethodInterceptor
for performance monitoring. This interceptor has no effect on the intercepted method call.Uses a
StopWatch
for the actual performance measuring.- 作者:
- Rod Johnson, Dmitriy Kopylenko, Rob Harrop
- 另请参阅:
StopWatch
,JamonPerformanceMonitorInterceptor
, 序列化表格
字段概要
从类继承的字段 org.springframework.aop.interceptor.AbstractTraceInterceptor
defaultLogger
构造器概要
构造器 构造器 说明 PerformanceMonitorInterceptor()
Create a new PerformanceMonitorInterceptor with a static logger.PerformanceMonitorInterceptor(boolean useDynamicLogger)
Create a new PerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected Object
invokeUnderTrace(MethodInvocation invocation, Log logger)
Subclasses must override this method to perform any tracing around the suppliedMethodInvocation
.从类继承的方法 org.springframework.aop.interceptor.AbstractMonitoringInterceptor
createInvocationTraceName, getPrefix, getSuffix, setLogTargetClassInvocation, setPrefix, setSuffix
从类继承的方法 org.springframework.aop.interceptor.AbstractTraceInterceptor
getClassForLogging, getLoggerForInvocation, invoke, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLogExceptionStackTrace, setLoggerName, setUseDynamicLogger, writeToLog, writeToLog
构造器详细资料
PerformanceMonitorInterceptor
public PerformanceMonitorInterceptor()
Create a new PerformanceMonitorInterceptor with a static logger.
PerformanceMonitorInterceptor
public PerformanceMonitorInterceptor(boolean useDynamicLogger)
Create a new PerformanceMonitorInterceptor with a 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
从类复制的说明:AbstractTraceInterceptor
Subclasses must override this method to perform any tracing around the suppliedMethodInvocation
. Subclasses are responsible for ensuring that theMethodInvocation
actually executes by callingMethodInvocation.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 theisInterceptorEnabled
method to modify the default behavior, and may delegate towriteToLog
for actual messages to be written.- 指定者:
invokeUnderTrace
在类中AbstractTraceInterceptor
logger
- theLog
to 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)