avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/kernel/impl DefaultKernel.java
Date Thu, 06 Mar 2003 12:03:31 GMT
mcconnell    2003/03/06 04:03:31

  Modified:    merlin/src/java/org/apache/avalon/merlin/kernel/impl
                        DefaultKernel.java
  Log:
  Updated to support declaration of a Classpath if anly only if declared with the kernel descriptor.
  
  Revision  Changes    Path
  1.15      +33 -7     avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernel.java
  
  Index: DefaultKernel.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernel.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- DefaultKernel.java	6 Mar 2003 09:15:50 -0000	1.14
  +++ DefaultKernel.java	6 Mar 2003 12:03:31 -0000	1.15
  @@ -75,6 +75,7 @@
   import org.apache.avalon.assembly.engine.Engine;
   import org.apache.avalon.assembly.engine.model.LibraryDescriptor;
   import org.apache.avalon.assembly.engine.model.ClasspathDescriptor;
  +import org.apache.avalon.assembly.engine.model.Classpath;
   import org.apache.avalon.assembly.util.ExceptionHelper;
   import org.apache.avalon.assembly.appliance.Appliance;
   import org.apache.avalon.assembly.appliance.ApplianceContext;
  @@ -405,7 +406,7 @@
   
           try
           {
  -            m_engine = bootstrapEngine( m_logging, m_pool, m_config.getChild( "engine"
) );
  +            m_engine = bootstrapEngine( m_logging, m_pool, m_config.getChild( "engine"
), m_loader );
           }
           catch( Throwable e )
           {
  @@ -631,8 +632,18 @@
           }
       }
   
  +   /**
  +    * Creation of the root engine.
  +    * 
  +    * @param logging the logging manager
  +    * @param pool the pool manager
  +    * @param config the engine configuration from which extension paths and 
  +    *    classpath declarations are resolved
  +    * @param loader the system classloader
  +    * @return the engine
  +    */
       private EngineClassLoader bootstrapEngine( 
  -      LoggingManager logging, PoolManager pool, Configuration config ) 
  +      LoggingManager logging, PoolManager pool, Configuration config, ClassLoader loader
) 
         throws Exception
       {
           if( m_home == null )
  @@ -655,17 +666,32 @@
   
           Configuration lib = config.getChild( "library", false );
   
  -        ClasspathDescriptor classpath = 
  -          CREATOR.createClasspathDescriptor( config.getChild( "classpath" ) );
  +        Classpath classpath = null;
  +        Configuration classpathConfig = config.getChild( "classpath", false );
  +        if( classpathConfig != null )
  +        {
  +            ClasspathDescriptor descriptor = 
  +              CREATOR.createClasspathDescriptor( classpathConfig );
  +            try
  +            {
  +                classpath = new Classpath( m_url, descriptor );
  +            }
  +            catch( IllegalArgumentException iae )
  +            {
  +                final String error = 
  +                 "Cannot construct classpath due to unresolvable base directory.";
  +                throw new CascadingException( error, iae );
  +            }
  +        }
   
           try
           {
  -            EngineClassLoader engine = new EngineClassLoader( m_loader );
  +            EngineClassLoader engine = new EngineClassLoader( loader );
               engine.enableLogging( getLogger() );
               Locator system = getSystemContext();
               DefaultLocator context = new DefaultLocator( system );
               context.put( "urn:assembly:engine.bootstrap", "true" );
  -            context.put( "urn:assembly:engine.base", m_url );
  +            //context.put( "urn:assembly:engine.base", m_url );
               if( lib != null )
               {
                   LibraryDescriptor extensions =
  
  
  

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


Mime
View raw message