org.picocontainer.gems.containers
Class Log4jTracingContainerDecorator

java.lang.Object
  extended by org.picocontainer.gems.containers.Log4jTracingContainerDecorator
All Implemented Interfaces:
Serializable, Converting, Disposable, MutablePicoContainer, PicoContainer, Startable

Deprecated. Since PicoContainer 2.3, Pico 2 ComponentAdapters can now do everything that this decorator provided.

@Deprecated
public class Log4jTracingContainerDecorator
extends Object
implements MutablePicoContainer, Converting, Serializable

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
See Also:
Serialized Form

Constructor Summary
Log4jTracingContainerDecorator(MutablePicoContainer delegate)
          Deprecated. Default typical wrapper that wraps another MutablePicoContainer.
Log4jTracingContainerDecorator(MutablePicoContainer delegate, org.apache.log4j.Logger logger)
          Deprecated. Alternate constructor that allows specification of the Logger to use.
 
Method Summary
 void accept(PicoVisitor visitor)
          Deprecated. 
 MutablePicoContainer addAdapter(ComponentAdapter componentAdapter)
          Deprecated. 
 MutablePicoContainer addChildContainer(PicoContainer child)
          Deprecated. 
 MutablePicoContainer addComponent(Object implOrInstance)
          Deprecated. 
 MutablePicoContainer addComponent(Object componentKey, Object componentImplementationOrInstance, Parameter... parameters)
          Deprecated. 
 MutablePicoContainer addConfig(String name, Object val)
          Deprecated.  
 MutablePicoContainer as(Properties... properties)
          Deprecated.  
 MutablePicoContainer change(Properties... properties)
          Deprecated.  
 void dispose()
          Deprecated. 
<T> T
getComponent(Class<T> componentType)
          Deprecated.  
<T> T
getComponent(Class<T> componentType, Class<? extends Annotation> binding)
          Deprecated.  
 Object getComponent(Object componentKeyOrType)
          Deprecated. 
 Object getComponent(Object componentKeyOrType, Type into)
          Deprecated.  
<T> ComponentAdapter<T>
getComponentAdapter(Class<T> componentType, Class<? extends Annotation> binding)
          Deprecated.  
<T> ComponentAdapter<T>
getComponentAdapter(Class<T> componentType, NameBinding componentNameBinding)
          Deprecated. 
 ComponentAdapter<?> getComponentAdapter(Object componentKey)
          Deprecated. 
 Collection<ComponentAdapter<?>> getComponentAdapters()
          Deprecated. 
<T> List<ComponentAdapter<T>>
getComponentAdapters(Class<T> componentType)
          Deprecated. 
<T> List<ComponentAdapter<T>>
getComponentAdapters(Class<T> componentType, Class<? extends Annotation> binding)
          Deprecated.  
 List getComponents()
          Deprecated. 
<T> List<T>
getComponents(Class<T> componentType)
          Deprecated. 
 Converters getConverters()
          Deprecated.  
 org.apache.log4j.Logger getLoggerUsed()
          Deprecated. Retrieves the logger instance used by this decorator.
 PicoContainer getParent()
          Deprecated. 
 MutablePicoContainer makeChildContainer()
          Deprecated. 
protected  void onKeyOrTypeDoesNotExistInContainer(Object componentKeyOrType, org.apache.log4j.Logger target)
          Deprecated. Standard message handling for cases when a null object is returned for a given key.
 boolean removeChildContainer(PicoContainer child)
          Deprecated. 
 ComponentAdapter removeComponent(Object componentKey)
          Deprecated. 
 ComponentAdapter removeComponentByInstance(Object componentInstance)
          Deprecated. 
 void setLifecycleState(LifecycleState lifecycleState)
          Deprecated.  
 void setName(String name)
          Deprecated.  
 void start()
          Deprecated. 
 void stop()
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4jTracingContainerDecorator

public Log4jTracingContainerDecorator(MutablePicoContainer delegate)
Deprecated. 
Default typical wrapper that wraps another MutablePicoContainer.

Parameters:
delegate - Container to be decorated.
Throws:
NullPointerException - if delegate is null.

Log4jTracingContainerDecorator

public Log4jTracingContainerDecorator(MutablePicoContainer delegate,
                                      org.apache.log4j.Logger logger)
Deprecated. 
Alternate constructor that allows specification of the Logger to use.

Parameters:
delegate - Container to be decorated.
logger - specific Log4j Logger to use.
Throws:
NullPointerException - if delegate or logger is null.
Method Detail

onKeyOrTypeDoesNotExistInContainer

protected void onKeyOrTypeDoesNotExistInContainer(Object componentKeyOrType,
                                                  org.apache.log4j.Logger target)
Deprecated. 
Standard message handling for cases when a null object is returned for a given key.

Parameters:
componentKeyOrType - Component key that does not exist
target - Logger to log into

accept

public void accept(PicoVisitor visitor)
Deprecated. 

Specified by:
accept in interface PicoContainer
Parameters:
visitor -
See Also:
PicoContainer.accept(org.picocontainer.PicoVisitor)

addChildContainer

public MutablePicoContainer addChildContainer(PicoContainer child)
Deprecated. 

Specified by:
addChildContainer in interface MutablePicoContainer
Parameters:
child -
Returns:
See Also:
MutablePicoContainer.addChildContainer(org.picocontainer.PicoContainer)

dispose

public void dispose()
Deprecated. 

Specified by:
dispose in interface Disposable
See Also:
Disposable.dispose()

getComponentAdapter

public ComponentAdapter<?> getComponentAdapter(Object componentKey)
Deprecated. 

Specified by:
getComponentAdapter in interface PicoContainer
Parameters:
componentKey -
Returns:
See Also:
PicoContainer.getComponentAdapter(java.lang.Object)

getComponentAdapter

public <T> ComponentAdapter<T> getComponentAdapter(Class<T> componentType,
                                                   NameBinding componentNameBinding)
Deprecated. 

Specified by:
getComponentAdapter in interface PicoContainer
Parameters:
componentType -
Returns:
ComponentAdapter or null.
See Also:
org.picocontainer.PicoContainer#getComponentAdapter(java.lang.Class)

getComponentAdapters

public Collection<ComponentAdapter<?>> getComponentAdapters()
Deprecated. 

Specified by:
getComponentAdapters in interface PicoContainer
Returns:
Collection or null.
See Also:
PicoContainer.getComponentAdapters()

getComponentAdapters

public <T> List<ComponentAdapter<T>> getComponentAdapters(Class<T> componentType)
Deprecated. 

Specified by:
getComponentAdapters in interface PicoContainer
Parameters:
componentType -
Returns:
List of ComponentAdapters
See Also:
PicoContainer.getComponentAdapters(java.lang.Class)

getComponentAdapters

public <T> List<ComponentAdapter<T>> getComponentAdapters(Class<T> componentType,
                                                          Class<? extends Annotation> binding)
Deprecated. 
Specified by:
getComponentAdapters in interface PicoContainer

getComponentAdapter

public <T> ComponentAdapter<T> getComponentAdapter(Class<T> componentType,
                                                   Class<? extends Annotation> binding)
Deprecated. 
Specified by:
getComponentAdapter in interface PicoContainer

getComponent

public Object getComponent(Object componentKeyOrType)
Deprecated. 

Specified by:
getComponent in interface PicoContainer
Parameters:
componentKeyOrType -
Returns:
See Also:
PicoContainer.getComponent(java.lang.Object)

getComponent

public Object getComponent(Object componentKeyOrType,
                           Type into)
Deprecated. 
Specified by:
getComponent in interface PicoContainer

getComponent

public <T> T getComponent(Class<T> componentType)
Deprecated. 
Specified by:
getComponent in interface PicoContainer

getComponent

public <T> T getComponent(Class<T> componentType,
                          Class<? extends Annotation> binding)
