public class CommonsLoggingComponentMonitor
extends org.picocontainer.monitors.AbstractComponentMonitor
implements java.io.Serializable
ComponentMonitor which writes to a Commons Logging Log instance.
The Log instance can either be injected or, if not set, the LogFactory
will be used to retrieve it at every invocation of the monitor.| Modifier and Type | Field and Description |
|---|---|
private org.picocontainer.ComponentMonitor |
delegate |
private org.apache.commons.logging.Log |
log |
| Constructor and Description |
|---|
CommonsLoggingComponentMonitor()
Creates a CommonsLoggingComponentMonitor with no Log instance set.
|
CommonsLoggingComponentMonitor(java.lang.Class logClass)
Creates a CommonsLoggingComponentMonitor with a given Log instance class.
|
CommonsLoggingComponentMonitor(java.lang.Class logClass,
org.picocontainer.ComponentMonitor delegate)
Creates a CommonsLoggingComponentMonitor with a given Log instance class.
|
CommonsLoggingComponentMonitor(org.apache.commons.logging.Log log)
Creates a CommonsLoggingComponentMonitor with a given Log instance
|
CommonsLoggingComponentMonitor(org.apache.commons.logging.Log log,
org.picocontainer.ComponentMonitor delegate)
Creates a CommonsLoggingComponentMonitor with a given Log instance
|
CommonsLoggingComponentMonitor(java.lang.String logName)
Creates a CommonsLoggingComponentMonitor with a given Log instance name.
|
CommonsLoggingComponentMonitor(java.lang.String logName,
org.picocontainer.ComponentMonitor delegate)
Creates a CommonsLoggingComponentMonitor with a given Log instance name.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.commons.logging.Log |
getLog(java.lang.reflect.Member member) |
void |
instantiated(java.lang.reflect.Constructor constructor,
long duration) |
void |
instantiated(java.lang.reflect.Constructor constructor,
java.lang.Object instantiated,
java.lang.Object[] parameters,
long duration) |
void |
instantiating(java.lang.reflect.Constructor constructor) |
void |
instantiationFailed(java.lang.reflect.Constructor constructor,
java.lang.Exception cause) |
void |
invocationFailed(java.lang.reflect.Method method,
java.lang.Object instance,
java.lang.Exception cause) |
void |
invoked(java.lang.reflect.Method method,
java.lang.Object instance,
long duration) |
void |
invoking(java.lang.reflect.Method method,
java.lang.Object instance) |
void |
lifecycleInvocationFailed(java.lang.reflect.Method method,
java.lang.Object instance,
java.lang.RuntimeException cause) |
private org.apache.commons.logging.Log log
private final org.picocontainer.ComponentMonitor delegate
public CommonsLoggingComponentMonitor()
LogFactory will be used to retrieve the Log instance
at every invocation of the monitor.public CommonsLoggingComponentMonitor(java.lang.Class logClass)
logClass - the class of the Logpublic CommonsLoggingComponentMonitor(java.lang.String logName)
LogFactory to create the Log instance.logName - the name of the Logpublic CommonsLoggingComponentMonitor(org.apache.commons.logging.Log log)
log - the Log to write topublic CommonsLoggingComponentMonitor(java.lang.Class logClass,
org.picocontainer.ComponentMonitor delegate)
logClass - the class of the Logpublic CommonsLoggingComponentMonitor(java.lang.String logName,
org.picocontainer.ComponentMonitor delegate)
LogFactory to create the Log instance.logName - the name of the Logpublic CommonsLoggingComponentMonitor(org.apache.commons.logging.Log log,
org.picocontainer.ComponentMonitor delegate)
log - the Log to write topublic void instantiating(java.lang.reflect.Constructor constructor)
instantiating in interface org.picocontainer.ComponentMonitorpublic void instantiated(java.lang.reflect.Constructor constructor,
long duration)
instantiated in interface org.picocontainer.ComponentMonitorpublic void instantiated(java.lang.reflect.Constructor constructor,
java.lang.Object instantiated,
java.lang.Object[] parameters,
long duration)
instantiated in interface org.picocontainer.ComponentMonitorpublic void instantiationFailed(java.lang.reflect.Constructor constructor,
java.lang.Exception cause)
instantiationFailed in interface org.picocontainer.ComponentMonitorpublic void invoking(java.lang.reflect.Method method,
java.lang.Object instance)
invoking in interface org.picocontainer.ComponentMonitorpublic void invoked(java.lang.reflect.Method method,
java.lang.Object instance,
long duration)
invoked in interface org.picocontainer.ComponentMonitorpublic void invocationFailed(java.lang.reflect.Method method,
java.lang.Object instance,
java.lang.Exception cause)
invocationFailed in interface org.picocontainer.ComponentMonitorpublic void lifecycleInvocationFailed(java.lang.reflect.Method method,
java.lang.Object instance,
java.lang.RuntimeException cause)
lifecycleInvocationFailed in interface org.picocontainer.ComponentMonitorprotected org.apache.commons.logging.Log getLog(java.lang.reflect.Member member)