org.picocontainer.defaults
Class NullPicoContainer

java.lang.Object
  extended byorg.picocontainer.defaults.NullPicoContainer
All Implemented Interfaces:
Disposable, PicoContainer, Startable

public class NullPicoContainer
extends java.lang.Object
implements PicoContainer


Constructor Summary
NullPicoContainer()
           
 
Method Summary
 void addOrderedComponentAdapter(ComponentAdapter componentAdapter)
          Callback method from the implementation to keep track of the instantiation order.
 void dispose()
           
 ComponentAdapter getComponentAdapter(java.lang.Object componentKey)
          Finds a ComponentAdapter matching the key, looking in parent if not found in self (unless parent is null).
 ComponentAdapter getComponentAdapterOfType(java.lang.Class componentType)
          Finds a ComponentAdapter matching the type, looking in parent if not found in self (unless parent is null).
 java.util.Collection getComponentAdapters()
          Returns all adapters (not including the adapters from the parent).
 java.lang.Object getComponentInstance(java.lang.Object componentKey)
          Gets a component instance registered with a specific key.
 java.lang.Object getComponentInstanceOfType(java.lang.Class componentType)
          Finds a component instance matching the type, looking in parent if not found in self (unless parent is null).
 java.util.List getComponentInstances()
          Gets all the registered component instances in the container, (not including those in the parent container).
 PicoContainer getParent()
          Get the parent container of this container.
 void start()
           
 void stop()
           
 void verify()
          Verifies that the dependencies for all the registered components can be satisfied None of the components are instantiated during the verification process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullPicoContainer

public NullPicoContainer()
Method Detail

getComponentInstance

public java.lang.Object getComponentInstance(java.lang.Object componentKey)
Description copied from interface: PicoContainer
Gets a component instance registered with a specific key.

Specified by:
getComponentInstance in interface PicoContainer
Parameters:
componentKey - key the component was registered with.
Returns:
an instantiated component.

getComponentInstanceOfType

public java.lang.Object getComponentInstanceOfType(java.lang.Class componentType)
Description copied from interface: PicoContainer
Finds a component instance matching the type, looking in parent if not found in self (unless parent is null).

Specified by:
getComponentInstanceOfType in interface PicoContainer
Parameters:
componentType - type of the component.
Returns:
the adapter matching the class.

getComponentInstances

public java.util.List getComponentInstances()
Description copied from interface: PicoContainer
Gets all the registered component instances in the container, (not including those in the parent container). The components are returned in their order of instantiation, which depends on the dependency order between them.

Specified by:
getComponentInstances in interface PicoContainer
Returns:
all the components.

getParent

public PicoContainer getParent()
Description copied from interface: PicoContainer
Get the parent container of this container.

Specified by:
getParent in interface PicoContainer
Returns:
a Collection of PicoContainer.

getComponentAdapter

public ComponentAdapter getComponentAdapter(java.lang.Object componentKey)
Description copied from interface: PicoContainer
Finds a ComponentAdapter matching the key, looking in parent if not found in self (unless parent is null).

Specified by:
getComponentAdapter in interface PicoContainer
Parameters:
componentKey - key of the component.
Returns:
the adapter matching the key.

getComponentAdapterOfType

public ComponentAdapter getComponentAdapterOfType(java.lang.Class componentType)
Description copied from interface: PicoContainer
Finds a ComponentAdapter matching the type, looking in parent if not found in self (unless parent is null).

Specified by:
getComponentAdapterOfType in interface PicoContainer
Parameters:
componentType - type of the component.
Returns:
the adapter matching the class.

getComponentAdapters

public java.util.Collection getComponentAdapters()
Description copied from interface: PicoContainer
Returns all adapters (not including the adapters from the parent).

Specified by:
getComponentAdapters in interface PicoContainer
Returns:
Collection of ComponentAdapter.

verify

public void verify()
            throws PicoVerificationException
Description copied from interface: PicoContainer
Verifies that the dependencies for all the registered components can be satisfied None of the components are instantiated during the verification process.

Specified by:
verify in interface PicoContainer
Throws:
PicoVerificationException - if there are unsatisifiable dependencies.

addOrderedComponentAdapter

public void addOrderedComponentAdapter(ComponentAdapter componentAdapter)
Description copied from interface: PicoContainer
Callback method from the implementation to keep track of the instantiation order. This method is not intended to be called explicitly by clients of the API!

Specified by:
addOrderedComponentAdapter in interface PicoContainer

start

public void start()
Specified by:
start in interface Startable

stop

public void stop()
Specified by:
stop in interface Startable

dispose

public void dispose()
Specified by:
dispose in interface Disposable


Copyright © 2003-2004 Codehaus. All Rights Reserved.