|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.picocontainer.gems.containers.Log4jTracingContainerDecorator
@Deprecated public class Log4jTracingContainerDecorator
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())
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. Accepts a visitor that should visit the child containers, component adapters and component instances. |
|
MutablePicoContainer |
addAdapter(ComponentAdapter componentAdapter)
Deprecated. Register a component via a ComponentAdapter. |
|
MutablePicoContainer |
addChildContainer(PicoContainer child)
Deprecated. Add a child container. |
|
MutablePicoContainer |
addComponent(Object implOrInstance)
Deprecated. Register an arbitrary object. |
|
MutablePicoContainer |
addComponent(Object componentKey,
Object componentImplementationOrInstance,
Parameter... parameters)
Deprecated. Register a component and creates specific instructions on which constructor to use, along with which components and/or constants to provide as constructor arguments. |
|
MutablePicoContainer |
addConfig(String name,
Object val)
Deprecated. Register a config item. |
|
MutablePicoContainer |
as(Properties... properties)
Deprecated. You can set for the following operation only the characteristic of registration of a component on the fly. |
|
MutablePicoContainer |
change(Properties... properties)
Deprecated. You can change the characteristic of registration of all subsequent components in this container. |
|
void |
dispose()
Deprecated. Dispose this component. |
|
|
getComponent(Class<T> componentType)
Deprecated. Retrieve a component keyed by the component type. |
|
|
getComponent(Class<T> componentType,
Class<? extends Annotation> binding)
Deprecated. |
|
Object |
getComponent(Object componentKeyOrType)
Deprecated. Retrieve a component instance registered with a specific key or type. |
|
Object |
getComponent(Object componentKeyOrType,
Type into)
Deprecated. |
|
|
getComponentAdapter(Class<T> componentType,
Class<? extends Annotation> binding)
Deprecated. |
|
|
getComponentAdapter(Class<T> componentType,
NameBinding componentNameBinding)
Deprecated. Find a component adapter associated with the specified type. |
|
ComponentAdapter<?> |
getComponentAdapter(Object componentKey)
Deprecated. Find a component adapter associated with the specified key. |
|
Collection<ComponentAdapter<?>> |
getComponentAdapters()
Deprecated. Retrieve all the component adapters inside this container. |
|
|
getComponentAdapters(Class<T> componentType)
Deprecated. Retrieve all component adapters inside this container that are associated with the specified type. |
|
|
getComponentAdapters(Class<T> componentType,
Class<? extends Annotation> binding)
Deprecated. |
|
List |
getComponents()
Deprecated. Retrieve all the registered component instances in the container, (not including those in the parent container). |
|
|
getComponents(Class<T> componentType)
Deprecated. Returns a List of components of a certain componentType. |
|
org.apache.log4j.Logger |
getLoggerUsed()
Deprecated. Retrieves the logger instance used by this decorator. |
|
PicoContainer |
getParent()
Deprecated. Retrieve the parent container of this container. |
|
MutablePicoContainer |
makeChildContainer()
Deprecated. Make a child container, using the same implementation of MutablePicoContainer as the parent. |
|
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. Remove a child container from this container. |
|
ComponentAdapter |
removeComponent(Object componentKey)
Deprecated. Unregister a component by key. |
|
ComponentAdapter |
removeComponentByInstance(Object componentInstance)
Deprecated. Unregister a component by instance. |
|
void |
start()
Deprecated. Start this component. |
|
void |
stop()
Deprecated. Stop this component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Log4jTracingContainerDecorator(MutablePicoContainer delegate)
delegate
- Container to be decorated.
NullPointerException
- if delegate is null.public Log4jTracingContainerDecorator(MutablePicoContainer delegate, org.apache.log4j.Logger logger)
delegate
- Container to be decorated.logger
- specific Log4j Logger to use.
NullPointerException
- if delegate or logger is null.Method Detail |
---|
protected void onKeyOrTypeDoesNotExistInContainer(Object componentKeyOrType, org.apache.log4j.Logger target)
componentKeyOrType
- Component key that does not existtarget
- Logger to log intopublic void accept(PicoVisitor visitor)
accept
in interface PicoContainer
visitor
- PicoContainer.accept(org.picocontainer.PicoVisitor)
public MutablePicoContainer addChildContainer(PicoContainer child)
addChildContainer
in interface MutablePicoContainer
child
-
MutablePicoContainer.addChildContainer(org.picocontainer.PicoContainer)
public void dispose()
dispose
in interface Disposable
Disposable.dispose()
public ComponentAdapter<?> getComponentAdapter(Object componentKey)
getComponentAdapter
in interface PicoContainer
componentKey
-
PicoContainer.getComponentAdapter(java.lang.Object)
public <T> ComponentAdapter<T> getComponentAdapter(Class<T> componentType, NameBinding componentNameBinding)
getComponentAdapter
in interface PicoContainer
componentType
-
org.picocontainer.PicoContainer#getComponentAdapter(java.lang.Class)
public Collection<ComponentAdapter<?>> getComponentAdapters()
getComponentAdapters
in interface PicoContainer
PicoContainer.getComponentAdapters()
public <T> List<ComponentAdapter<T>> getComponentAdapters(Class<T> componentType)
getComponentAdapters
in interface PicoContainer
componentType
-
PicoContainer.getComponentAdapters(java.lang.Class)
public <T> List<ComponentAdapter<T>> getComponentAdapters(Class<T> componentType, Class<? extends Annotation> binding)
getComponentAdapters
in interface PicoContainer
public <T> ComponentAdapter<T> getComponentAdapter(Class<T> componentType, Class<? extends Annotation> binding)
getComponentAdapter
in interface PicoContainer
public Object getComponent(Object componentKeyOrType)
getComponent
in interface PicoContainer
componentKeyOrType
-
PicoContainer.getComponent(java.lang.Object)
public Object getComponent(Object componentKeyOrType, Type into)
getComponent
in interface PicoContainer
public <T> T getComponent(Class<T> componentType)
PicoContainer
getComponent
in interface PicoContainer
T
- the type of the component.componentType
- the type of the component
public <T> T getComponent(Class<T> componentType, Class<? extends Annotation> binding)
getComponent
in interface PicoContainer
public List getComponents()
getComponents
in interface PicoContainer
PicoContainer.getComponents()
public <T> List<T> getComponents(Class<T> componentType)
getComponents
in interface PicoContainer
componentType
-
PicoContainer.getComponents(java.lang.Class)
public PicoContainer getParent()
getParent
in interface PicoContainer
PicoContainer.getParent()
public MutablePicoContainer makeChildContainer()
makeChildContainer
in interface MutablePicoContainer
MutablePicoContainer.makeChildContainer()
public MutablePicoContainer addAdapter(ComponentAdapter componentAdapter)
addAdapter
in interface MutablePicoContainer
componentAdapter
-
MutablePicoContainer.addAdapter(org.picocontainer.ComponentAdapter)
public MutablePicoContainer addComponent(Object componentKey, Object componentImplementationOrInstance, Parameter... parameters)
new ComponentParameter(), new ComponentParameter("someService")
The default constructor for the component parameter indicates auto-wiring should take place for
that parameter.
new Parameter[0]
addComponent
in interface MutablePicoContainer
componentKey
- componentImplementationOrInstance
- parameters
-
Parameter
,
ConstantParameter
,
ComponentParameter
public MutablePicoContainer addComponent(Object implOrInstance)
addComponent(componentImplementation, componentImplementation)
.
addComponent
in interface MutablePicoContainer
implOrInstance
-
MutablePicoContainer.addComponent(java.lang.Object)
public MutablePicoContainer addConfig(String name, Object val)
MutablePicoContainer
addConfig
in interface MutablePicoContainer
name
- the name of the config itemval
- the value of the config item
public boolean removeChildContainer(PicoContainer child)
removeChildContainer
in interface MutablePicoContainer
child
-
MutablePicoContainer.removeChildContainer(org.picocontainer.PicoContainer)
public void start()
start
in interface Startable
Startable.start()
public void stop()
Disposable
if you need a single call at the definite end of the lifecycle.
stop
in interface Startable
Startable.stop()
public ComponentAdapter removeComponent(Object componentKey)
removeComponent
in interface MutablePicoContainer
componentKey
-
MutablePicoContainer.removeComponent(java.lang.Object)
public ComponentAdapter removeComponentByInstance(Object componentInstance)
removeComponentByInstance
in interface MutablePicoContainer
componentInstance
-
MutablePicoContainer.removeComponentByInstance(java.lang.Object)
public org.apache.log4j.Logger getLoggerUsed()
public MutablePicoContainer change(Properties... properties)
MutablePicoContainer
change
in interface MutablePicoContainer
public MutablePicoContainer as(Properties... properties)
MutablePicoContainer
as
in interface MutablePicoContainer
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |