java.lang.Object | |
↳ | org.springframework.aop.interceptor.AbstractTraceInterceptor |
Known Direct Subclasses |
Known Indirect Subclasses |
Base MethodInterceptor
implementation for tracing.
By default, log messages are written to the log for the interceptor class,
not the class which is being intercepted. Setting the useDynamicLogger
bean property to true
causes all log messages to be written to
the Log
for the target class being intercepted.
Subclasses must implement the invokeUnderTrace
method, which
is invoked by this class ONLY when a particular invocation SHOULD be traced.
Subclasses should write to the Log
instance provided.
setUseDynamicLogger(boolean)
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
defaultLogger | The default Log instance used to write trace messages. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Determines whether or not logging is enabled for the particular
MethodInvocation . | |||||||||||
Set to "true" to have
dynamic loggers hide
proxy class names wherever possible. | |||||||||||
Set the name of the logger to use.
| |||||||||||
Set whether to use a dynamic logger or a static logger.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Determine the class to use for logging purposes.
| |||||||||||
Return the appropriate
Log instance to use for the given
MethodInvocation . | |||||||||||
Subclasses must override this method to perform any tracing around the
supplied
MethodInvocation . | |||||||||||
Determine whether the interceptor should kick in, that is,
whether the
invokeUnderTrace method should be called. | |||||||||||
Determine whether the given Log instance is enabled.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
The default Log
instance used to write trace messages.
This instance is mapped to the implementing Class
.
Determines whether or not logging is enabled for the particular MethodInvocation
.
If not, the method invocation proceeds as normal, otherwise the method invocation is passed
to the invokeUnderTrace
method for handling.
Throwable |
---|
Set to "true" to have dynamic loggers
hide
proxy class names wherever possible. Default is "false".
Set the name of the logger to use. The name will be passed to the underlying logger implementation through Commons Logging, getting interpreted as log category according to the logger's configuration.
This can be specified to not log into the category of a class (whether this interceptor's class or the class getting called) but rather into a specific named category.
NOTE: Specify either this property or "useDynamicLogger", not both.
getLogger(String)
Set whether to use a dynamic logger or a static logger. Default is a static logger for this trace interceptor.
Used to determine which Log
instance should be used to write
log messages for a particular method invocation: a dynamic one for the
Class
getting called, or a static one for the Class
of the trace interceptor.
NOTE: Specify either this property or "loggerName", not both.
Determine the class to use for logging purposes.
target | the target object to introspect |
---|
Return the appropriate Log
instance to use for the given
MethodInvocation
. If the useDynamicLogger
flag
is set, the Log
instance will be for the target class of the
MethodInvocation
, otherwise the Log
will be the
default static logger.
invocation | the MethodInvocation being traced |
---|
Log
instance to useSubclasses must override this method to perform any tracing around the
supplied MethodInvocation
. 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.
logger | the Log to write trace messages to |
---|
MethodInvocation.proceed()
Throwable | if the call to MethodInvocation.proceed()
encountered any errors |
---|
Determine whether the interceptor should kick in, that is,
whether the invokeUnderTrace
method should be called.
Default behavior is to check whether the given Log
instance is enabled. Subclasses can override this to apply the
interceptor in other cases as well.
invocation | the MethodInvocation being traced |
---|---|
logger | the Log instance to check |
Determine whether the given Log instance is enabled.
Default is true
when the "trace" level is enabled.
Subclasses can override this to change the level under which 'tracing' occurs.
logger | the Log instance to check
|
---|