|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.picocontainer.containers.AbstractDelegatingPicoContainer org.picocontainer.containers.AbstractDelegatingMutablePicoContainer
public abstract class AbstractDelegatingMutablePicoContainer
abstract base class for delegating to mutable containers
Constructor Summary | |
---|---|
AbstractDelegatingMutablePicoContainer(MutablePicoContainer delegate)
|
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. |
|
void |
dispose()
Dispose this component. |
|
MutablePicoContainer |
getDelegate()
|
|
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. |
|
void |
start()
Start this component. |
|
void |
stop()
Stop this component. |
Methods inherited from class org.picocontainer.containers.AbstractDelegatingPicoContainer |
---|
accept, equals, getComponent, getComponent, getComponent, getComponent, getComponentAdapter, getComponentAdapter, getComponentAdapter, getComponentAdapters, getComponentAdapters, getComponentAdapters, getComponents, getComponents, getConverters, getParent, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.picocontainer.PicoContainer |
---|
accept, getComponent, getComponent, getComponent, getComponent, getComponentAdapter, getComponentAdapter, getComponentAdapter, getComponentAdapters, getComponentAdapters, getComponentAdapters, getComponents, getComponents, getParent |
Constructor Detail |
---|
public AbstractDelegatingMutablePicoContainer(MutablePicoContainer delegate)
Method Detail |
---|
public MutablePicoContainer addComponent(Object componentKey, Object componentImplementationOrInstance, Parameter... parameters) throws PicoCompositionException
MutablePicoContainer
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
- 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
MutablePicoContainer
addComponent(componentImplementation, componentImplementation)
.
addComponent
in interface MutablePicoContainer
implOrInstance
- Component implementation or instance
PicoCompositionException
- if registration fails.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 MutablePicoContainer addAdapter(ComponentAdapter<?> componentAdapter) throws PicoCompositionException
MutablePicoContainer
addAdapter
in interface MutablePicoContainer
componentAdapter
- the adapter
PicoCompositionException
- if registration fails.public <T> ComponentAdapter<T> removeComponent(Object componentKey)
MutablePicoContainer
removeComponent
in interface MutablePicoContainer
componentKey
- key of the component to unregister.
public <T> ComponentAdapter<T> removeComponentByInstance(T componentInstance)
MutablePicoContainer
removeComponentByInstance
in interface MutablePicoContainer
componentInstance
- the component instance to unregister.
public MutablePicoContainer addChildContainer(PicoContainer child)
MutablePicoContainer
addChildContainer
in interface MutablePicoContainer
child
- the child container
public boolean removeChildContainer(PicoContainer child)
MutablePicoContainer
removeChildContainer
in interface MutablePicoContainer
child
- the child container
true
if the child container has been removed.public MutablePicoContainer change(Properties... properties)
MutablePicoContainer
change
in interface MutablePicoContainer
public MutablePicoContainer as(Properties... properties)
MutablePicoContainer
as
in interface MutablePicoContainer
public void dispose()
Disposable
dispose
in interface Disposable
public MutablePicoContainer makeChildContainer()
MutablePicoContainer
makeChildContainer
in interface MutablePicoContainer
public void start()
Startable
start
in interface Startable
public void stop()
Startable
Disposable
if you need a single call at the definite end of the lifecycle.
stop
in interface Startable
public MutablePicoContainer getDelegate()
getDelegate
in class AbstractDelegatingPicoContainer
public void setName(String name)
MutablePicoContainer
setName
in interface MutablePicoContainer
name
- the name to call it.public void setLifecycleState(LifecycleState lifecycleState)
MutablePicoContainer
setLifecycleState
in interface MutablePicoContainer
lifecycleState
- the lifecyle state to use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |