|
||||||||||
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 org.picocontainer.classname.DefaultClassLoadingPicoContainer
public class DefaultClassLoadingPicoContainer
Default implementation of ClassLoadingPicoContainer.
Field Summary | |
---|---|
protected Map<String,PicoContainer> |
namedChildContainers
|
Constructor Summary | |
---|---|
DefaultClassLoadingPicoContainer()
|
|
DefaultClassLoadingPicoContainer(ClassLoader classLoader)
|
|
DefaultClassLoadingPicoContainer(ClassLoader classLoader,
ComponentFactory componentFactory,
PicoContainer parent)
|
|
DefaultClassLoadingPicoContainer(ClassLoader classLoader,
MutablePicoContainer delegate)
|
|
DefaultClassLoadingPicoContainer(ClassLoader classLoader,
PicoContainer parent,
ComponentMonitor componentMonitor)
|
|
DefaultClassLoadingPicoContainer(ComponentFactory componentFactory)
|
|
DefaultClassLoadingPicoContainer(ComponentFactory componentFactory,
LifecycleStrategy lifecycleStrategy,
PicoContainer parent,
ClassLoader cl,
ComponentMonitor componentMonitor)
|
|
DefaultClassLoadingPicoContainer(MutablePicoContainer delegate)
|
|
DefaultClassLoadingPicoContainer(PicoContainer parent)
|
Method Summary | |
---|---|
MutablePicoContainer |
addAdapter(ComponentAdapter<?> componentAdapter)
Register a component via a ComponentAdapter. |
MutablePicoContainer |
addChildContainer(PicoContainer child)
Add a child container. |
ClassLoadingPicoContainer |
addChildContainer(String name,
PicoContainer child)
Addes a child container with a given name |
ClassPathElement |
addClassLoaderURL(URL url)
Adds a new URL that will be used in classloading |
MutablePicoContainer |
addComponent(Object implOrInstance)
Register an arbitrary object. |
MutablePicoContainer |
addComponent(Object key,
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 |
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 |
changeMonitor(ComponentMonitor monitor)
Propagates the monitor change down the delegate chain if a delegate that implements ComponentMonitorStrategy exists. |
protected DefaultClassLoadingPicoContainer |
createChildContainer()
|
ComponentMonitor |
currentMonitor()
Returns the monitor currently used |
Object |
getComponent(Object componentKeyOrType)
Retrieve a component instance registered with a specific key or type. |
ComponentAdapter<?> |
getComponentAdapter(Object componentKey)
Find a component adapter associated with the specified key. |
ClassLoader |
getComponentClassLoader()
Returns class loader that is the aggregate of the URLs added. |
protected Map<String,PicoContainer> |
getNamedContainers()
|
MutablePicoContainer |
makeChildContainer()
Make a child container, using the same implementation of MutablePicoContainer as the parent. |
ClassLoadingPicoContainer |
makeChildContainer(String name)
Makes a child container with the same basic characteristics of this object (ComponentFactory, PicoContainer type, Behavior, etc) |
boolean |
removeChildContainer(PicoContainer child)
Remove a child container from this container. |
Methods inherited from class org.picocontainer.containers.AbstractDelegatingMutablePicoContainer |
---|
addConfig, dispose, getDelegate, removeComponent, removeComponentByInstance, setLifecycleState, setName, start, stop |
Methods inherited from class org.picocontainer.containers.AbstractDelegatingPicoContainer |
---|
accept, equals, getComponent, getComponent, getComponent, 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.MutablePicoContainer |
---|
addConfig, removeComponent, removeComponentByInstance, setLifecycleState, setName |
Methods inherited from interface org.picocontainer.PicoContainer |
---|
accept, getComponent, getComponent, getComponent, 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 |
Field Detail |
---|
protected final Map<String,PicoContainer> namedChildContainers
Constructor Detail |
---|
public DefaultClassLoadingPicoContainer(ClassLoader classLoader, ComponentFactory componentFactory, PicoContainer parent)
public DefaultClassLoadingPicoContainer(ClassLoader classLoader, MutablePicoContainer delegate)
public DefaultClassLoadingPicoContainer(ClassLoader classLoader, PicoContainer parent, ComponentMonitor componentMonitor)
public DefaultClassLoadingPicoContainer(ComponentFactory componentFactory)
public DefaultClassLoadingPicoContainer(PicoContainer parent)
public DefaultClassLoadingPicoContainer(MutablePicoContainer delegate)
public DefaultClassLoadingPicoContainer(ClassLoader classLoader)
public DefaultClassLoadingPicoContainer()
public DefaultClassLoadingPicoContainer(ComponentFactory componentFactory, LifecycleStrategy lifecycleStrategy, PicoContainer parent, ClassLoader cl, ComponentMonitor componentMonitor)
Method Detail |
---|
protected DefaultClassLoadingPicoContainer createChildContainer()
public void changeMonitor(ComponentMonitor monitor)
changeMonitor
in interface ComponentMonitorStrategy
monitor
- the monitor to swap.
IllegalStateException
- if no delegate can be found that implements ComponentMonitorStrategy.public ComponentMonitor currentMonitor()
ComponentMonitorStrategy
currentMonitor
in interface ComponentMonitorStrategy
public final Object getComponent(Object componentKeyOrType) throws PicoException
PicoContainer
getComponent
in interface PicoContainer
getComponent
in class AbstractDelegatingPicoContainer
componentKeyOrType
- the key or Type that the component was registered with.
null
if no component has been registered for the specified
key.
PicoException
public final MutablePicoContainer makeChildContainer()
MutablePicoContainer
makeChildContainer
in interface MutablePicoContainer
makeChildContainer
in class AbstractDelegatingMutablePicoContainer
public ClassLoadingPicoContainer makeChildContainer(String name)
makeChildContainer
in interface ClassLoadingPicoContainer
name
- the name of the child container
public boolean removeChildContainer(PicoContainer child)
MutablePicoContainer
removeChildContainer
in interface MutablePicoContainer
removeChildContainer
in class AbstractDelegatingMutablePicoContainer
child
- the child container
true
if the child container has been removed.protected final Map<String,PicoContainer> getNamedContainers()
public ClassPathElement addClassLoaderURL(URL url)
ClassLoadingPicoContainer
addClassLoaderURL
in interface ClassLoadingPicoContainer
url
- url of the jar to find components in.
public MutablePicoContainer addComponent(Object implOrInstance)
MutablePicoContainer
addComponent(componentImplementation, componentImplementation)
.
addComponent
in interface MutablePicoContainer
addComponent
in class AbstractDelegatingMutablePicoContainer
implOrInstance
- Component implementation or instance
public MutablePicoContainer addComponent(Object key, Object componentImplementationOrInstance, Parameter... parameters)
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
addComponent
in class AbstractDelegatingMutablePicoContainer
key
- 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.
Parameter
,
ConstantParameter
,
ComponentParameter
public MutablePicoContainer addAdapter(ComponentAdapter<?> componentAdapter) throws PicoCompositionException
MutablePicoContainer
addAdapter
in interface MutablePicoContainer
addAdapter
in class AbstractDelegatingMutablePicoContainer
componentAdapter
- the adapter
PicoCompositionException
- if registration fails.public ClassLoader getComponentClassLoader()
ClassLoadingPicoContainer
getComponentClassLoader
in interface ClassLoadingPicoContainer
public MutablePicoContainer addChildContainer(PicoContainer child)
MutablePicoContainer
addChildContainer
in interface MutablePicoContainer
addChildContainer
in class AbstractDelegatingMutablePicoContainer
child
- the child container
public ClassLoadingPicoContainer addChildContainer(String name, PicoContainer child)
ClassLoadingPicoContainer
addChildContainer
in interface ClassLoadingPicoContainer
name
- the container namechild
- the child PicoContainerpublic ComponentAdapter<?> getComponentAdapter(Object componentKey)
PicoContainer
getComponentAdapter
in interface PicoContainer
getComponentAdapter
in class AbstractDelegatingPicoContainer
componentKey
- the key that the component was registered with.
null
if no component has been
registered for the specified key.public MutablePicoContainer change(Properties... properties)
MutablePicoContainer
change
in interface MutablePicoContainer
change
in class AbstractDelegatingMutablePicoContainer
public MutablePicoContainer as(Properties... properties)
MutablePicoContainer
as
in interface MutablePicoContainer
as
in class AbstractDelegatingMutablePicoContainer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |