Decorates a MutablePicoContainer to provide extensive tracing capabilities
for all function calls into the Picocontainers.
By default, this class uses org.picocontainer.PicoContainer as its
logging category, however, this may be changed by providing the logger in its
alternate constructor.
Start and Stop events are logged under info priority, as are all
conditions where querying for an object returns a null object (e.g.,
getComponentAdapter(Object) returns null). All other functions use
debug priority.
If used in nanocontainer, you can add wrap your PicoContainer with the
Log4jTracingContainerDecorator: (Groovy Example)
pico = builder.container(parent: parent) {
//addComponent(.....)
//And others.
}
//Wrap the underlying NanoContainer with a Decorated Pico.
pico = new org.picocontainer.gems.containers.Log4jTracingContainerDecorator (pico.getPico())
author: Michael Rimov |