public class TieringPicoContainer extends DefaultPicoContainer
DefaultPicoContainer.KnowsContainerAdapter<T>, DefaultPicoContainer.LateInstance
componentFactory, componentMonitor, lifecycleStrategy, orderedComponentAdapters
Constructor and Description |
---|
TieringPicoContainer()
Creates a new container with a
AdaptingBehavior and no parent container. |
TieringPicoContainer(ComponentFactory componentFactory)
Creates a new container with a custom ComponentFactory and no parent container.
|
TieringPicoContainer(ComponentFactory componentFactory,
LifecycleStrategy lifecycleStrategy,
PicoContainer parent)
Creates a new container with a custom ComponentFactory, LifecycleStrategy for instance registration,
and a parent container.
|
TieringPicoContainer(ComponentFactory componentFactory,
LifecycleStrategy lifecycleStrategy,
PicoContainer parent,
ComponentMonitor componentMonitor) |
TieringPicoContainer(ComponentMonitor monitor)
Creates a new container with the AdaptingInjection using a
custom ComponentMonitor
|
TieringPicoContainer(ComponentMonitor monitor,
LifecycleStrategy lifecycleStrategy,
PicoContainer parent)
Creates a new container with the AdaptingInjection using a
custom ComponentMonitor and lifecycle strategy
|
TieringPicoContainer(ComponentMonitor monitor,
PicoContainer parent)
Creates a new container with the AdaptingInjection using a
custom ComponentMonitor
|
TieringPicoContainer(LifecycleStrategy lifecycleStrategy,
PicoContainer parent)
Creates a new container with the AdaptingInjection using a
custom lifecycle strategy
|
TieringPicoContainer(PicoContainer parent)
Creates a new container with a (caching)
AdaptingInjection
and a parent container. |
Modifier and Type | Method and Description |
---|---|
PicoContainer |
getParent()
Retrieve the parent container of this container.
|
MutablePicoContainer |
makeChildContainer()
Make a child container, using both the same implementation of MutablePicoContainer as the parent
and identical behaviors as well.
|
accept, addAdapter, addAdapter, addAdapterInternal, addChildContainer, addComponent, addComponent, addConfig, as, change, changeMonitor, currentMonitor, decorateComponent, dispose, getComponent, getComponent, getComponent, getComponent, getComponent, getComponentAdapter, getComponentAdapter, getComponentAdapter, getComponentAdapters, getComponentAdapters, getComponentAdapters, getComponentKeyToAdapterCache, getComponents, getComponents, getConverters, getLifecycleState, getModifiableComponentAdapterList, getName, getOrderedComponentAdapters, instantiateComponentAsIsStartable, potentiallyStartAdapter, removeChildContainer, removeComponent, removeComponentByInstance, setLifecycleState, setName, start, stop, toString
public TieringPicoContainer(ComponentFactory componentFactory, LifecycleStrategy lifecycleStrategy, PicoContainer parent)
Cached
instances, such as for example
Caching
. Caching can delegate to other ComponentAdapterFactories.
componentFactory
- the factory to use for creation of ComponentAdapters.lifecycleStrategy
- the lifecycle strategy chosen for registered
instance (not implementations!)parent
- the parent container (used for component dependency lookups).public TieringPicoContainer(ComponentFactory componentFactory, LifecycleStrategy lifecycleStrategy, PicoContainer parent, ComponentMonitor componentMonitor)
public TieringPicoContainer(ComponentMonitor monitor, PicoContainer parent)
monitor
- the ComponentMonitor to useparent
- the parent container (used for component dependency lookups).public TieringPicoContainer(ComponentMonitor monitor, LifecycleStrategy lifecycleStrategy, PicoContainer parent)
monitor
- the ComponentMonitor to uselifecycleStrategy
- the lifecycle strategy to use.parent
- the parent container (used for component dependency lookups).public TieringPicoContainer(LifecycleStrategy lifecycleStrategy, PicoContainer parent)
lifecycleStrategy
- the lifecycle strategy to use.parent
- the parent container (used for component dependency lookups).public TieringPicoContainer(ComponentFactory componentFactory)
componentFactory
- the ComponentFactory to use.public TieringPicoContainer(ComponentMonitor monitor)
monitor
- the ComponentMonitor to usepublic TieringPicoContainer(PicoContainer parent)
AdaptingInjection
and a parent container.parent
- the parent container (used for component dependency lookups).public TieringPicoContainer()
AdaptingBehavior
and no parent container.public PicoContainer getParent()
DefaultPicoContainer
getParent
in interface PicoContainer
getParent
in class DefaultPicoContainer
PicoContainer
instance, or null
if this container does not have a parent.public MutablePicoContainer makeChildContainer()
MutablePicoContainer
Note that for long-lived parent containers, you need to unregister child containers made with this call before disposing or you will leak memory. (Experience speaking here! )
Incorrect Example:
MutablePicoContainer parent = new PicoBuilder().withCaching().withLifecycle().build(); MutablePicoContainer child = parent.makeChildContainer(); child = null; //Child still retains in memory because parent still holds reference.
Correct Example:
MutablePicoContainer parent = new PicoBuilder().withCaching().withLifecycle().build(); MutablePicoContainer child = parent.makeChildContainer(); parent.removeChildContainer(child); //Remove the bi-directional references. child = null;
makeChildContainer
in interface MutablePicoContainer
makeChildContainer
in class DefaultPicoContainer
Copyright © 2003–2015 Codehaus. All rights reserved.