|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MutablePicoContainer
This is the core interface used for registration of components with a container. It is possible to register implementations and instances here
Method Summary | ||
---|---|---|
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. |
|
MutablePicoContainer |
makeChildContainer()
Make a child container, using the same implementation of MutablePicoContainer as the parent. |
|
boolean |
removeChildContainer(PicoContainer child)
Remove a child container from this container. |
|
|
removeComponent(Object componentKey)
Unregister a component by key. |
|
|
removeComponentByInstance(T componentInstance)
Unregister a component by instance. |
|
void |
setLifecycleState(LifecycleState lifecycleState)
To assist ThreadLocal usage, LifecycleState can be set. |
|
void |
setName(String name)
Name the container instance, to assit debugging. |
Methods inherited from interface org.picocontainer.PicoContainer |
---|
accept, getComponent, getComponent, getComponent, getComponent, getComponentAdapter, getComponentAdapter, getComponentAdapter, getComponentAdapters, getComponentAdapters, getComponentAdapters, getComponents, getComponents, getParent |
Methods inherited from interface org.picocontainer.Startable |
---|
start, stop |
Methods inherited from interface org.picocontainer.Disposable |
---|
dispose |
Method Detail |
---|
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]
componentKey
- 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
MutablePicoContainer addComponent(Object implOrInstance)
addComponent(componentImplementation, componentImplementation)
.
implOrInstance
- Component implementation or instance
PicoCompositionException
- if registration fails.MutablePicoContainer addConfig(String name, Object val)
name
- the name of the config itemval
- the value of the config item
PicoCompositionException
- if registration fails.MutablePicoContainer addAdapter(ComponentAdapter<?> componentAdapter)
componentAdapter
- the adapter
PicoCompositionException
- if registration fails.<T> ComponentAdapter<T> removeComponent(Object componentKey)
componentKey
- key of the component to unregister.
<T> ComponentAdapter<T> removeComponentByInstance(T componentInstance)
componentInstance
- the component instance to unregister.
MutablePicoContainer makeChildContainer()
MutablePicoContainer addChildContainer(PicoContainer child)
child
- the child container
boolean removeChildContainer(PicoContainer child)
child
- the child container
true
if the child container has been removed.MutablePicoContainer change(Properties... properties)
properties
-
MutablePicoContainer as(Properties... properties)
properties
-
void setName(String name)
name
- the name to call it.void setLifecycleState(LifecycleState lifecycleState)
lifecycleState
- the lifecyle state to use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |