Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.picocontainer.gems.monitors
Class CommonsLoggingComponentMonitor

    java.lang.Object
      org.picocontainer.gems.monitors.CommonsLoggingComponentMonitor

All Implemented Interfaces:
  Serializable, org.picocontainer.ComponentMonitor

    public class CommonsLoggingComponentMonitor

extends Object
implements org.picocontainer.ComponentMonitor, Serializable

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.

#### Note on Serialization

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.

Author:
  Paul Hammant, Mauro Talevi
See Also:
  Serialized Form

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, org.picocontainer.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, org.picocontainer.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, org.picocontainer.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.
`
`<T> void`
` | `instantiated(org.picocontainer.PicoContainer container, org.picocontainer.ComponentAdapter<T> componentAdapter, Constructor<T> constructor, Object instantiated, Object[] parameters, long duration)`
`
`<T> Constructor<T>`
` | `instantiating(org.picocontainer.PicoContainer container, org.picocontainer.ComponentAdapter<T> componentAdapter, Constructor<T> constructor)`
`
`<T> void`
` | `instantiationFailed(org.picocontainer.PicoContainer container, org.picocontainer.ComponentAdapter<T> componentAdapter, Constructor<T> constructor, Exception cause)`
`void` | `invocationFailed(Member member, Object instance, Exception cause)`
`void` | `invoked(org.picocontainer.PicoContainer container, org.picocontainer.ComponentAdapter<?> componentAdapter, Method method, Object instance, long duration)`
`void` | `invoking(org.picocontainer.PicoContainer container, org.picocontainer.ComponentAdapter<?> componentAdapter, Member member, Object instance)`
`void` | `lifecycleInvocationFailed(org.picocontainer.MutablePicoContainer container, org.picocontainer.ComponentAdapter<?> componentAdapter, Method method, Object instance, RuntimeException cause)`
`org.picocontainer.Behavior` | `newBehavior(org.picocontainer.Behavior behavior)`
`org.picocontainer.Injector` | `newInjector(org.picocontainer.Injector injector)`
`Object` | `noComponentFound(org.picocontainer.MutablePicoContainer container, Object componentKey)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CommonsLoggingComponentMonitor

    public CommonsLoggingComponentMonitor()

  Creates a CommonsLoggingComponentMonitor with no Log instance set. The `LogFactory` will be used to retrieve the Log instance at every invocation of the monitor.

### CommonsLoggingComponentMonitor

    public CommonsLoggingComponentMonitor(Class<?> logClass)

  Creates a CommonsLoggingComponentMonitor with a given Log instance class. The class name is used to retrieve the Log instance.

  Parameters:
    `logClass` - the class of the Log

### CommonsLoggingComponentMonitor

    public CommonsLoggingComponentMonitor(String logName)

  Creates a CommonsLoggingComponentMonitor with a given Log instance name. It uses the `LogFactory` to create the Log instance.

  Parameters:
    `logName` - the name of the Log

### CommonsLoggingComponentMonitor

    public CommonsLoggingComponentMonitor(Log log)

  Creates a CommonsLoggingComponentMonitor with a given Log instance

  Parameters:
    `log` - the Log to write to

### CommonsLoggingComponentMonitor

    public CommonsLoggingComponentMonitor(Class<?> logClass,
                                          org.picocontainer.ComponentMonitor delegate)

  Creates a CommonsLoggingComponentMonitor with a given Log instance class. The class name is used to retrieve the Log instance.

  Parameters:
    `logClass` - the class of the Log
    `delegate` - the delegate

### CommonsLoggingComponentMonitor

    public CommonsLoggingComponentMonitor(String logName,
                                          org.picocontainer.ComponentMonitor delegate)

  Creates a CommonsLoggingComponentMonitor with a given Log instance name. It uses the `LogFactory` to create the Log instance.

  Parameters:
    `logName` - the name of the Log
    `delegate` - the delegate

### CommonsLoggingComponentMonitor

    public CommonsLoggingComponentMonitor(Log log,
                                          org.picocontainer.ComponentMonitor delegate)

  Creates a CommonsLoggingComponentMonitor with a given Log instance.

  Parameters:
    `log` - the Log with which to write events.
    `delegate` - the delegate

Method Detail

### instantiating

    public <T> Constructor<T> instantiating(org.picocontainer.PicoContainer container,
                                            org.picocontainer.ComponentAdapter<T> componentAdapter,
                                            Constructor<T> constructor)

  Specified by:
    `instantiating` in interface `org.picocontainer.ComponentMonitor`

### instantiated

    public <T> void instantiated(org.picocontainer.PicoContainer container,
                                 org.picocontainer.ComponentAdapter<T> componentAdapter,
                                 Constructor<T> constructor,
                                 Object instantiated,
                                 Object[] parameters,
                                 long duration)

  Specified by:
    `instantiated` in interface `org.picocontainer.ComponentMonitor`

### instantiationFailed

    public <T> void instantiationFailed(org.picocontainer.PicoContainer container,
                                        org.picocontainer.ComponentAdapter<T> componentAdapter,
                                        Constructor<T> constructor,
                                        Exception cause)

  Specified by:
    `instantiationFailed` in interface `org.picocontainer.ComponentMonitor`

### invoking

    public void invoking(org.picocontainer.PicoContainer container,
                         org.picocontainer.ComponentAdapter<?> componentAdapter,
                         Member member,
                         Object instance)

  Specified by:
    `invoking` in interface `org.picocontainer.ComponentMonitor`

### invoked

    public void invoked(org.picocontainer.PicoContainer container,
                        org.picocontainer.ComponentAdapter<?> componentAdapter,
                        Method method,
                        Object instance,
                        long duration)

  Specified by:
    `invoked` in interface `org.picocontainer.ComponentMonitor`

### invocationFailed

    public void invocationFailed(Member member,
                                 Object instance,
                                 Exception cause)

  Specified by:
    `invocationFailed` in interface `org.picocontainer.ComponentMonitor`

### lifecycleInvocationFailed

    public void lifecycleInvocationFailed(org.picocontainer.MutablePicoContainer container,
                                          org.picocontainer.ComponentAdapter<?> componentAdapter,
                                          Method method,
                                          Object instance,
                                          RuntimeException cause)

  Specified by:
    `lifecycleInvocationFailed` in interface `org.picocontainer.ComponentMonitor`

### noComponentFound

    public Object noComponentFound(org.picocontainer.MutablePicoContainer container,
                                   Object componentKey)

  Specified by:
    `noComponentFound` in interface `org.picocontainer.ComponentMonitor`

### newInjector

    public org.picocontainer.Injector newInjector(org.picocontainer.Injector injector)

  Specified by:
    `newInjector` in interface `org.picocontainer.ComponentMonitor`

### newBehavior

    public org.picocontainer.Behavior newBehavior(org.picocontainer.Behavior behavior)

  Specified by:
    `newBehavior` in interface `org.picocontainer.ComponentMonitor`

### getLog

    protected Log getLog(Member member)

  Retrieves the logger appropriate for the calling member's class.

  Parameters:
    `member` - constructor/method/field who's callback is required.
  Returns:
    the Commons logging instance.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2009 Codehaus. All Rights Reserved.