You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by do...@apache.org on 2001/02/25 14:15:09 UTC

cvs commit: jakarta-avalon/src/java/org/apache/avalon ComponentManager.java ComponentSelector.java DefaultComponentSelector.java

donaldp     01/02/25 05:15:09

  Modified:    src/java/org/apache/avalon ComponentManager.java
                        ComponentSelector.java
                        DefaultComponentSelector.java
  Log:
  Restyled
  
  Revision  Changes    Path
  1.2       +2 -3      jakarta-avalon/src/java/org/apache/avalon/ComponentManager.java
  
  Index: ComponentManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/ComponentManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ComponentManager.java	2001/02/24 04:01:45	1.1
  +++ ComponentManager.java	2001/02/25 13:15:09	1.2
  @@ -65,8 +65,7 @@
        *                                            instance cannot be created.
        */
       Component lookup( String role ) 
  -        throws ComponentManagerException, ComponentNotFoundException, 
  -               ComponentNotAccessibleException;
  +        throws ComponentManagerException;
   
       /**
        * Return the <code>Component</code> when you are finished with it.  This
  @@ -77,5 +76,5 @@
        *
        * @param component The Component we are releasing.
        */
  -    void release(Component component);
  +    void release( Component component );
   }
  
  
  
  1.2       +2 -3      jakarta-avalon/src/java/org/apache/avalon/ComponentSelector.java
  
  Index: ComponentSelector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/ComponentSelector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ComponentSelector.java	2001/02/24 04:01:45	1.1
  +++ ComponentSelector.java	2001/02/25 13:15:09	1.2
  @@ -61,8 +61,7 @@
        *                                            instance cannot be created.
        */
       Component select( Object hint ) 
  -        throws ComponentManagerException, ComponentNotFoundException, 
  -               ComponentNotAccessibleException;
  +        throws ComponentManagerException;
   
       /**
        * Return the <code>Component</code> when you are finished with it.  This
  @@ -73,5 +72,5 @@
        *
        * @param component The Component we are releasing.
        */
  -    void release(Component component);
  +    void release( Component component );
   }
  
  
  
  1.2       +18 -17    jakarta-avalon/src/java/org/apache/avalon/DefaultComponentSelector.java
  
  Index: DefaultComponentSelector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/DefaultComponentSelector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultComponentSelector.java	2001/02/24 04:01:45	1.1
  +++ DefaultComponentSelector.java	2001/02/25 13:15:09	1.2
  @@ -12,28 +12,28 @@
   /**
    * This is the default implementation of the ComponentSelector
    */
  -public class DefaultComponentSelector implements ComponentSelector {
  +public class DefaultComponentSelector 
  +    implements ComponentSelector
  +{
  +    protected final HashMap m_components = new HashMap();
   
  -    protected final HashMap components = new HashMap();
  -
  -    public DefaultComponentSelector() {
  -        // do nothing
  -    }
  -
       /**
        * Select the desired component.  It does not cascade, neither
        * should it.
        */
  -    public Component select(Object hint)
  -    throws ComponentNotFoundException,
  -           ComponentNotAccessibleException {
  -
  -        final Component component = (Component) components.get(hint);
  +    public Component select( Object hint ) 
  +        throws ComponentManagerException
  +    {
  +        final Component component = (Component)m_components.get( hint );
   
  -        if ( component != null ) {
  +        if( null != component ) 
  +        {
               return component;
  -        } else {
  -            throw new ComponentNotFoundException("Unable to provide implementation for " + hint.toString());
  +        } 
  +        else
  +        {
  +            throw new ComponentNotFoundException( "Unable to provide implementation for " + 
  +                                                  hint.toString() );
           }
       }
   
  @@ -46,7 +46,8 @@
       /**
        * Populate the ComponentSelector.
        */
  -    public void put(final Object hint, final Component component) {
  -        this.components.put(hint, component);
  +    public void put( final Object hint, final Component component )
  +    {
  +        m_components.put( hint, component );
       }
   }