public class PerformanceMonitorInterceptor extends AbstractMonitoringInterceptor
MethodInterceptor for performance monitoring.
This interceptor has no effect on the intercepted method call.
Uses a StopWatch for the actual performance measuring.
StopWatch,
JamonPerformanceMonitorInterceptor,
序列化表格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
supplied
MethodInvocation. |
createInvocationTraceName, getPrefix, getSuffix, setLogTargetClassInvocation, setPrefix, setSuffixgetClassForLogging, getLoggerForInvocation, invoke, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLogExceptionStackTrace, setLoggerName, setUseDynamicLogger, writeToLog, writeToLogpublic PerformanceMonitorInterceptor()
public PerformanceMonitorInterceptor(boolean useDynamicLogger)
useDynamicLogger - whether to use a dynamic logger or a static loggerAbstractTraceInterceptor.setUseDynamicLogger(boolean)protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable
AbstractTraceInterceptorMethodInvocation. 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, and may delegate to writeToLog for actual
messages to be written.
invokeUnderTrace 在类中 AbstractTraceInterceptorlogger - the Log to write trace messages toMethodInvocation.proceed()Throwable - if the call to MethodInvocation.proceed()
encountered any errorsAbstractTraceInterceptor.isLogEnabled(org.apache.commons.logging.Log),
AbstractTraceInterceptor.writeToLog(Log, String),
AbstractTraceInterceptor.writeToLog(Log, String, Throwable)