|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.picocontainer.containers.AbstractDelegatingMutablePicoContainer
public abstract class AbstractDelegatingMutablePicoContainer
| Constructor Summary | |
|---|---|
AbstractDelegatingMutablePicoContainer(MutablePicoContainer delegate)
|
|
| Method Summary | ||
|---|---|---|
void |
accept(PicoVisitor visitor)
Accepts a visitor that should visit the child containers, component adapters and component instances. |
|
MutablePicoContainer |
addAdapter(ComponentAdapter componentAdapter)
Register a component via a ComponentAdapter. |
|
MutablePicoContainer |
addChildContainer(PicoContainer child)
Add a child container. |
|
MutablePicoContainer |
addComponent(Object implOrInstance)
Register an arbitrary object. |
|
MutablePicoContainer |
addComponent(Object componentKey,
Object componentImplementationOrInstance,
Parameter... parameters)
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)
Register a config item. |
|
MutablePicoContainer |
as(Properties... properties)
You can set for the following operation only the characteristic of registration of a component on the fly. |
|
MutablePicoContainer |
change(Properties... properties)
You can change the characteristic of registration of all subsequent components in this container. |
|
void |
dispose()
Dispose this component. |
|
boolean |
equals(Object obj)
|
|
|
getComponent(Class<T> componentType)
|
|
Object |
getComponent(Object componentKeyOrType)
Retrieve a component instance registered with a specific key or type. |
|
|
getComponentAdapter(Class<T> componentType,
ParameterName componentParameterName)
Find a component adapter associated with the specified type. |
|
ComponentAdapter<?> |
getComponentAdapter(Object componentKey)
Find a component adapter associated with the specified key. |
|
Collection<ComponentAdapter<?>> |
getComponentAdapters()
Retrieve all the component adapters inside this container. |
|
|
getComponentAdapters(Class<T> componentType)
Retrieve all component adapters inside this container that are associated with the specified type. |
|
List |
getComponents()
Retrieve all the registered component instances in the container, (not including those in the parent container). |
|
|
getComponents(Class<T> type)
Returns a List of components of a certain componentType. |
|
protected MutablePicoContainer |
getDelegate()
|
|
PicoContainer |
getParent()
Retrieve the parent container of this container. |
|
boolean |
removeChildContainer(PicoContainer child)
Remove a child container from this container. |
|
ComponentAdapter |
removeComponent(Object componentKey)
Unregister a component by key. |
|
ComponentAdapter |
removeComponentByInstance(Object componentInstance)
Unregister a component by instance. |
|
void |
start()
Start this component. |
|
void |
stop()
Stop this component. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.picocontainer.MutablePicoContainer |
|---|
makeChildContainer |
| Constructor Detail |
|---|
public AbstractDelegatingMutablePicoContainer(MutablePicoContainer delegate)
| Method Detail |
|---|
protected MutablePicoContainer getDelegate()
public MutablePicoContainer addComponent(Object componentKey,
Object componentImplementationOrInstance,
Parameter... parameters)
throws PicoCompositionException
MutablePicoContainernew 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 MutablePicoContainercomponentKey - a key that identifies the component. Must be unique within the container. The type
of the key object has no semantic significance unless explicitly specified in the
documentation of the implementing container.componentImplementationOrInstance - the component's implementation class. This must be a concrete class (ie, a
class that can be instantiated). Or an intance of the compoent.parameters - the parameters that gives the container hints about what arguments to pass
to the constructor when it is instantiated. Container implementations may ignore
one or more of these hints.
PicoCompositionException - if registration of the component fails.Parameter,
ConstantParameter,
ComponentParameter
public MutablePicoContainer addComponent(Object implOrInstance)
throws PicoCompositionException
MutablePicoContaineraddComponent(componentImplementation, componentImplementation).
addComponent in interface MutablePicoContainerimplOrInstance - Component implementation or instance
PicoCompositionException - if registration fails.
public MutablePicoContainer addConfig(String name,
Object val)
MutablePicoContainer
addConfig in interface MutablePicoContainername - the name of the config itemval - the value of the config item
public MutablePicoContainer addAdapter(ComponentAdapter componentAdapter)
throws PicoCompositionException
MutablePicoContainer
addAdapter in interface MutablePicoContainercomponentAdapter - the addAdapter
PicoCompositionException - if registration fails.public ComponentAdapter removeComponent(Object componentKey)
MutablePicoContainer
removeComponent in interface MutablePicoContainercomponentKey - key of the component to unregister.
public ComponentAdapter removeComponentByInstance(Object componentInstance)
MutablePicoContainer
removeComponentByInstance in interface MutablePicoContainercomponentInstance - the component instance to unregister.
public Object getComponent(Object componentKeyOrType)
PicoContainer
getComponent in interface PicoContainercomponentKeyOrType - the key or Type that the component was registered with.
null if no component has been registered for the specified
key.public <T> T getComponent(Class<T> componentType)
getComponent in interface PicoContainerpublic List getComponents()
PicoContainer
getComponents in interface PicoContainerpublic PicoContainer getParent()
PicoContainer
getParent in interface PicoContainerPicoContainer instance, or null if this container does not have a parent.public ComponentAdapter<?> getComponentAdapter(Object componentKey)
PicoContainer
getComponentAdapter in interface PicoContainercomponentKey - the key that the component was registered with.
null if no component has been
registered for the specified key.
public <T> ComponentAdapter<T> getComponentAdapter(Class<T> componentType,
ParameterName componentParameterName)
PicoContainer
getComponentAdapter in interface PicoContainercomponentType - the type of the component.
null if no component has been
registered for the specified key.public Collection<ComponentAdapter<?>> getComponentAdapters()
PicoContainer
getComponentAdapters in interface PicoContainerComponentAdapters inside this container. The collection will not
be modifiable.a variant of this method which returns the component adapters inside this
container that are associated with the specified type.public <T> List<ComponentAdapter<T>> getComponentAdapters(Class<T> componentType)
PicoContainer
getComponentAdapters in interface PicoContainercomponentType - the type of the components.
ComponentAdapters inside this container that are associated with
the specified type. Changes to this collection will not be reflected in the container itself.public void start()
Startable
start in interface Startablepublic void stop()
StartableDisposable if you need a single call at the definite end of the lifecycle.
stop in interface Startablepublic void dispose()
Disposable
dispose in interface Disposablepublic MutablePicoContainer addChildContainer(PicoContainer child)
MutablePicoContainer
addChildContainer in interface MutablePicoContainerchild - the child container
public boolean removeChildContainer(PicoContainer child)
MutablePicoContainer
removeChildContainer in interface MutablePicoContainerchild - the child container
true if the child container has been removed.public void accept(PicoVisitor visitor)
PicoContainer
accept in interface PicoContainervisitor - the visitor
public <T> List<T> getComponents(Class<T> type)
throws PicoException
PicoContainer
getComponents in interface PicoContainertype - the searched type.
PicoException - if the instantiation of a component failspublic boolean equals(Object obj)
equals in class Objectpublic MutablePicoContainer change(Properties... properties)
MutablePicoContainer
change in interface MutablePicoContainerpublic 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 | |||||||||