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.
SimpleTraceInterceptor, CustomizableTraceInterceptor
| Modifier and Type | Field and Description |
|---|---|
| private volatile long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DebugInterceptor(boolean
whether to use a dynamic logger or a static logger useDynamicLogger)Create a new DebugInterceptor with dynamic or static logger, according to the given flag. |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| protected String | getInvocationDescription(MethodInvocation
the invocation to describe invocation)Overrides org. |
| public Object | invoke(MethodInvocation
the method invocation joinpoint invocation)Overrides org. Implements org. MethodInvocation.
|
| public synchronized void |
| count | back to summary |
|---|---|
| private volatile long count | |
| DebugInterceptor | back to summary |
|---|---|
| public DebugInterceptor() Create a new DebugInterceptor with a static logger. | |
| DebugInterceptor | back to summary |
|---|---|
| public DebugInterceptor(boolean useDynamicLogger) Create a new DebugInterceptor with dynamic or static logger, according to the given flag.
| |
| getCount | back to summary |
|---|---|
| public long getCount() Return the number of times this interceptor has been invoked. | |
| getInvocationDescription | back to summary |
|---|---|
| protected String getInvocationDescription(MethodInvocation invocation) Overrides org. Doc from org. Return a description for the given method invocation.
| |
| invoke | back to summary |
|---|---|
| public Object invoke(MethodInvocation invocation) throws Throwable Overrides org. Implements org. Doc from org. Determines whether logging is enabled for the particular
| |
| resetCount | back to summary |
|---|---|
| public synchronized void resetCount() Reset the invocation count to zero. | |