Deprecated. 
Specified by:
getComponent in interface PicoContainer

getComponents

public List getComponents()
Deprecated. 

Specified by:
getComponents in interface PicoContainer
Returns:
See Also:
PicoContainer.getComponents()

getComponents

public <T> List<T> getComponents(Class<T> componentType)
Deprecated. 

Specified by:
getComponents in interface PicoContainer
Parameters:
componentType -
Returns:
See Also:
PicoContainer.getComponents(java.lang.Class)

getParent

public PicoContainer getParent()
Deprecated. 

Specified by:
getParent in interface PicoContainer
Returns:
See Also:
PicoContainer.getParent()

makeChildContainer

public MutablePicoContainer makeChildContainer()
Deprecated. 

Specified by:
makeChildContainer in interface MutablePicoContainer
Returns:
See Also:
MutablePicoContainer.makeChildContainer()

addAdapter

public MutablePicoContainer addAdapter(ComponentAdapter componentAdapter)
Deprecated. 

Specified by:
addAdapter in interface MutablePicoContainer
Parameters:
componentAdapter -
Returns:
See Also:
MutablePicoContainer.addAdapter(org.picocontainer.ComponentAdapter)

addComponent

public MutablePicoContainer addComponent(Object componentKey,
                                         Object componentImplementationOrInstance,
                                         Parameter... parameters)
Deprecated. 

Specified by:
addComponent in interface MutablePicoContainer
Parameters:
componentKey -
componentImplementationOrInstance -
parameters -
Returns:

addComponent

public MutablePicoContainer addComponent(Object implOrInstance)
Deprecated. 

Specified by:
addComponent in interface MutablePicoContainer
Parameters:
implOrInstance -
Returns:
See Also:
MutablePicoContainer.addComponent(java.lang.Object)

addConfig

public MutablePicoContainer addConfig(String name,
                                      Object val)
Deprecated. 
Specified by:
addConfig in interface MutablePicoContainer

removeChildContainer

public boolean removeChildContainer(PicoContainer child)
Deprecated. 

Specified by:
removeChildContainer in interface MutablePicoContainer
Parameters:
child -
Returns:
See Also:
MutablePicoContainer.removeChildContainer(org.picocontainer.PicoContainer)

start

public void start()
Deprecated. 

Specified by:
start in interface Startable
See Also:
Startable.start()

stop

public void stop()
Deprecated. 

Specified by:
stop in interface Startable
See Also:
Startable.stop()

removeComponent

public ComponentAdapter removeComponent(Object componentKey)
Deprecated. 

Specified by:
removeComponent in interface MutablePicoContainer
Parameters:
componentKey -
Returns:
See Also:
MutablePicoContainer.removeComponent(java.lang.Object)

removeComponentByInstance

public ComponentAdapter removeComponentByInstance(Object componentInstance)
Deprecated. 

Specified by:
removeComponentByInstance in interface MutablePicoContainer
Parameters:
componentInstance -
Returns:
See Also:
MutablePicoContainer.removeComponentByInstance(java.lang.Object)

getLoggerUsed

public org.apache.log4j.Logger getLoggerUsed()
Deprecated. 
Retrieves the logger instance used by this decorator.

Returns:
Logger instance.

change

public MutablePicoContainer change(Properties... properties)
Deprecated. 
Specified by:
change in interface MutablePicoContainer

as

public MutablePicoContainer as(Properties... properties)
Deprecated. 
Specified by:
as in interface MutablePicoContainer

setName

public void setName(String name)
Deprecated. 
Specified by:
setName in interface MutablePicoContainer

setLifecycleState

public void setLifecycleState(LifecycleState lifecycleState)
Deprecated. 
Specified by:
setLifecycleState in interface MutablePicoContainer

getConverters

public Converters getConverters()
Deprecated. 
Specified by:
getConverters in interface Converting


Copyright © 2003-2010 Codehaus. All Rights Reserved.