avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pro...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress AbstractContainer.java
Date Mon, 17 Jun 2002 18:50:33 GMT
proyal      2002/06/17 11:50:33

  Modified:    fortress/src/java/org/apache/excalibur/fortress
                        AbstractContainer.java
  Log:
   * Copy the value when re-writing configurations
   * ComponentManager now immediately throws the ComponentException when a
   lookup fails and the component is one that it manages.
  
  Revision  Changes    Path
  1.38      +16 -3     jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/AbstractContainer.java
  
  Index: AbstractContainer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/AbstractContainer.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- AbstractContainer.java	13 Jun 2002 19:46:34 -0000	1.37
  +++ AbstractContainer.java	17 Jun 2002 18:50:33 -0000	1.38
  @@ -186,12 +186,16 @@
                                                 + ", location: " + configItem.getLocation()
+ "]" );
           }
   
  +        //This whole copying bit can maybe be replaced with the forthcoming ConfigurationUtil.branch()
?
  +
           //We set these before copying all other attributes so the class / handler can be
overriden if needed if
           //the shorthand name is used
           temp.setAttribute( "role", role );
           temp.setAttribute( "class", klass.getName() );
           temp.setAttribute( "handler", handlerKlass.getName() );
   
  +        temp.setValue( configItem.getValue( null ) );
  +
           String[] attributes = configItem.getAttributeNames();
           for( int i = 0; i < attributes.length; i++ )
           {
  @@ -520,8 +524,17 @@
               }
               catch( ComponentException ce )
               {
  -                //                ce.printStackTrace( System.err );
  -                if( null != m_parent )
  +                /* Logic is thus:
  +                 *  If we have the component and the get threw an exception, we need to
report that.
  +                 *  Otherwise, do the lookup on our parent
  +                 *  Otherwise, just throw the exception
  +                 */
  +                if( m_components.has( role, null )  )
  +                {
  +                    throw ce;
  +
  +                }
  +                else if( null != m_parent )
                   {
                       return m_parent.lookup( role );
                   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message