avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container DefaultContainer.java
Date Tue, 16 Jul 2002 08:58:20 GMT
mcconnell    2002/07/16 01:58:19

  Modified:    assembly/src/java/org/apache/excalibur/merlin/container
                        DefaultContainer.java
  Log:
  enhanded path management
  
  Revision  Changes    Path
  1.10      +13 -4     jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/DefaultContainer.java
  
  Index: DefaultContainer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/DefaultContainer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultContainer.java	15 Jul 2002 02:12:24 -0000	1.9
  +++ DefaultContainer.java	16 Jul 2002 08:58:19 -0000	1.10
  @@ -52,7 +52,6 @@
   import org.apache.avalon.framework.service.DefaultServiceManager;
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.Version;
  -import org.apache.avalon.framework.ExceptionUtil;
   import org.apache.avalon.excalibur.extension.PackageRepository;
   import org.apache.avalon.excalibur.extension.Extension;
   import org.apache.avalon.excalibur.extension.OptionalPackage;
  @@ -169,6 +168,7 @@
   
       private ProfileBuilder m_builder = new ProfileBuilder();
   
  +    private boolean m_initialized = false;
   
       //=======================================================================
       // Contextualizable
  @@ -270,6 +270,9 @@
               getLogger().debug("container: " + containers[i].getName() );
               m_containers.add( createContainer( containers[i] ) );
           }
  +
  +        m_initialized = true;
  +
       }
   
       //=======================================================================
  @@ -467,6 +470,9 @@
       */
       public ResourceDesignator[] getResources()
       {
  +        if( !m_initialized )
  +          throw new IllegalStateException("not-initialized");
  +
           ArrayList list = new ArrayList();
           getResources( list );
           return (ResourceDesignator[]) list.toArray( new ResourceDesignator[0] );
  @@ -492,8 +498,11 @@
           for( int i=0; i<profiles.length; i++ )
           {
               Profile profile = profiles[i];
  -            String name = getPath() + "/" + profile.getName();
  -            m_designators.add( new ProfileDesignator( name, profile, m_helper, m_provider
) );
  +            if( this.contains( profile ) )
  +            {
  +                String name = getPath() + "/" + profile.getName();
  +                m_designators.add( new ProfileDesignator( name, profile, m_helper, m_provider
) );
  +            }
           }
       }
   
  
  
  

--
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