Clover coverage report - PicoContainer - 1.0-RC-1
Coverage timestamp: Tue May 18 2004 16:19:33 EDT
file stats: LOC: 121   Methods: 0
NCLOC: 15   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
PicoContainer.java - - - -
coverage
 1   
 /*****************************************************************************
 2   
  * Copyright (C) PicoContainer Organization. All rights reserved.            *
 3   
  * ------------------------------------------------------------------------- *
 4   
  * The software in this package is published under the terms of the BSD      *
 5   
  * style license a copy of which has been included with this distribution in *
 6   
  * the LICENSE.txt file.                                                     *
 7   
  *                                                                           *
 8   
  * Original code by                                                          *
 9   
  *****************************************************************************/
 10   
 package org.picocontainer;
 11   
 
 12   
 import java.util.Collection;
 13   
 import java.util.List;
 14   
 
 15   
 /**
 16   
  * This is the core interface for PicoContainer. It is used to retrieve component instances from the container; it only
 17   
  * has accessor methods (in addition to  the {@link #verify()} method). In order to register components in a
 18   
  * PicoContainer, use a {@link MutablePicoContainer}, such as {@link org.picocontainer.defaults.DefaultPicoContainer}.
 19   
  * 
 20   
  * @see "The <a href='package-summary.html#package_description'>The package description</a> has a basic overview of how to use the picocontainer package."
 21   
  * 
 22   
  * @author Paul Hammant
 23   
  * @author Aslak Helles&oslash;y
 24   
  * @author Jon Tirs&eacute;n
 25   
  * @version $Revision: 1.35 $
 26   
  * @since 1.0
 27   
  */
 28   
 public interface PicoContainer extends Startable, Disposable {
 29   
 
 30   
     /**
 31   
      * Retrieve a component instance registered with a specific key. If a component cannot be found in this container,
 32   
      * the parent container (if one exists) will be searched.
 33   
      * 
 34   
      * @param componentKey the key that the component was registered with.
 35   
      * @return an instantiated component, or <code>null</code> if no component has been registered for the specified
 36   
      *         key.
 37   
      */
 38   
     Object getComponentInstance(Object componentKey);
 39   
 
 40   
     /**
 41   
      * Find a component instance matching the specified type.
 42   
      * 
 43   
      * @param componentType the type of the component.
 44   
      * @return the adapter matching the class.
 45   
      */
 46   
     Object getComponentInstanceOfType(Class componentType);
 47   
 
 48   
     /**
 49   
      * Retrieve all the registered component instances in the container, (not including those in the parent container).
 50   
      * The components are returned in their order of instantiation, which depends on the dependency order between them.
 51   
      * 
 52   
      * @return all the components.
 53   
      */
 54   
     List getComponentInstances();
 55   
 
 56   
     /**
 57   
      * Retrieve the parent container of this container.
 58   
      * 
 59   
      * @return a {@link PicoContainer} instance, or <code>null</code> if this container does not have a parent.
 60   
      */
 61   
     PicoContainer getParent();
 62   
 
 63   
     /**
 64   
      * Find a component adapter associated with the specified key. If a component adapter cannot be found in this
 65   
      * container, the parent container (if one exists) will be searched.
 66   
      * 
 67   
      * @param componentKey the key that the component was registered with.
 68   
      * @return the component adapter associated with this key, or <code>null</code> if no component has been registered
 69   
      *         for the specified key.
 70   
      */
 71   
     ComponentAdapter getComponentAdapter(Object componentKey);
 72   
 
 73   
     /**
 74   
      * Find a component adapter associated with the specified type. If a component adapter cannot be found in this
 75   
      * container, the parent container (if one exists) will be searched.
 76   
      * 
 77   
      * @param componentType the type of the component.
 78   
      * @return the component adapter associated with this class, or <code>null</code> if no component has been
 79   
      *         registered for the specified key.
 80   
      */
 81   
     ComponentAdapter getComponentAdapterOfType(Class componentType);
 82   
 
 83   
     /**
 84   
      * Retrieve all the component adapters inside this container. The component adapters from the parent container are
 85   
      * not returned.
 86   
      * 
 87   
      * @see #getComponentAdaptersOfType(Class) a variant of this method which returns the component adapters inside this
 88   
      * container that are associated with the specified type.
 89   
      * 
 90   
      * @return a collection containing all the {@link ComponentAdapter}s inside this container. The collection will
 91   
      *         not be modifiable.
 92   
      */
 93   
     Collection getComponentAdapters();
 94   
 
 95   
     /**
 96   
      * Retrieve all component adapters inside this container that are associated with the specified type. The component
 97   
      * adapters from the parent container are not returned.
 98   
      * 
 99   
      * @param componentType the type of the components.
 100   
      * @return a collection containing all the {@link ComponentAdapter}s inside this container that are associated with
 101   
      *         the specified type. Changes to this collection will not be reflected in the container itself.
 102   
      */ 
 103   
     List getComponentAdaptersOfType(Class componentType);
 104   
 
 105   
     /**
 106   
      * Verify that the dependencies for all the registered components can be satisfied. No components are
 107   
      * instantiated during the verification process.
 108   
      * 
 109   
      * @throws PicoVerificationException if there are unsatisifiable dependencies.
 110   
      */
 111   
     void verify() throws PicoVerificationException;
 112   
 
 113   
     /**
 114   
      * Callback method from the implementation to keep track of the instantiation order. <b>This method is not intended
 115   
      * to be called explicitly by clients of the API!</b>
 116   
      * 
 117   
      * @param componentAdapter the freshly added {@link ComponentAdapter}
 118   
      */
 119   
     void addOrderedComponentAdapter(ComponentAdapter componentAdapter);
 120   
 }
 121