|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.picocontainer.gems.monitors.CommonsLoggingComponentMonitor
public class CommonsLoggingComponentMonitor
A 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.
Commons Logging does not guarantee Serialization. It is supported when using Log4j as a back end, but you should write a test case to determine if your particular logger implementation is supported if you plan on serializing this ComponentMonitor.
Field Summary |
---|
Fields inherited from interface org.picocontainer.ComponentMonitor |
---|
KEEP |
Constructor Summary | |
---|---|
CommonsLoggingComponentMonitor()
Creates a CommonsLoggingComponentMonitor with no Log instance set. |
|
CommonsLoggingComponentMonitor(Class<?> logClass)
Creates a CommonsLoggingComponentMonitor with a given Log instance class. |
|
CommonsLoggingComponentMonitor(Class<?> logClass,
ComponentMonitor delegate)
Creates a CommonsLoggingComponentMonitor with a given Log instance class. |
|
CommonsLoggingComponentMonitor(Log log)
Creates a CommonsLoggingComponentMonitor with a given Log instance |
|
CommonsLoggingComponentMonitor(Log log,
ComponentMonitor delegate)
Creates a CommonsLoggingComponentMonitor with a given Log instance. |
|
CommonsLoggingComponentMonitor(String logName)
Creates a CommonsLoggingComponentMonitor with a given Log instance name. |
|
CommonsLoggingComponentMonitor(String logName,
ComponentMonitor delegate)
Creates a CommonsLoggingComponentMonitor with a given Log instance name. |
Method Summary | ||
---|---|---|
protected Log |
getLog(Member member)
Retrieves the logger appropriate for the calling member's class. |
|
|
instantiated(PicoContainer container,
ComponentAdapter<T> componentAdapter,
Constructor<T> constructor,
Object instantiated,
Object[] parameters,
long duration)
|
|
|
instantiating(PicoContainer container,
ComponentAdapter<T> componentAdapter,
Constructor<T> constructor)
|
|
|
instantiationFailed(PicoContainer container,
ComponentAdapter<T> componentAdapter,
Constructor<T> constructor,
Exception cause)
|
|
void |
invocationFailed(Member member,
Object instance,
Exception cause)
|
|
void |
invoked(PicoContainer container,
ComponentAdapter<?> componentAdapter,
Member member,
Object instance,
long duration,
Object[] args,
Object retVal)
|
|
Object |
invoking(PicoContainer container,
ComponentAdapter<?> componentAdapter,
Member member,
Object instance,
Object[] args)
|
|
void |
lifecycleInvocationFailed(MutablePicoContainer container,
ComponentAdapter<?> componentAdapter,
Method method,
Object instance,
RuntimeException cause)
|
|
Behavior |
newBehavior(Behavior behavior)
|
|
Injector |
newInjector(Injector injector)
|
|
Object |
noComponentFound(MutablePicoContainer container,
Object componentKey)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommonsLoggingComponentMonitor()
LogFactory
will be used to retrieve the Log instance
at every invocation of the monitor.
public CommonsLoggingComponentMonitor(Class<?> logClass)
logClass
- the class of the Logpublic CommonsLoggingComponentMonitor(String logName)
LogFactory
to create the Log instance.
logName
- the name of the Logpublic CommonsLoggingComponentMonitor(Log log)
log
- the Log to write topublic CommonsLoggingComponentMonitor(Class<?> logClass, ComponentMonitor delegate)
logClass
- the class of the Logdelegate
- the delegatepublic CommonsLoggingComponentMonitor(String logName, ComponentMonitor delegate)
LogFactory
to create the Log instance.
logName
- the name of the Logdelegate
- the delegatepublic CommonsLoggingComponentMonitor(Log log, ComponentMonitor delegate)
log
- the Log with which to write events.delegate
- the delegateMethod Detail |
---|
public <T> Constructor<T> instantiating(PicoContainer container, ComponentAdapter<T> componentAdapter, Constructor<T> constructor)
instantiating
in interface ComponentMonitor
public <T> void instantiated(PicoContainer container, ComponentAdapter<T> componentAdapter, Constructor<T> constructor, Object instantiated, Object[] parameters, long duration)
instantiated
in interface ComponentMonitor
public <T> void instantiationFailed(PicoContainer container, ComponentAdapter<T> componentAdapter, Constructor<T> constructor, Exception cause)
instantiationFailed
in interface ComponentMonitor
public Object invoking(PicoContainer container, ComponentAdapter<?> componentAdapter, Member member, Object instance, Object[] args)
invoking
in interface ComponentMonitor
public void invoked(PicoContainer container, ComponentAdapter<?> componentAdapter, Member member, Object instance, long duration, Object[] args, Object retVal)
invoked
in interface ComponentMonitor
public void invocationFailed(Member member, Object instance, Exception cause)
invocationFailed
in interface ComponentMonitor
public void lifecycleInvocationFailed(MutablePicoContainer container, ComponentAdapter<?> componentAdapter, Method method, Object instance, RuntimeException cause)
lifecycleInvocationFailed
in interface ComponentMonitor
public Object noComponentFound(MutablePicoContainer container, Object componentKey)
noComponentFound
in interface ComponentMonitor
public Injector newInjector(Injector injector)
newInjector
in interface ComponentMonitor
public Behavior newBehavior(Behavior behavior)
newBehavior
in interface ComponentMonitor
protected Log getLog(Member member)
member
- constructor/method/field who's callback is required.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |