public class DebugInterceptor extends SimpleTraceInterceptor
MethodInterceptor
。チェーンに導入して、インターセプトされた呼び出しに関する詳細情報をロガーに表示できます。 呼び出し引数と呼び出しカウントを含む、メソッドエントリとメソッド出口に関する完全な呼び出しの詳細をログに記録します。これはデバッグの目的でのみ使用されます。純粋なトレースの目的で SimpleTraceInterceptor
または CustomizableTraceInterceptor
を使用します。
SimpleTraceInterceptor
, CustomizableTraceInterceptor
, 直列化された形式 defaultLogger
コンストラクターと説明 |
---|
DebugInterceptor() 静的ロガーを使用して新しい DebugInterceptor を作成します。 |
DebugInterceptor(boolean useDynamicLogger) 指定されたフラグに従って、動的または静的ロガーで新しい DebugInterceptor を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
long | getCount() このインターセプターが呼び出された回数を返します。 |
protected StringSE | getInvocationDescription(MethodInvocation invocation) 指定されたメソッド呼び出しの説明を返します。 |
ObjectSE | invoke(MethodInvocation invocation) 特定の MethodInvocation のロギングを有効にするかどうかを決定します。 |
void | resetCount() 呼び出し回数をゼロにリセットします。 |
invokeUnderTrace
getClassForLogging, getLoggerForInvocation, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLogExceptionStackTrace, setLoggerName, setUseDynamicLogger, writeToLog, writeToLog
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public DebugInterceptor()
public DebugInterceptor(boolean useDynamicLogger)
useDynamicLogger
- 動的ロガーと静的ロガーのどちらを使用するか AbstractTraceInterceptor.setUseDynamicLogger(boolean)
@Nullable public ObjectSE invoke(MethodInvocation invocation) throws ThrowableSE
AbstractTraceInterceptor
MethodInvocation
のロギングを有効にするかどうかを決定します。そうでない場合、メソッド呼び出しは通常どおり続行されます。それ以外の場合、メソッド呼び出しは処理のために invokeUnderTrace
メソッドに渡されます。MethodInterceptor
の invoke
AbstractTraceInterceptor
の invoke
invocation
- メソッド呼び出しジョインポイント Joinpoint.proceed()
の呼び出しの結果。インターセプターによってインターセプトされる可能性があります ThrowableSE
- インターセプターまたはターゲットオブジェクトが例外をスローする場合 AbstractTraceInterceptor.invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log)
protected StringSE getInvocationDescription(MethodInvocation invocation)
SimpleTraceInterceptor
SimpleTraceInterceptor
の getInvocationDescription
invocation
- 説明する呼び出し public long getCount()
public void resetCount()