|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.picocontainer.monitors.AbstractComponentMonitor
org.picocontainer.gems.monitors.Log4JComponentMonitor
public class Log4JComponentMonitor
A ComponentMonitor
which writes to a Log4J Logger
instance.
The Logger instance can either be injected or, if not set, the LogManager
will be used to retrieve it at every invocation of the monitor.
Field Summary | |
---|---|
private org.picocontainer.ComponentMonitor |
delegate
|
private org.apache.log4j.Logger |
logger
|
Fields inherited from class org.picocontainer.monitors.AbstractComponentMonitor |
---|
INSTANTIATED, INSTANTIATED2, INSTANTIATING, INSTANTIATION_FAILED, INVOCATION_FAILED, INVOKED, INVOKING, LIFECYCLE_INVOCATION_FAILED |
Constructor Summary | |
---|---|
Log4JComponentMonitor()
Creates a Log4JComponentMonitor with no Logger instance set. |
|
Log4JComponentMonitor(java.lang.Class loggerClass)
Creates a Log4JComponentMonitor with a given Logger instance class. |
|
Log4JComponentMonitor(java.lang.Class loggerClass,
org.picocontainer.ComponentMonitor delegate)
Creates a Log4JComponentMonitor with a given Logger instance class. |
|
Log4JComponentMonitor(org.picocontainer.ComponentMonitor delegate)
|
|
Log4JComponentMonitor(org.apache.log4j.Logger logger)
Creates a Log4JComponentMonitor with a given Logger instance |
|
Log4JComponentMonitor(org.apache.log4j.Logger logger,
org.picocontainer.ComponentMonitor delegate)
Creates a Log4JComponentMonitor with a given Logger instance |
|
Log4JComponentMonitor(java.lang.String loggerName)
Creates a Log4JComponentMonitor with a given Logger instance name. |
|
Log4JComponentMonitor(java.lang.String loggerName,
org.picocontainer.ComponentMonitor delegate)
Creates a Log4JComponentMonitor with a given Logger instance name. |
Method Summary | |
---|---|
protected org.apache.log4j.Logger |
getLogger(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)
|
Methods inherited from class org.picocontainer.monitors.AbstractComponentMonitor |
---|
format, toString, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private org.apache.log4j.Logger logger
private final org.picocontainer.ComponentMonitor delegate
Constructor Detail |
---|
public Log4JComponentMonitor()
LogManager
will be used to retrieve the Logger instance
at every invocation of the monitor.
public Log4JComponentMonitor(java.lang.Class loggerClass)
loggerClass
- the class of the Loggerpublic Log4JComponentMonitor(java.lang.String loggerName)
LogManager
to create the Logger instance.
loggerName
- the name of the Logpublic Log4JComponentMonitor(org.apache.log4j.Logger logger)
logger
- the Logger to write topublic Log4JComponentMonitor(java.lang.Class loggerClass, org.picocontainer.ComponentMonitor delegate)
loggerClass
- the class of the Loggerpublic Log4JComponentMonitor(java.lang.String loggerName, org.picocontainer.ComponentMonitor delegate)
LogManager
to create the Logger instance.
loggerName
- the name of the Logpublic Log4JComponentMonitor(org.apache.log4j.Logger logger, org.picocontainer.ComponentMonitor delegate)
logger
- the Logger to write topublic Log4JComponentMonitor(org.picocontainer.ComponentMonitor delegate)
Method Detail |
---|
public void instantiating(java.lang.reflect.Constructor constructor)
instantiating
in interface org.picocontainer.ComponentMonitor
public void instantiated(java.lang.reflect.Constructor constructor, long duration)
instantiated
in interface org.picocontainer.ComponentMonitor
public void instantiated(java.lang.reflect.Constructor constructor, java.lang.Object instantiated, java.lang.Object[] parameters, long duration)
instantiated
in interface org.picocontainer.ComponentMonitor
public void instantiationFailed(java.lang.reflect.Constructor constructor, java.lang.Exception cause)
instantiationFailed
in interface org.picocontainer.ComponentMonitor
public void invoking(java.lang.reflect.Method method, java.lang.Object instance)
invoking
in interface org.picocontainer.ComponentMonitor
public void invoked(java.lang.reflect.Method method, java.lang.Object instance, long duration)
invoked
in interface org.picocontainer.ComponentMonitor
public void invocationFailed(java.lang.reflect.Method method, java.lang.Object instance, java.lang.Exception cause)
invocationFailed
in interface org.picocontainer.ComponentMonitor
public void lifecycleInvocationFailed(java.lang.reflect.Method method, java.lang.Object instance, java.lang.RuntimeException cause)
lifecycleInvocationFailed
in interface org.picocontainer.ComponentMonitor
protected org.apache.log4j.Logger getLogger(java.lang.reflect.Member member)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |