You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by le...@apache.org on 2003/04/16 16:44:16 UTC

cvs commit: avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/service ServiceManagementContext.java

leosimons    2003/04/16 07:44:16

  Modified:    merlin/merlin-core/src/java/org/apache/avalon/merlin/block
                        BlockLoader.java
               merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl
                        DefaultBlock.java DefaultBlockLoader.java
               merlin/merlin-core/src/java/org/apache/avalon/merlin/container/builder
                        ContainerBuilder.java ContainerCreator.java
                        XMLContainerCreator.java
               merlin/merlin-core/src/java/org/apache/avalon/merlin/container/impl
                        DefaultContainer.java
               merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl
                        DefaultKernel.java DefaultKernelLoader.java
               merlin/merlin-core/src/java/org/apache/avalon/merlin/service
                        ServiceManagementContext.java
  Log:
  optimize imports, remove unused stuff.
  Some of these classes are way big!
  
  Revision  Changes    Path
  1.2       +2 -3      avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/BlockLoader.java
  
  Index: BlockLoader.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/BlockLoader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BlockLoader.java	13 Mar 2003 01:04:59 -0000	1.1
  +++ BlockLoader.java	16 Apr 2003 14:44:13 -0000	1.2
  @@ -50,7 +50,6 @@
   
   package org.apache.avalon.merlin.block;
   
  -import org.apache.avalon.framework.configuration.Configuration;
   import java.net.URL;
   
   /**
  @@ -61,7 +60,7 @@
    * @version $Revision$ $Date$
    */
   
  -public interface BlockLoader 
  +public interface BlockLoader
   {
      /**
       * Create a block.
  
  
  
  1.12      +64 -68    avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/DefaultBlock.java
  
  Index: DefaultBlock.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/DefaultBlock.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DefaultBlock.java	15 Apr 2003 14:33:39 -0000	1.11
  +++ DefaultBlock.java	16 Apr 2003 14:44:14 -0000	1.12
  @@ -30,11 +30,10 @@
   import org.apache.avalon.merlin.container.StateListener;
   import org.apache.avalon.meta.info.DependencyDescriptor;
   import org.apache.avalon.meta.info.ServiceDescriptor;
  -import org.apache.avalon.meta.info.InfoDescriptor;
   import org.apache.avalon.meta.model.Profile;
   
   /**
  - * The default implementation of a Block.  The implementation provides 
  + * The default implementation of a Block.  The implementation provides
    * support for convinence operations related to its role as a containment
    * handler by delegating to the container it is managing.
    */
  @@ -47,13 +46,13 @@
      /**
       * Context key referencing optional block dependency criteria.
       */
  -    public static final String DEPENDENCIES_KEY = 
  -      "urn:merlin:container.dependencies"; 
  +    public static final String DEPENDENCIES_KEY =
  +      "urn:merlin:container.dependencies";
   
      /**
       * Context key referencing optional block services criteria.
       */
  -    public static final String SERVICES_KEY = 
  +    public static final String SERVICES_KEY =
         "urn:merlin:container.services";
   
   
  @@ -121,7 +120,7 @@
   
      /**
       * The appliance manager.
  -    */ 
  +    */
       private ApplianceRepository m_repository;
   
      /**
  @@ -135,45 +134,45 @@
       private Map m_containers = new Hashtable();
   
      /**
  -    * Reference to the set of appliances to be terminated.  The set 
  -    * appliances is based on the shutdown graph resolved during the 
  +    * Reference to the set of appliances to be terminated.  The set
  +    * appliances is based on the shutdown graph resolved during the
       * disassembly phase.
       */
       private Appliance[] m_shutdown;
   
      /**
       * Flag holding the deoplyed state of the block.
  -    */ 
  +    */
       private boolean m_deployed = false;
   
      /**
       * Flag holding the decommissioned state of the block.
  -    */ 
  +    */
       private boolean m_decommissioned = false;
   
      /**
       * Flag holding the disassembled state of the block.
  -    */ 
  +    */
       private boolean m_disassembled = false;
   
      /**
       * Flag holding the terminated state of the block.
  -    */ 
  +    */
       private boolean m_terminated = false;
   
      /**
       * The set of dependencies declared by the block.
  -    */ 
  +    */
       private DependencyDescriptor[] m_dependencies;
   
      /**
       * The set of services declared by the block.
  -    */ 
  +    */
       private ServiceDescriptor[] m_services;
   
      /**
       * The containment profile.
  -    */ 
  +    */
       private ContainmentProfile m_descriptor;
   
       //=====================================================================
  @@ -188,31 +187,31 @@
       public void contextualize( Locator context ) throws ContextException
       {
           super.contextualize( context );
  -        m_applianceContext = 
  +        m_applianceContext =
             (ApplianceContext) context.get( "urn:assembly:appliance.context" );
  -        m_engine = 
  +        m_engine =
             (EngineClassLoader) context.get( "urn:assembly:engine" );
  -        m_descriptor = 
  +        m_descriptor =
             (ContainmentProfile) context.get( "urn:merlin:container.descriptor" );
  -        m_library = 
  +        m_library =
             (Library) context.get( "urn:merlin:container.library" );
  -        m_blocks = 
  +        m_blocks =
             (List) context.get( "urn:merlin:container.blocks" );
  -        m_repository = 
  +        m_repository =
             (ApplianceRepository) context.get( "urn:assembly:appliance.repository" );
  -        m_descriptor = 
  +        m_descriptor =
             (ContainmentProfile) context.get( "urn:merlin:container.descriptor" );
   
           //
           // if dependecies are declared then use the supplied dependencies
  -        // together with any dependecies declared by the underlying 
  +        // together with any dependecies declared by the underlying
           // containement solution, otherwise we default to the underlying
           // container type
           //
   
           if( context.hasEntry( DEPENDENCIES_KEY ) )
           {
  -            DependencyDescriptor[] dependencies = 
  +            DependencyDescriptor[] dependencies =
                 (DependencyDescriptor[]) context.get( DEPENDENCIES_KEY );
               DependencyDescriptor[] classic = super.getDependencies();
   
  @@ -227,7 +226,7 @@
                   list.add( dependencies[i] );
               }
   
  -            m_dependencies = 
  +            m_dependencies =
                 (DependencyDescriptor[]) list.toArray( new DependencyDescriptor[0] );
           }
           else
  @@ -236,7 +235,7 @@
           }
   
           //
  -        // if services are declare we isolate available services to 
  +        // if services are declare we isolate available services to
           // those declared here, otherwise all services established explicitly
           // within the block implementation will be visible as services
           // provided by the block
  @@ -244,7 +243,7 @@
   
           if( context.hasEntry( SERVICES_KEY ) )
           {
  -            m_services = 
  +            m_services =
                 (ServiceDescriptor[]) context.get( SERVICES_KEY );
           }
           else
  @@ -270,7 +269,7 @@
           {
               throw new IllegalStateException( "context" );
           }
  - 
  +
           //
           // construct the appliance instances managed by this block
           //
  @@ -281,15 +280,15 @@
               Profile profile = profiles[i];
               if( getLogger().isDebugEnabled() )
               {
  -                final String message = 
  -                  "adding child profile: " + profile + " in " + this; 
  +                final String message =
  +                  "adding child profile: " + profile + " in " + this;
                   getLogger().debug( message );
               }
   
  -            Configuration config = 
  +            Configuration config =
                 m_library.getConfiguration( getPath() + "/" + profile.getName() );
   
  -            DefaultApplianceContext context = 
  +            DefaultApplianceContext context =
                  new DefaultApplianceContext( profile );
   
               context.setPartitionName( getPath() );
  @@ -310,8 +309,8 @@
       //-------------------------------------------------------------------------------
   
       /**
  -     * Return the set of runtime dependencies for the type.  The block 
  -     * implementation overrides the default appliance behaviour by including 
  +     * Return the set of runtime dependencies for the type.  The block
  +     * implementation overrides the default appliance behaviour by including
        * dependencies declared at the level of the block.
        *
        * @return the set of runtime dependencies.
  @@ -321,6 +320,18 @@
           return m_dependencies;
       }
   
  +    /**
  +     * Return the set of services exported by the type.  The block
  +     * implementation overrides the default appliance behaviour by including
  +     * services declared at the level of the block.
  +     *
  +     * @return the set of runtime dependencies.
  +     */
  +    public ServiceDescriptor[] getServices()
  +    {
  +        return m_services;
  +    }
  +
      /**
       * Get the appliance URL.
       * @return the appliance URL
  @@ -331,10 +342,10 @@
       }
   
      /**
  -    * Assemble the appliance.  The implementation extends the default 
  -    * appliance behavior by instantiating the container it is managing, 
  -    * and applying assembly to the container instance. This results in 
  -    * container creating appliance instances for the component is is 
  +    * Assemble the appliance.  The implementation extends the default
  +    * appliance behavior by instantiating the container it is managing,
  +    * and applying assembly to the container instance. This results in
  +    * container creating appliance instances for the component is is
       * managing together with assembly of its sub-containers.
       *
       * @exception ApplianceException if an error occurs during appliance assembly
  @@ -360,11 +371,11 @@
   
           Map context = m_applianceContext.getDeploymentContext();
           context.put( "urn:merlin:container.dependency-graph", graph );
  -        context.put( "urn:merlin:container.listener", this ); 
  +        context.put( "urn:merlin:container.listener", this );
           super.assemble( graph );
   
           //
  -        // now that we have assembled ourself we can continue with the 
  +        // now that we have assembled ourself we can continue with the
           // assembly of the contents of this block
           //
   
  @@ -374,7 +385,7 @@
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Assembly failure attributable to embedded appliance.";
               throw new ApplianceException( error, e );
           }
  @@ -391,7 +402,7 @@
               if( getLogger().isDebugEnabled() )
               {
                   final String message =
  -                  "activating block: " + block; 
  +                  "activating block: " + block;
                   getLogger().debug( message );
               }
   
  @@ -404,7 +415,7 @@
               catch( Throwable e )
               {
                   final String error =
  -                  "Could not establish a sub-container: " 
  +                  "Could not establish a sub-container: "
                     + block
                     + " in block: " + this;
                   throw new ApplianceException( error, e );
  @@ -416,7 +427,7 @@
           if( getLogger().isDebugEnabled() )
           {
               Appliance[] startup = graph.getStartupGraph( );
  -            StringBuffer buffer = new StringBuffer( 
  +            StringBuffer buffer = new StringBuffer(
                 "startup sequence for " + this + " (" + startup.length + ") " );
               for( int p=0; p<startup.length; p++ )
               {
  @@ -475,7 +486,7 @@
       public Appliance[] getAppliances()
       {
           ArrayList list = new ArrayList();
  -        Appliance[] appliances = 
  +        Appliance[] appliances =
             m_engine.getApplianceRepository().getAppliances();
           for( int i=0; i<appliances.length; i++ )
           {
  @@ -489,21 +500,6 @@
       }
   
      /**
  -    * Return the set of blocks locally managed by this block.
  -    * @return the set of immediate sibling blocks.
  -    */
  -    private Block[] getBlocks()
  -    {
  -        // ## 
  -        // ## TODO clean up the duplication of references to appliances.  This 
  -        // ## should be driven by the content in the appliance repository and 
  -        // ## and local references should be dropped.
  -        // ##
  -
  -        return (Block[]) m_blocks.toArray( new Block[0] );
  -    }
  -
  -   /**
       * Disassemble the block.
       */
       public void disassemble()
  @@ -624,7 +620,7 @@
               if( m_error != null )
               {
                   m_state = StateEvent.STOPPED;
  -                final String error = 
  +                final String error =
                     "Unexpected deployment error.";
                   Exception exception = new BlockException( error, m_error );
                   m_error = null;
  @@ -656,7 +652,7 @@
                   break;
               }
           }
  -        
  +
           m_deployed = true;
       }
   
  @@ -773,7 +769,7 @@
           //
           // decommission the subsidiary blocks
           //
  - 
  +
           Iterator iterator = m_blocks.iterator();
           while( iterator.hasNext() )
           {
  @@ -825,7 +821,7 @@
               }
               catch( Throwable e )
               {
  -                final String warning = 
  +                final String warning =
                     "ignoring dissassembly error from appliance: " + appliance
                     + " (" + e.toString() + ")";
                   getLogger().warn( warning );
  @@ -842,7 +838,7 @@
               }
               catch( Throwable e )
               {
  -                final String warning = 
  +                final String warning =
                     "ignoring dissassembly error from block: " + block
                     + " (" + e.toString() + ")";
                   getLogger().warn( warning );
  @@ -909,9 +905,9 @@
           {
               if( getLogger().isErrorEnabled() )
               {
  -                final String error = 
  -                  ExceptionHelper.packException( 
  -                    "Runtime containment error in: " 
  +                final String error =
  +                  ExceptionHelper.packException(
  +                    "Runtime containment error in: "
                       + this, event.getError() );
                   getLogger().error( error );
               }
  
  
  
  1.14      +109 -177  avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/DefaultBlockLoader.java
  
  Index: DefaultBlockLoader.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/DefaultBlockLoader.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DefaultBlockLoader.java	15 Apr 2003 14:33:39 -0000	1.13
  +++ DefaultBlockLoader.java	16 Apr 2003 14:44:14 -0000	1.14
  @@ -51,80 +51,54 @@
   package org.apache.avalon.merlin.block.impl;
   
   import java.io.File;
  -import java.io.IOException;
  -import java.io.FileInputStream;
   import java.io.InputStream;
  -import java.net.URL;
  +import java.net.JarURLConnection;
   import java.net.MalformedURLException;
  -import java.util.List;
  -import java.util.Iterator;
  -import java.util.Map;
  +import java.net.URL;
   import java.util.ArrayList;
   import java.util.Hashtable;
  -import java.util.Enumeration;
  +import java.util.List;
  +import java.util.Map;
  +import java.util.Properties;
   import java.util.jar.JarFile;
  -import java.util.jar.Attributes;
  -import java.util.jar.Manifest;
   import java.util.zip.ZipEntry;
  -import java.net.JarURLConnection;
  -import java.util.Properties;
   
  -import org.apache.avalon.assembly.logging.LoggingManager;
  -import org.apache.avalon.assembly.logging.LoggingDescriptor;
  -import org.apache.avalon.assembly.logging.DefaultLoggingManager;
  +import org.apache.avalon.assembly.appliance.DefaultApplianceContext;
   import org.apache.avalon.assembly.engine.EngineClassLoader;
   import org.apache.avalon.assembly.engine.EngineException;
  -import org.apache.avalon.assembly.engine.Engine;
  -import org.apache.avalon.assembly.engine.model.LibraryDescriptor;
   import org.apache.avalon.assembly.engine.model.Classpath;
  -import org.apache.avalon.assembly.engine.model.DefaultClasspath;
   import org.apache.avalon.assembly.engine.model.ClasspathDescriptor;
  -import org.apache.avalon.assembly.util.ExceptionHelper;
  -import org.apache.avalon.assembly.appliance.Appliance;
  -import org.apache.avalon.assembly.appliance.ApplianceContext;
  -import org.apache.avalon.assembly.appliance.DefaultApplianceContext;
  -import org.apache.avalon.assembly.appliance.DependencyGraph;
  +import org.apache.avalon.assembly.engine.model.DefaultClasspath;
  +import org.apache.avalon.assembly.engine.model.LibraryDescriptor;
   import org.apache.avalon.assembly.engine.type.UnknownTypeException;
   import org.apache.avalon.assembly.locator.Contextualizable;
   import org.apache.avalon.assembly.locator.Locator;
  -import org.apache.avalon.assembly.locator.LocatorException;
  -import org.apache.avalon.assembly.locator.DefaultLocator;
   import org.apache.avalon.framework.Version;
  -import org.apache.avalon.framework.CascadingException;
  -import org.apache.avalon.framework.logger.Logger;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
  -import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.activity.Startable;
   import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.context.DefaultContext;
  +import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
  -import org.apache.avalon.framework.context.Context;
  +import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
   import org.apache.avalon.framework.context.ContextException;
  -import org.apache.avalon.framework.service.DefaultServiceManager;
  -import org.apache.avalon.framework.service.DefaultServiceSelector;
  -import org.apache.avalon.framework.parameters.Parameters;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.merlin.block.Block;
  -import org.apache.avalon.merlin.block.Library;
   import org.apache.avalon.merlin.block.BlockException;
  -import org.apache.avalon.merlin.block.BlockRuntimeException;
   import org.apache.avalon.merlin.block.BlockLoader;
  -import org.apache.avalon.merlin.container.builder.XMLContainerCreator;
  -import org.apache.avalon.merlin.container.ContainmentProfile;
  +import org.apache.avalon.merlin.block.BlockRuntimeException;
  +import org.apache.avalon.merlin.block.Library;
   import org.apache.avalon.merlin.container.Container;
   import org.apache.avalon.merlin.container.ContainerException;
  +import org.apache.avalon.merlin.container.ContainmentProfile;
  +import org.apache.avalon.merlin.container.builder.XMLContainerCreator;
   import org.apache.avalon.merlin.container.impl.DefaultContainer;
  -import org.apache.avalon.meta.model.builder.XMLProfileCreator;
  -import org.apache.avalon.meta.model.LoggingDirective;
  -import org.apache.avalon.meta.model.Profile;
  -import org.apache.avalon.meta.info.Type;
  -import org.apache.avalon.meta.info.InfoDescriptor;
   import org.apache.avalon.meta.info.DependencyDescriptor;
  +import org.apache.avalon.meta.info.InfoDescriptor;
   import org.apache.avalon.meta.info.ServiceDescriptor;
  +import org.apache.avalon.meta.info.Type;
   import org.apache.avalon.meta.info.builder.XMLTypeCreator;
  +import org.apache.avalon.meta.model.Profile;
  +import org.apache.avalon.meta.model.builder.XMLProfileCreator;
   import org.apache.excalibur.configuration.ConfigurationUtil;
   
   
  @@ -157,12 +131,6 @@
       // static
       //==============================================================
   
  -    /**
  -     * The logging manager that we use to construct logging catagories
  -     * and logging channels.
  -     */
  -    private static LoggingManager LOGGING;
  -
       protected static final String BLOCK_XML_ENTRY = "BLOCK-INF/block.xml";
   
       protected static final XMLContainerCreator CREATOR = new XMLContainerCreator();
  @@ -178,11 +146,6 @@
      /**
       * The application home directory.
       */
  -    private File m_home;
  -
  -   /**
  -    * The application home directory.
  -    */
       private File m_root;
   
       /**
  @@ -190,11 +153,6 @@
        */
       private EngineClassLoader m_engine;
   
  -    /**
  -     * The system context.
  -     */
  -    private Locator m_system;
  -
      /**
       * Configuration fragments keyed by appliance path.
       */
  @@ -211,8 +169,6 @@
       {
           m_root = (File) context.get( "urn:assembly:system" );
           m_engine = (EngineClassLoader) context.get( "urn:assembly:engine" );
  -        m_system = (Locator) context.get( "urn:assembly:system-context" );
  -        m_home = (File) m_system.get( "urn:assembly:home" );
       }
   
       //==============================================================
  @@ -237,8 +193,6 @@
       public void dispose()
       {
           m_engine = null;
  -        m_system = null;
  -        m_home = null;
       }
   
       //==============================================================
  @@ -247,7 +201,7 @@
   
       /**
        * The context key for the path to the configuration. If no
  -     * configuration is available relative to the supplied path, an 
  +     * configuration is available relative to the supplied path, an
        * implementation shall return a new empty configuration.
        *
        * @param path the path identifiying he configuration
  @@ -259,7 +213,7 @@
   
       /**
        * The context key for the path to the configuration. If no
  -     * configuration is available relative to the supplied path, an 
  +     * configuration is available relative to the supplied path, an
        * implementation shall return either null or a new empty
        * configuration depending on the supplied creation policy.
        *
  @@ -295,7 +249,7 @@
      /**
       * Load a block declared in the supplied block and configuration URL.
       * The path URL may refer to a XML file containing a block directive
  -    * or a jar file containing a block.xml file. 
  +    * or a jar file containing a block.xml file.
       *
       * @param path the block defintion URL
       * @param overrides the URL to a configuration containing configuration overrides
  @@ -339,7 +293,7 @@
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Unable to create configuration from source: " + uri;
               throw new BlockException( error, e );
           }
  @@ -360,7 +314,7 @@
           }
           else
           {
  -            // its a block.xml file so we need to return the url with the 
  +            // its a block.xml file so we need to return the url with the
               // filename stripped off it
               try
               {
  @@ -370,7 +324,7 @@
               }
               catch( Throwable e )
               {
  -                final String error = 
  +                final String error =
                     "Unexpected error while resolving base path from URL: " + url;
                   throw new BlockRuntimeException( error, e );
               }
  @@ -389,7 +343,7 @@
               }
               catch( Throwable e )
               {
  -                final String error = 
  +                final String error =
                     "Unable to resolve packaged block description on path: " + url;
                   throw new BlockException( error, e );
               }
  @@ -410,7 +364,7 @@
                   }
                   catch( Throwable ce )
                   {
  -                    final String error = 
  +                    final String error =
                         "Unable to resolve block description on path: " + uri;
                       throw new BlockException( error, e );
                   }
  @@ -421,17 +375,17 @@
      /**
       * Create a descriptor of a container populated with the defintintion
       * of the components it is managing.
  -    * 
  +    *
       * @param name the container name
       * @param engine the classloader to use
       * @param config the configuration describing the block implementation
       * @return the container descriptor
       */
  -    private ContainmentProfile createContainmentProfile( 
  +    private ContainmentProfile createContainmentProfile(
         final String name, final EngineClassLoader engine, final Configuration config )
         throws BlockException
       {
  -        final String classname = 
  +        final String classname =
             config.getAttribute( "class", DefaultContainer.class.getName() );
   
           Type type = null;
  @@ -441,13 +395,13 @@
           }
           catch( UnknownTypeException ute )
           {
  -            final String error = 
  +            final String error =
                 "Container definition references an unknown type: " + classname;
               throw new BlockException( error );
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Internal error while resolving container: " + name
                 + " using class: " + classname;
               throw new BlockException( error, e );
  @@ -455,11 +409,11 @@
   
           try
           {
  -            ContainmentProfile descriptor = 
  +            ContainmentProfile descriptor =
                 CREATOR.createContainmentProfile( type, config, name );
   
               //
  -            // from the container implementor point of view a block is all 
  +            // from the container implementor point of view a block is all
               // about the creation of appliance instances - the following code
               // fragment pulls in all appliance declarations
               //
  @@ -475,7 +429,7 @@
   
               //
               // however, a user views a container as a thing that contains components
  -            // so we repeat the same process here using "component" instead of 
  +            // so we repeat the same process here using "component" instead of
               // "appliance"
               //
   
  @@ -492,7 +446,7 @@
           }
           catch( Exception e )
           {
  -            final String error = 
  +            final String error =
                 "Cannot build the container descriptor: " + name;
               throw new BlockException( error, e );
           }
  @@ -500,16 +454,16 @@
   
      /**
       * Creation of a set of child blocks relative to a set of parent parameters.
  -    * 
  +    *
       * @param engine the parent classloader
       * @param partition the partition to be applied to the child containers
  -    * @param config the parent block configuration 
  +    * @param config the parent block configuration
       * @param custom override targets
       * @param base the base url
       *
       * @return a list of appliance instances each representing a subsidiary container
       */
  -    private List createChildBlocks( 
  +    private List createChildBlocks(
         final EngineClassLoader engine, final String partition,
         final Configuration config, final Configuration custom, final URL base )
         throws BlockException
  @@ -521,7 +475,7 @@
           //
   
           final Configuration[] includes = config.getChildren( "include" );
  -        
  +
           for( int j=0; j<includes.length; j++ )
           {
               Configuration include = includes[j];
  @@ -534,22 +488,22 @@
               }
               catch( ConfigurationException ce )
               {
  -                final String error = 
  +                final String error =
                     "Missing path attribute on include directive.\n"
                     + ConfigurationUtil.list( include );
                   throw new BlockException( error, ce );
               }
               catch( MalformedURLException e )
               {
  -                final String error = 
  -                  "Error during URL manipulation of path: " + path 
  +                final String error =
  +                  "Error during URL manipulation of path: " + path
                     + " from base: " + base;
                   throw new BlockException( error, e );
               }
  - 
  +
               if( getLogger().isDebugEnabled() )
               {
  -                final String info = 
  +                final String info =
                     "Installing embedded block: " + source;
                   getLogger().debug( info );
               }
  @@ -572,16 +526,16 @@
               try
               {
                   Configuration conf = child.getChild("engine");
  -                loader = createEngine( engine, m_home, conf, name, base );
  +                loader = createEngine( engine, conf, name, base );
               }
               catch( EngineException ce )
               {
  -                final String error = 
  +                final String error =
                     "Cannot create a subsidiary container due to a engine creation error.";
                   throw new BlockException( error, ce );
               }
   
  -            final Block block = createContainmentBlock( 
  +            final Block block = createContainmentBlock(
                 loader, partition, name, child, custom, base );
               list.add( block );
           }
  @@ -602,7 +556,7 @@
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Supplied container configuration does not contain the required name attribute:\n"
                 + ConfigurationUtil.list( config );
               throw new BlockException( error, e );
  @@ -621,8 +575,8 @@
       * @return the containment block
       * @exception BlockException if an error occurs during creation of the block
       */
  -    private Block createContainmentBlock( 
  -      final EngineClassLoader engine, final String partition, final String name, 
  +    private Block createContainmentBlock(
  +      final EngineClassLoader engine, final String partition, final String name,
         final Configuration config, final Configuration custom, final URL base )
         throws BlockException
       {
  @@ -631,15 +585,14 @@
   
           try
           {
  -            final ContainmentProfile descriptor = 
  +            final ContainmentProfile descriptor =
                 createContainmentProfile( name, engine, config );
  -            return createBlock( 
  -              new InfoDescriptor( name, DefaultBlock.class.getName(), null, null ), 
  -              null, null, engine, blocks, descriptor, name, partition, custom ) ; 
  +            return createBlock(
  +                    null, null, engine, blocks, descriptor, name, partition ) ;
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Cannot create a block due to an error during meta info creation.";
               throw new BlockException( error, e );
           }
  @@ -660,17 +613,16 @@
       * @return the block
       * @exception BlockException if an error occurs during creation of the block
       */
  -    private Block createBlock( 
  -      final InfoDescriptor info,
  -      final DependencyDescriptor[] dependencies, final ServiceDescriptor[] services, 
  -      final EngineClassLoader engine, final List blocks, final ContainmentProfile descriptor, 
  -      final String name, final String partition, final Configuration custom )
  +    private Block createBlock(
  +           final DependencyDescriptor[] dependencies, final ServiceDescriptor[] services,
  +      final EngineClassLoader engine, final List blocks, final ContainmentProfile descriptor,
  +      final String name, final String partition )
         throws BlockException
       {
           //
           // create the appliance context for the container - the map
  -        // contains the context entries that will be provided to the 
  -        // container (supplimented by entries added by the block 
  +        // contains the context entries that will be provided to the
  +        // container (supplimented by entries added by the block
           // implementation) and the context object is the context
           // to be applied to the block.
           //
  @@ -706,7 +658,7 @@
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Unable to create block: " + partition + name;
               throw new BlockException( error, e );
           }
  @@ -715,7 +667,7 @@
      /**
       * Load a block declared in the supplied block and configuration URL.
       * The path URL may refer to a XML file containing a block directive
  -    * or a jar file containing a block.xml file. 
  +    * or a jar file containing a block.xml file.
       *
       * @param path the block defintion URL
       * @param overrides the URL to a configuration containing configuration overrides
  @@ -729,20 +681,18 @@
           Configuration implementation = getImplementationFragment( block );
           Configuration config = getTargetsConfiguration( overrides );
   
  -        InfoDescriptor info = createBlockInfoDescriptor( "", block );
  -
           captureConfigurationTargets( Container.PATH_SEPERATOR, config );
   
           URL base = getBasePath( path );
   
           //
  -        // create the block logical dependencies (as distinct from the 
  +        // create the block logical dependencies (as distinct from the
           // physical dependencies of the type managed by the block)
           //
   
           Configuration deps = block.getChild( "dependencies" );
  -        DependencyDescriptor[] dependencies = getBlockLogicalDependencies( deps ); 
  -        
  +        DependencyDescriptor[] dependencies = getBlockLogicalDependencies( deps );
  +
           //
           // create the logical block services
           //
  @@ -755,29 +705,29 @@
           // container profiles
           //
   
  -        ContainmentProfile descriptor = 
  +        ContainmentProfile descriptor =
             createContainmentProfile( "", m_engine, implementation );
   
           //
           // create any subsidiary blocks
           //
   
  -        List blocks = createChildBlocks( 
  +        List blocks = createChildBlocks(
             m_engine, Container.PATH_SEPERATOR, implementation, config, base );
   
           //
           // create the block
           //
   
  -        return createBlock( 
  -          info, dependencies, services, m_engine, blocks, descriptor, "", 
  -          Container.PATH_SEPERATOR, config );
  +        return createBlock(
  +                dependencies, services, m_engine, blocks, descriptor, "",
  +          Container.PATH_SEPERATOR );
       }
   
      /**
       * Load a block declared in the supplied block and configuration URL.
       * The path URL may refer to a XML file containing a block directive
  -    * or a jar file containing a block.xml file. 
  +    * or a jar file containing a block.xml file.
       *
       * @param loader the classloader
       * @param root the relative root path
  @@ -805,11 +755,11 @@
           EngineClassLoader engine = null;
           try
           {
  -            engine = createEngine( loader, m_home, engineConfig, name, base, base );
  +            engine = createEngine( loader, engineConfig, name, base, base );
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Could not construct engine for block: " + name;
               throw new BlockException( error, e );
           }
  @@ -818,17 +768,17 @@
           // create the containment profile
           //
   
  -        ContainmentProfile descriptor = 
  +        ContainmentProfile descriptor =
             createContainmentProfile( name, engine, implementation );
   
           //
  -        // create the block logical dependencies (as distinct from the 
  +        // create the block logical dependencies (as distinct from the
           // physical dependencies of the type managed by the block)
           //
   
           Configuration deps = block.getChild( "dependencies" );
  -        DependencyDescriptor[] dependencies = getBlockLogicalDependencies( deps ); 
  -        
  +        DependencyDescriptor[] dependencies = getBlockLogicalDependencies( deps );
  +
           //
           // create the logical block services
           //
  @@ -844,19 +794,19 @@
           List blocks = createChildBlocks( engine, partition, implementation, config, base );
   
           //
  -        // create the block 
  +        // create the block
           //
   
  -        return createBlock( 
  -          info, dependencies, services, engine, blocks, descriptor, name, root, config );
  +        return createBlock(
  +                dependencies, services, engine, blocks, descriptor, name, root );
       }
   
      /**
       * Return the configuration fragment holding the implementation defintion.
       * This method checks for a child component named 'implementation' and if it exists
  -    * then the child is returned, otherwise, do the old method of checking for a 
  +    * then the child is returned, otherwise, do the old method of checking for a
       * root container and return that.  If neaither of the above work, throw a exception.
  -    * 
  +    *
       * @param config the block confiugration
       * @return the implementation configuration fragment
       * @exception BlockException of the implementation fragment cannot be resolved
  @@ -871,7 +821,7 @@
           imp = config.getChild( "container", false );
           if( imp != null )
           {
  -            final String error = 
  +            final String error =
                 "Block contains a depricated reference to 'container'. \n"
                 + "Please replace the root 'container' declaration with 'imlementation'.";
               getLogger().warn( error );
  @@ -884,7 +834,7 @@
       }
   
      /**
  -    * Create a block info descriptor holding the block name, version and 
  +    * Create a block info descriptor holding the block name, version and
       * optional properties.
       *
       * @param info the &lt;info&gt; configuration fragment
  @@ -905,7 +855,7 @@
       }
   
      /**
  -    * Create a block info descriptor holding the block name, version and 
  +    * Create a block info descriptor holding the block name, version and
       * optional properties.
       *
       * @param name the name to assign to the block
  @@ -918,7 +868,7 @@
           try
           {
               final String classname = DefaultBlock.class.getName();
  -            final Version version = 
  +            final Version version =
                 Version.getVersion( info.getChild( "version" ).getValue( "1.0" ) );
               final Properties attributes =
                 TYPE_CREATOR.buildAttributes( info.getChild( "attributes" ) );
  @@ -926,8 +876,8 @@
           }
           catch( ConfigurationException ce )
           {
  -            final String error = 
  -              "Unexpected error building block info desciptor: " 
  +            final String error =
  +              "Unexpected error building block info desciptor: "
                 + name + "\n"
                 + ConfigurationUtil.list( info );
               throw new BlockException( error, ce );
  @@ -948,7 +898,7 @@
           }
           catch( ConfigurationException ce )
           {
  -            final String error = 
  +            final String error =
                 "Invalid dependencies declaration in block specification:\n"
                  + ConfigurationUtil.list( config );
               throw new BlockException( error, ce );
  @@ -969,7 +919,7 @@
           }
           catch( ConfigurationException ce )
           {
  -            final String error = 
  +            final String error =
                 "Invalid services declaration in block specification:\n"
                  + ConfigurationUtil.list( config );
               throw new BlockException( error, ce );
  @@ -998,7 +948,7 @@
               catch( Throwable e )
               {
                   final String error =
  -                  "A configuration target does not declare a name in: " 
  +                  "A configuration target does not declare a name in: "
                     + path
                     + ConfigurationUtil.list( target );
                   throw new BlockException( error, e );
  @@ -1028,7 +978,7 @@
           }
           catch( Throwable ioe )
           {
  -            final String error = 
  +            final String error =
                 "Unexpected Exception while reading jar file from url: " + xurl + " cause: " + ioe;
               throw new RuntimeException( error );
           }
  @@ -1044,7 +994,7 @@
           ZipEntry entry = jar.getEntry( BLOCK_XML_ENTRY );
           if( entry == null )
           {
  -            final String error = 
  +            final String error =
                 "Missing block descriptor: /" + BLOCK_XML_ENTRY;
               throw new BlockException( error );
           }
  @@ -1090,7 +1040,7 @@
           catch( Throwable e )
           {
               final String error =
  -              "Root container in block: " + name 
  +              "Root container in block: " + name
                 + " contains an profile that references an unknown type: "
                 + classname;
               throw new ContainerException( error, e );
  @@ -1106,7 +1056,7 @@
           catch( Throwable e )
           {
               final String error =
  -              "Root container in block: " + name 
  +              "Root container in block: " + name
                 + " contains a problamatic profile: "
                 + classname;
               throw new ContainerException( error, e );
  @@ -1145,11 +1095,11 @@
       * @return the new engine
       * @exception EngineException if an engine establishment failure occurs
       */
  -    private EngineClassLoader createEngine( 
  -      EngineClassLoader parent, File home, Configuration config, String name, URL base ) 
  +    private EngineClassLoader createEngine(
  +      EngineClassLoader parent, Configuration config, String name, URL base )
         throws EngineException
       {
  -        return createEngine( parent, home, config, name, base, null );
  +        return createEngine( parent, config, name, base, null );
       }
   
      /**
  @@ -1163,11 +1113,11 @@
       * @return the new engine
       * @exception EngineException if an engine establishment failure occurs
       */
  -    private EngineClassLoader createEngine( 
  -      EngineClassLoader parent, File home, Configuration config, String name, URL base, URL target ) 
  +    private EngineClassLoader createEngine(
  +      EngineClassLoader parent, Configuration config, String name, URL base, URL target )
         throws EngineException
       {
  -        LibraryDescriptor extensions = 
  +        LibraryDescriptor extensions =
             createLibraryDescriptor( config.getChild( "library", false ) );
   
           Classpath classpath = null;
  @@ -1181,7 +1131,7 @@
               }
               catch( IllegalArgumentException iae )
               {
  -                final String error = 
  +                final String error =
                    "Cannot construct classpath due to unresolvable base directory.";
                   throw new EngineException( error, iae );
               }
  @@ -1199,13 +1149,13 @@
   
   
      /**
  -    * Utility that handles the creation of a extension set descriptor from 
  +    * Utility that handles the creation of a extension set descriptor from
       * a configuration fragment.
       * @param config the configuration
       * @return the library descriptor of null if the supplied configuration is null
       * @exception EngineException if an error occurs
       */
  -    private LibraryDescriptor createLibraryDescriptor( Configuration config ) 
  +    private LibraryDescriptor createLibraryDescriptor( Configuration config )
         throws EngineException
       {
           if( config == null )
  @@ -1218,20 +1168,20 @@
           }
           catch( Throwable e )
           {
  -            final String error = "Bad library descriptor in configuration: \n" 
  +            final String error = "Bad library descriptor in configuration: \n"
                 + ConfigurationUtil.list( config );
               throw new EngineException( error, e );
           }
       }
   
      /**
  -    * Utility that handles the creation of a classpath descriptor from 
  +    * Utility that handles the creation of a classpath descriptor from
       * a configuration fragment.
       * @param config the configuration
       * @return the classpath descriptor
       * @exception EngineException if an error occurs
       */
  -    private ClasspathDescriptor createClasspathDescriptor( Configuration config ) 
  +    private ClasspathDescriptor createClasspathDescriptor( Configuration config )
         throws EngineException
       {
           try
  @@ -1243,24 +1193,6 @@
               final String error = "Bad classpath descriptor: \n"
                 + ConfigurationUtil.list( config );
               throw new EngineException( error, e );
  -        }
  -    }
  -
  -   /**
  -    * Return a uri based on a base uri and a path to be appended to the base.
  -    * @param uri the base uri
  -    * @param path the path to append to the base
  -    * @return the full uri with path appended to the base uri
  -    */
  -    private String appendName( String uri, String path )
  -    {
  -        if( uri.endsWith( "/" ) )
  -        {
  -            return uri + path;
  -        }
  -        else
  -        {
  -            return uri + "/" + path;
           }
       }
   }
  
  
  
  1.4       +23 -22    avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/builder/ContainerBuilder.java
  
  Index: ContainerBuilder.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/builder/ContainerBuilder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ContainerBuilder.java	13 Apr 2003 03:36:47 -0000	1.3
  +++ ContainerBuilder.java	16 Apr 2003 14:44:15 -0000	1.4
  @@ -1,14 +1,14 @@
  -/* ==================================================================== 
  - * The Apache Software License, Version 1.1 
  - * 
  - * Copyright (c) 2002 The Apache Software Foundation. All rights 
  - * reserved. 
  - * 
  - * Redistribution and use in source and binary forms, with or without 
  - * modification, are permitted provided that the following conditions 
  - * are met: 
  - * 
  - * 1. Redistributions of source code must retain the above copyright 
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002 The Apache Software Foundation. All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
  @@ -20,13 +20,13 @@
    *    if any, must include the following acknowledgment:
    *    "This product includes software developed by the
    *    Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software 
  - *    itself, if and wherever such third-party acknowledgments  
  + *    Alternately, this acknowledgment may appear in the software
  + *    itself, if and wherever such third-party acknowledgments
    *    normally appear.
    *
  - * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation" 
  + * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
    *    must not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -49,17 +49,18 @@
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation. For more
  - * information on the Apache Software Foundation, please see 
  + * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  - */ 
  + */
   
   package org.apache.avalon.merlin.container.builder;
   
   import java.io.InputStream;
  +
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  -import org.apache.avalon.merlin.container.ContainmentProfile;
   import org.apache.avalon.merlin.container.ContainerRuntimeException;
  +import org.apache.avalon.merlin.container.ContainmentProfile;
   import org.apache.avalon.meta.info.Type;
   
   /**
  @@ -147,10 +148,10 @@
           }
           catch( final Exception e )
           {
  -            final String error = 
  -              "Unexpected error while attempting to create the XML Container Creator." 
  +            final String error =
  +              "Unexpected error while attempting to create the XML Container Creator."
                 + " Base: " + base.getName();
  -            throw new ContainerRuntimeException( error, e ); 
  +            throw new ContainerRuntimeException( error, e );
           }
           return xmlContainerCreator;
       }
  
  
  
  1.4       +19 -18    avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/builder/ContainerCreator.java
  
  Index: ContainerCreator.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/builder/ContainerCreator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ContainerCreator.java	13 Apr 2003 03:36:47 -0000	1.3
  +++ ContainerCreator.java	16 Apr 2003 14:44:15 -0000	1.4
  @@ -1,14 +1,14 @@
  -/* ==================================================================== 
  - * The Apache Software License, Version 1.1 
  - * 
  - * Copyright (c) 2002 The Apache Software Foundation. All rights 
  - * reserved. 
  - * 
  - * Redistribution and use in source and binary forms, with or without 
  - * modification, are permitted provided that the following conditions 
  - * are met: 
  - * 
  - * 1. Redistributions of source code must retain the above copyright 
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002 The Apache Software Foundation. All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
  @@ -20,13 +20,13 @@
    *    if any, must include the following acknowledgment:
    *    "This product includes software developed by the
    *    Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software 
  - *    itself, if and wherever such third-party acknowledgments  
  + *    Alternately, this acknowledgment may appear in the software
  + *    itself, if and wherever such third-party acknowledgments
    *    normally appear.
    *
  - * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation" 
  + * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
    *    must not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -49,13 +49,14 @@
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation. For more
  - * information on the Apache Software Foundation, please see 
  + * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  - */ 
  + */
   
   package org.apache.avalon.merlin.container.builder;
   
   import java.io.InputStream;
  +
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.merlin.container.ContainmentProfile;
   import org.apache.avalon.meta.info.Type;
  
  
  
  1.7       +33 -40    avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/builder/XMLContainerCreator.java
  
  Index: XMLContainerCreator.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/builder/XMLContainerCreator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLContainerCreator.java	15 Apr 2003 02:57:29 -0000	1.6
  +++ XMLContainerCreator.java	16 Apr 2003 14:44:15 -0000	1.7
  @@ -1,14 +1,14 @@
  -/* ==================================================================== 
  - * The Apache Software License, Version 1.1 
  - * 
  - * Copyright (c) 2002 The Apache Software Foundation. All rights 
  - * reserved. 
  - * 
  - * Redistribution and use in source and binary forms, with or without 
  - * modification, are permitted provided that the following conditions 
  - * are met: 
  - * 
  - * 1. Redistributions of source code must retain the above copyright 
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002 The Apache Software Foundation. All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
  @@ -20,13 +20,13 @@
    *    if any, must include the following acknowledgment:
    *    "This product includes software developed by the
    *    Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software 
  - *    itself, if and wherever such third-party acknowledgments  
  + *    Alternately, this acknowledgment may appear in the software
  + *    itself, if and wherever such third-party acknowledgments
    *    normally appear.
    *
  - * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation" 
  + * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
    *    must not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -49,43 +49,41 @@
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation. For more
  - * information on the Apache Software Foundation, please see 
  + * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  - */ 
  + */
   
   package org.apache.avalon.merlin.container.builder;
   
   import java.io.InputStream;
  -import java.util.ArrayList;
  -import java.lang.reflect.Constructor;
   import java.lang.reflect.Array;
  +import java.util.ArrayList;
   
  -import org.apache.avalon.excalibur.i18n.ResourceManager;
  -import org.apache.avalon.excalibur.i18n.Resources;
  +import org.apache.avalon.assembly.engine.model.ClasspathDescriptor;
  +import org.apache.avalon.assembly.engine.model.EngineConfigurationHelper;
  +import org.apache.avalon.assembly.engine.model.FilesetDescriptor;
  +import org.apache.avalon.assembly.engine.model.IncludeDescriptor;
  +import org.apache.avalon.assembly.engine.model.LibraryDescriptor;
  +import org.apache.avalon.assembly.logging.FileTargetProvider;
  +import org.apache.avalon.assembly.logging.LoggingDescriptor;
  +import org.apache.avalon.assembly.logging.TargetDescriptor;
  +import org.apache.avalon.assembly.logging.TargetProvider;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
   import org.apache.avalon.framework.parameters.Parameters;
  +import org.apache.avalon.merlin.container.ContainmentProfile;
   import org.apache.avalon.meta.ConfigurationBuilder;
   import org.apache.avalon.meta.info.Type;
  -import org.apache.avalon.meta.model.LoggingDirective;
   import org.apache.avalon.meta.model.Category;
   import org.apache.avalon.meta.model.ContextDirective;
   import org.apache.avalon.meta.model.Entry;
   import org.apache.avalon.meta.model.Import;
  +import org.apache.avalon.meta.model.LoggingDirective;
   import org.apache.avalon.meta.model.Mode;
   import org.apache.avalon.meta.model.Profile;
   import org.apache.avalon.meta.model.builder.XMLProfileCreator;
  -import org.apache.avalon.assembly.engine.model.ClasspathDescriptor;
  -import org.apache.avalon.assembly.engine.model.LibraryDescriptor;
  -import org.apache.avalon.assembly.engine.model.FilesetDescriptor;
  -import org.apache.avalon.assembly.engine.model.IncludeDescriptor;
  -import org.apache.avalon.assembly.engine.model.EngineConfigurationHelper;
  -import org.apache.avalon.assembly.logging.LoggingDescriptor;
  -import org.apache.avalon.assembly.logging.FileTargetProvider;
  -import org.apache.avalon.assembly.logging.TargetDescriptor;
  -import org.apache.avalon.assembly.logging.TargetProvider;
  -import org.apache.avalon.merlin.container.ContainmentProfile;
  +
   import org.xml.sax.InputSource;
   
   /**
  @@ -99,9 +97,6 @@
   public class XMLContainerCreator extends XMLProfileCreator
       implements ContainerCreator
   {
  -    private static final Resources REZ =
  -        ResourceManager.getPackageResources( XMLContainerCreator.class );
  -
       private Class m_clazz;
   
       public XMLContainerCreator()
  @@ -246,12 +241,12 @@
           Configuration[] profiles = config.getChildren( "appliance" );
           for( int i = 0; i < profiles.length; i++ )
           {
  -            vector.add( profiles[ i ] ); 
  +            vector.add( profiles[ i ] );
           }
           profiles = config.getChildren( "component" );
           for( int i = 0; i < profiles.length; i++ )
           {
  -            vector.add( profiles[ i ] ); 
  +            vector.add( profiles[ i ] );
           }
           return (Configuration[]) vector.toArray( new Configuration[0] );
       }
  @@ -266,8 +261,6 @@
               new DefaultConfiguration( "default", null );
           final LoggingDirective categories =
               createDefaultLoggingDirective( type );
  -        final ClasspathDescriptor classpath =
  -            new ClasspathDescriptor();
   
           return (ContainmentProfile) getConstructor().newInstance(
             new Object[]{
  
  
  
  1.4       +39 -51    avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/impl/DefaultContainer.java
  
  Index: DefaultContainer.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/impl/DefaultContainer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultContainer.java	15 Apr 2003 02:57:29 -0000	1.3
  +++ DefaultContainer.java	16 Apr 2003 14:44:15 -0000	1.4
  @@ -1,14 +1,14 @@
  -/* ==================================================================== 
  - * The Apache Software License, Version 1.1 
  - * 
  - * Copyright (c) 2002 The Apache Software Foundation. All rights 
  - * reserved. 
  - * 
  - * Redistribution and use in source and binary forms, with or without 
  - * modification, are permitted provided that the following conditions 
  - * are met: 
  - * 
  - * 1. Redistributions of source code must retain the above copyright 
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002 The Apache Software Foundation. All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
  @@ -20,13 +20,13 @@
    *    if any, must include the following acknowledgment:
    *    "This product includes software developed by the
    *    Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software 
  - *    itself, if and wherever such third-party acknowledgments  
  + *    Alternately, this acknowledgment may appear in the software
  + *    itself, if and wherever such third-party acknowledgments
    *    normally appear.
    *
  - * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation" 
  + * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
    *    must not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -49,51 +49,39 @@
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation. For more
  - * information on the Apache Software Foundation, please see 
  + * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  - */ 
  + */
   
   package org.apache.avalon.merlin.container.impl;
   
  -import java.util.List;
  -import java.util.Iterator;
   import java.util.ArrayList;
  -import java.util.Map;
   import java.util.Hashtable;
  +import java.util.List;
  +import java.util.Map;
   
  -import org.apache.avalon.assembly.engine.EngineClassLoader;
   import org.apache.avalon.assembly.appliance.Appliance;
  -import org.apache.avalon.assembly.appliance.ApplianceContext;
  -import org.apache.avalon.assembly.appliance.DefaultApplianceContext;
  -import org.apache.avalon.assembly.appliance.ApplianceException;
   import org.apache.avalon.assembly.appliance.DependencyGraph;
  -import org.apache.avalon.assembly.lifecycle.AssemblyException;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.Configurable;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.context.Context;
  -import org.apache.avalon.framework.context.Contextualizable;
  -import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.activity.Startable;
  +import org.apache.avalon.framework.context.Context;
  +import org.apache.avalon.framework.context.ContextException;
  +import org.apache.avalon.framework.context.Contextualizable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.merlin.container.Container;
   import org.apache.avalon.merlin.container.ContainerException;
  -import org.apache.avalon.merlin.container.ContainmentProfile;
   import org.apache.avalon.merlin.container.StateEvent;
   import org.apache.avalon.merlin.container.StateListener;
  -import org.apache.avalon.meta.model.Profile;
  -import org.apache.excalibur.configuration.ConfigurationUtil;
   
   /**
  - * <p>Default implementation of a container model within which a set 
  + * <p>Default implementation of a container model within which a set
    * of components and subsidiary containers are managed.</p>
    *
    * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
    */
  -public class DefaultContainer extends AbstractLogEnabled 
  +public class DefaultContainer extends AbstractLogEnabled
     implements Container, Contextualizable, Initializable, Disposable
   {
       //==============================================================
  @@ -254,7 +242,7 @@
        * Request for the container to resume all subsidiary containers
        * and all contained components.
        */
  -    public void resume() 
  +    public void resume()
       {
           if( m_state != StateEvent.SUSPENDED )
           {
  @@ -389,9 +377,9 @@
                   if( getLogger().isDebugEnabled() )
                   {
                       final String message =
  -                      "activating component (" 
  -                      + (i+1) + ":" + appliances.length + ") : " 
  -                      + appliance; 
  +                      "activating component ("
  +                      + (i+1) + ":" + appliances.length + ") : "
  +                      + appliance;
                       getLogger().debug( message );
                   }
                   try
  @@ -401,9 +389,9 @@
                       // ## Problems in the following code:
                       // ## 1. we are assuming an Avalon startup strategy
                       // ##    when in fact this should be handled by the appliance
  -                    // ## 2. this could be a singleton object that has already been 
  +                    // ## 2. this could be a singleton object that has already been
                       // ##    started.
  -                    // ## Solution - remove the notion of container startup,  
  +                    // ## Solution - remove the notion of container startup,
                       // ## suspension, resumption and stopping
                       //
   
  @@ -429,8 +417,8 @@
                   catch( Throwable e )
                   {
                       final String error =
  -                      "Could not establish a component: " 
  -                         + appliance.getName() 
  +                      "Could not establish a component: "
  +                         + appliance.getName()
                            + " in container: " + this;
                       throw new ContainerException( error, e );
                   }
  @@ -440,9 +428,9 @@
                   if( getLogger().isDebugEnabled() )
                   {
                       final String message =
  -                      "deferring activation of appliance (" 
  -                      + (i+1) + ":" + appliances.length + ") : " 
  -                      + appliance; 
  +                      "deferring activation of appliance ("
  +                      + (i+1) + ":" + appliances.length + ") : "
  +                      + appliance;
                       getLogger().debug( message );
                   }
               }
  @@ -455,7 +443,7 @@
       */
       private void suspendComponents()
       {
  -        // not implemented - more thinking needed about the 
  +        // not implemented - more thinking needed about the
           // concepts of deployment strategies
       }
   
  @@ -465,7 +453,7 @@
       */
       private void resumeComponents()
       {
  -        // not implemented - more thinking needed about the 
  +        // not implemented - more thinking needed about the
           // concepts of deployment strategies
       }
   
  
  
  
  1.9       +65 -118   avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernel.java
  
  Index: DefaultKernel.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernel.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultKernel.java	15 Apr 2003 04:43:55 -0000	1.8
  +++ DefaultKernel.java	16 Apr 2003 14:44:15 -0000	1.9
  @@ -51,73 +51,41 @@
   package org.apache.avalon.merlin.kernel.impl;
   
   import java.io.File;
  -import java.io.IOException;
  -import java.io.FileInputStream;
  -import java.io.InputStream;
   import java.net.URL;
  -import java.net.MalformedURLException;
  -import java.util.List;
  -import java.util.Iterator;
  -import java.util.Map;
  -import java.util.ArrayList;
  -import java.util.Hashtable;
  -import java.util.Enumeration;
  -import java.util.jar.JarFile;
  -import java.util.jar.Attributes;
  -import java.util.jar.Manifest;
  -import java.util.zip.ZipEntry;
  -import java.net.JarURLConnection;
   
  -import org.apache.avalon.assembly.logging.LoggingManager;
  -import org.apache.avalon.assembly.logging.LoggingDescriptor;
  -import org.apache.avalon.assembly.logging.DefaultLoggingManager;
  +import org.apache.avalon.assembly.appliance.DependencyGraph;
   import org.apache.avalon.assembly.engine.EngineClassLoader;
  -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.engine.model.ClasspathDescriptor;
   import org.apache.avalon.assembly.engine.model.DefaultClasspath;
  -import org.apache.avalon.assembly.util.ExceptionHelper;
  -import org.apache.avalon.assembly.appliance.Appliance;
  -import org.apache.avalon.assembly.appliance.ApplianceContext;
  -import org.apache.avalon.assembly.appliance.DefaultApplianceContext;
  -import org.apache.avalon.assembly.appliance.DependencyGraph;
  -import org.apache.avalon.assembly.appliance.ApplianceRepository;
  -import org.apache.avalon.assembly.appliance.DefaultApplianceRepository;
  +import org.apache.avalon.assembly.engine.model.LibraryDescriptor;
   import org.apache.avalon.assembly.locator.Contextualizable;
  -import org.apache.avalon.assembly.locator.Locator;
   import org.apache.avalon.assembly.locator.DefaultLocator;
  +import org.apache.avalon.assembly.locator.Locator;
  +import org.apache.avalon.assembly.logging.DefaultLoggingManager;
  +import org.apache.avalon.assembly.logging.LoggingDescriptor;
  +import org.apache.avalon.assembly.logging.LoggingManager;
  +import org.apache.avalon.assembly.util.ExceptionHelper;
   import org.apache.avalon.framework.CascadingException;
  -import org.apache.avalon.framework.logger.Logger;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.activity.Startable;
  -import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.Configurable;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
  +import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
  -import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.merlin.block.Block;
  -import org.apache.avalon.merlin.block.BlockLoader;
   import org.apache.avalon.merlin.block.impl.DefaultBlockLoader;
  -import org.apache.avalon.merlin.block.BlockException;
  -import org.apache.avalon.merlin.container.builder.XMLContainerCreator;
   import org.apache.avalon.merlin.container.Container;
  +import org.apache.avalon.merlin.container.builder.XMLContainerCreator;
   import org.apache.avalon.merlin.kernel.Kernel;
   import org.apache.avalon.merlin.kernel.KernelException;
  -import org.apache.avalon.merlin.kernel.KernelRuntimeException;
   import org.apache.avalon.meta.model.LoggingDirective;
  -import org.apache.avalon.meta.model.Profile;
  -import org.apache.avalon.meta.info.Type;
  -import org.apache.excalibur.configuration.ConfigurationUtil;
  -import org.apache.excalibur.mpool.DefaultPoolManager;
  -import org.apache.excalibur.mpool.PoolManager;
   import org.apache.excalibur.event.command.CommandManager;
   import org.apache.excalibur.event.command.TPCThreadManager;
  +import org.apache.excalibur.mpool.DefaultPoolManager;
  +import org.apache.excalibur.mpool.PoolManager;
   
   /**
    * Default kernel implementation.  The implementation provides support for
  @@ -178,12 +146,12 @@
       * The root block URL.
       */
       private URL m_url;
  -    
  +
      /**
       * The optional configuration overrides.
       */
       private URL m_override;
  -    
  +
      /**
       * The application home directory.
       */
  @@ -195,11 +163,6 @@
       private File m_root;
   
       /**
  -     * Logging channel for the container.
  -     */
  -    private Logger m_logger;
  -
  -    /**
        * Logging channel for the kernel;
        */
       private Logger m_local;
  @@ -210,11 +173,6 @@
       private ClassLoader m_loader;
   
       /**
  -     * The common classloader.
  -     */
  -    private ClassLoader m_common;
  -
  -    /**
        * The assembly engine.
        */
       private EngineClassLoader m_engine;
  @@ -230,11 +188,6 @@
       private Block m_block;
   
       /**
  -     * A map of root containers keyed by the block it is contained by.
  -     */
  -    private Map m_containers = new Hashtable();
  -
  -   /**
       * The domain name of this host.
       */
       private String m_domain;
  @@ -244,12 +197,7 @@
       */
       private final DependencyGraph m_graph = new DependencyGraph();
   
  -   /**
  -    * The block loader.
  -    */
  -    private DefaultBlockLoader m_blockLoader;
  -
  -   /**
  +    /**
       * The debug level.
       */
       private String m_debug;
  @@ -276,7 +224,7 @@
   
      /**
       * <p>Application of a runtime context to the kernel.
  -    * Context entries that may be supplied to an appliance manager are 
  +    * Context entries that may be supplied to an appliance manager are
       * detailed in the following table.</p>
       * <table BORDER="1" CELLSPACING="0" CELLPADDING="3" WIDTH="90%" >
       *   <tr BGCOLOR="#EEEEFF">
  @@ -285,7 +233,7 @@
       *   <tr>
       *     <td><code>urn:merlin:system</code></td>
       *     <td>{@link java.io.File}</td>
  -    *     <td>The Merlin system home directory.</td> 
  +    *     <td>The Merlin system home directory.</td>
       *   </tr>
       *   <tr>
       *     <td><code>urn:merlin:classloader.common</code></td>
  @@ -295,32 +243,32 @@
       *   <tr>
       *     <td><code>urn:merlin:classloader.system</code></td>
       *     <td>{@link java.lang.ClassLoader}</td>
  -    *     <td>The internal system classloader.</td> 
  +    *     <td>The internal system classloader.</td>
       *   </tr>
       *   <tr>
       *     <td><code>urn:merlin:debug</code></td>
       *     <td>{@link java.lang.String}</td>
  -    *     <td>The system logging priority (a value of INFO, WARN, ERROR, or DEBUG.</td> 
  +    *     <td>The system logging priority (a value of INFO, WARN, ERROR, or DEBUG.</td>
       *   </tr>
       *   <tr>
       *     <td><code>urn:merlin:logging.priority</code></td>
       *     <td>{@link java.lang.String}</td>
  -    *     <td>The default logging priority (a value of INFO, WARN, ERROR, or DEBUG.</td> 
  +    *     <td>The default logging priority (a value of INFO, WARN, ERROR, or DEBUG.</td>
       *   </tr>
       *   <tr>
       *     <td><code>urn:merlin:block.url</code></td>
       *     <td>{@link java.net.URL}</td>
  -    *     <td>The url to the block.xml file.</td> 
  +    *     <td>The url to the block.xml file.</td>
       *   </tr>
       *   <tr>
       *     <td><code>urn:merlin:block.config</code></td>
       *     <td>{@link java.net.URL}</td>
  -    *     <td>The url to a configuration overide file. This entry is optional.</td> 
  +    *     <td>The url to a configuration overide file. This entry is optional.</td>
       *   </tr>
       *   <tr>
       *     <td><code>urn:merlin:home</code></td>
       *     <td>{@link java.io.File}</td>
  -    *     <td>The working home directory.</td> 
  +    *     <td>The working home directory.</td>
       *   </tr>
       * </table>
       * @param context the runtime context
  @@ -328,7 +276,7 @@
       */
       public void contextualize( Locator context ) throws ContextException
       {
  -        if( m_contextualized ) 
  +        if( m_contextualized )
           {
               final String error =
                 "Illegal attempt to recontextualize the kernel.";
  @@ -337,7 +285,6 @@
   
           m_home = (File) context.get( "urn:merlin:home" );
           m_root = (File) context.get( "urn:merlin:system" );
  -        m_common = (ClassLoader) context.get( "urn:merlin:classloader.common" );
           m_loader = (ClassLoader) context.get( "urn:merlin:classloader.system" );
           if( context.hasEntry( "urn:merlin:debug" ) )
           {
  @@ -419,7 +366,7 @@
               final String sys = "sys";
               if( m_logging == null )
               {
  -                m_logging = bootstrapLoggingManager( 
  +                m_logging = bootstrapLoggingManager(
                     Container.PATH_SEPERATOR, sys, m_priority );
   
                   Configuration categoriesConfig = m_config.getChild( "categories" );
  @@ -429,7 +376,7 @@
                   //
   
                   LoggingDirective categories =
  -                  CREATOR.createLoggingDirective( 
  +                  CREATOR.createLoggingDirective(
                       Container.PATH_SEPERATOR, m_debug, categoriesConfig );
   
                   m_logging.addCategories( Container.PATH_SEPERATOR, categories );
  @@ -439,7 +386,7 @@
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Internal error while establishing the logging subsystem.";
               throw new CascadingException( error, e );
           }
  @@ -451,11 +398,11 @@
           m_pool = getPoolManager( m_config.getChild( "pool" ) );
   
           //
  -        // setup the domain 
  +        // setup the domain
           //
   
           m_domain = m_config.getChild( "system" ).getAttribute( "host", "localhost" );
  -        
  +
           //
           // announce initialization
           //
  @@ -472,12 +419,12 @@
           try
           {
               Configuration engine = m_config.getChild( "engine" );
  -            m_engine = bootstrapEngine( m_logging, m_pool, engine, m_loader, m_url );
  +            m_engine = bootstrapEngine( m_logging, m_pool, engine, m_loader );
               Thread.currentThread().setContextClassLoader( m_engine );
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Engine establishment error.";
               String log = ExceptionHelper.packException( error, e );
               if( getLogger().isErrorEnabled() )
  @@ -488,7 +435,7 @@
           }
   
           //
  -        // we are now ready to assemble the block 
  +        // we are now ready to assemble the block
           //
   
           m_installer = new DefaultBlockLoader();
  @@ -560,7 +507,7 @@
   
      /**
       * Install a block into the kernel.
  -    * @param base the URL of the block configuration or a jar file 
  +    * @param base the URL of the block configuration or a jar file
       *   containing a block descriptor
       * @param config a possibly null URL of a configuration file
       *   containing component configuration targets
  @@ -577,7 +524,7 @@
   
           if( !m_initialized )
           {
  -            final String error = 
  +            final String error =
                 "Kernel has not been initialized.";
               throw new IllegalStateException( error );
           }
  @@ -595,7 +542,7 @@
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Block install failure: " + m_url;
               String log = ExceptionHelper.packException( error, e );
               if( getLogger().isErrorEnabled() )
  @@ -616,7 +563,7 @@
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Unable to deploy block: " + block.getName() + " due to an assembly failure.";
               String log = ExceptionHelper.packException( error, e );
               if( getLogger().isErrorEnabled() )
  @@ -632,7 +579,7 @@
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Unable to deploy block: " + block.getName() + " due to an deployment failure.";
               String log = ExceptionHelper.packException( error, e );
               if( getLogger().isErrorEnabled() )
  @@ -646,12 +593,12 @@
       }
   
      /**
  -    * Shutdown the kernel during which orderly shutdown of all 
  +    * Shutdown the kernel during which orderly shutdown of all
       * installed blocks is undertaken.
       */
       public void shutdown()
       {
  -        if( getLogger() != null ) 
  +        if( getLogger() != null )
           {
               if( getLogger().isInfoEnabled() )
               {
  @@ -671,10 +618,10 @@
               {
                   if( getLogger().isWarnEnabled() )
                   {
  -                    final String error = 
  +                    final String error =
                         "Ignoring block decommissioning error.";
                       getLogger().warn( error, e );
  -                }        
  +                }
               }
           }
   
  @@ -697,8 +644,8 @@
       * @return the logging manager
       * @exception Exception if a logging manager establishment error occurs
       */
  -    private LoggingManager bootstrapLoggingManager( 
  -       String root, String system, String level ) 
  +    private LoggingManager bootstrapLoggingManager(
  +       String root, String system, String level )
          throws Exception
       {
   
  @@ -720,7 +667,7 @@
               DefaultLoggingManager logging = new DefaultLoggingManager();
   
               LoggingDescriptor descriptor =
  -              CREATOR.createLoggingDescriptor( 
  +              CREATOR.createLoggingDescriptor(
                   m_config.getChild( "logging" ), root, level );
   
               DefaultLocator context = new DefaultLocator();
  @@ -735,7 +682,7 @@
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Internal error while bootstrapping the logging subsystem.";
               throw new CascadingException( error, e );
           }
  @@ -743,16 +690,16 @@
   
      /**
       * 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 
  +    * @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, ClassLoader loader, URL base ) 
  +    private EngineClassLoader bootstrapEngine(
  +      LoggingManager logging, PoolManager pool, Configuration config, ClassLoader loader )
         throws Exception
       {
           if( m_home == null )
  @@ -779,7 +726,7 @@
           Configuration classpathConfig = config.getChild( "classpath", false );
           if( classpathConfig != null )
           {
  -            ClasspathDescriptor descriptor = 
  +            ClasspathDescriptor descriptor =
                 CREATOR.createClasspathDescriptor( classpathConfig );
               try
               {
  @@ -787,7 +734,7 @@
               }
               catch( IllegalArgumentException iae )
               {
  -                final String error = 
  +                final String error =
                    "Cannot construct classpath due to unresolvable base directory.";
                   throw new CascadingException( error, iae );
               }
  @@ -795,8 +742,8 @@
   
           try
           {
  -            EngineClassLoader engine = 
  -              new EngineClassLoader( 
  +            EngineClassLoader engine =
  +              new EngineClassLoader(
                   new URL[]{ DefaultBlockLoader.getBasePath( m_url ) }, loader );
   
               engine.enableLogging( getLogger() );
  @@ -823,19 +770,19 @@
   
               //
               // make sure that the merlin internal components are registered
  -            // (problem occurs when running under a junit test where the 
  +            // (problem occurs when running under a junit test where the
               // classloader does not expose the loaded jar files)
               //
   
               try
               {
  -                engine.register( 
  +                engine.register(
                     "org.apache.avalon.assembly.lifecycle.context.DefaultContextualizer" );
  -                engine.register( 
  +                engine.register(
                     "org.apache.avalon.assembly.lifecycle.context.AvalonContextualizer" );
  -                engine.register( 
  +                engine.register(
                     "org.apache.avalon.merlin.container.impl.DefaultContainer" );
  -                engine.register( 
  +                engine.register(
                     "org.apache.avalon.merlin.block.impl.DefaultBlock" );
               }
               catch( Throwable e )
  @@ -858,7 +805,7 @@
       */
       public String toString()
       {
  -        StringBuffer buffer = 
  +        StringBuffer buffer =
             new StringBuffer( "DefaultKernel: " + System.identityHashCode( this ) + " block: " );
   
           if( m_block != null )
  @@ -918,13 +865,13 @@
               // Set up the PoolManager that the pooled lifecycle helper needs
               //
   
  -            DefaultPoolManager poolManager = 
  +            DefaultPoolManager poolManager =
                 new DefaultPoolManager( commandManager.getCommandSink() );
               return poolManager;
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Internal error during establishment of the default pool manager. Cause: ";
               throw new Exception( error + e.toString() );
           }
  @@ -937,7 +884,7 @@
       private void setShutdownHook( final Kernel kernel )
       {
           //
  -        // Create a shutdown hook to trigger clean disposal of the 
  +        // Create a shutdown hook to trigger clean disposal of the
           // Merlin kernel
           //
   
  
  
  
  1.2       +16 -39    avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernelLoader.java
  
  Index: DefaultKernelLoader.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernelLoader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultKernelLoader.java	13 Mar 2003 01:05:13 -0000	1.1
  +++ DefaultKernelLoader.java	16 Apr 2003 14:44:15 -0000	1.2
  @@ -3,48 +3,25 @@
   package org.apache.avalon.merlin.kernel.impl;
   
   import java.io.File;
  -import java.io.IOException;
   import java.io.FileInputStream;
  -import java.io.InputStream;
   import java.io.IOException;
  -import java.io.FileNotFoundException;
  -import java.util.StringTokenizer;
  -import java.util.Enumeration;
  -import java.util.List;
  -import java.util.Iterator;
  -import java.util.jar.JarFile;
  -import java.util.ArrayList;
  +import java.io.InputStream;
   import java.util.Map;
  -import java.util.jar.Attributes;
  -import java.util.jar.Manifest;
  -import java.net.URLClassLoader;
  -import java.net.URL;
  -import java.util.zip.ZipEntry;
  -import java.net.MalformedURLException;
  -import java.net.JarURLConnection;
  -
  -import org.xml.sax.SAXException;
   
  +import org.apache.avalon.assembly.locator.DefaultLocator;
  +import org.apache.avalon.assembly.util.ExceptionHelper;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
  -import org.apache.avalon.framework.configuration.DefaultConfiguration;
  -import org.apache.avalon.framework.context.Context;
  -import org.apache.avalon.framework.context.DefaultContext;
  -import org.apache.avalon.framework.context.ContextException;
  -import org.apache.avalon.merlin.block.Block;
   import org.apache.avalon.merlin.block.BlockException;
  -import org.apache.avalon.assembly.util.ExceptionHelper;
  -import org.apache.avalon.assembly.locator.Contextualizable;
  -import org.apache.avalon.assembly.locator.DefaultLocator;
  -import org.apache.avalon.assembly.locator.Locator;
   import org.apache.avalon.merlin.kernel.Kernel;
  -import org.apache.avalon.merlin.kernel.KernelLoader;
   import org.apache.avalon.merlin.kernel.KernelException;
  -import org.apache.avalon.merlin.kernel.KernelRuntimeException;
  +import org.apache.avalon.merlin.kernel.KernelLoader;
  +
  +import org.xml.sax.SAXException;
   
   /**
  - * The DefaultKernelLoader provides support for the establishment of a kernel 
  + * The DefaultKernelLoader provides support for the establishment of a kernel
    * instance assuming a file system deployment environment.
    *
    * @see Kernel
  @@ -54,8 +31,8 @@
   public class DefaultKernelLoader
   {
      /**
  -    * Creation of a new Kernel instance.  Arguments passed 
  -    * passed to the kernel build operation are detailed in the following 
  +    * Creation of a new Kernel instance.  Arguments passed
  +    * passed to the kernel build operation are detailed in the following
       * table.
       *
       * <table BORDER="1" CELLSPACING="0" CELLPADDING="3" WIDTH="90%" >
  @@ -65,12 +42,12 @@
       *   <tr>
       *     <td><code>urn:merlin:home</code></td>
       *     <td>{@link java.io.File}</td>
  -    *     <td>The working home directory.</td> 
  +    *     <td>The working home directory.</td>
       *   </tr>
       *   <tr>
       *     <td><code>urn:merlin:system</code></td>
       *     <td>{@link java.io.File}</td>
  -    *     <td>The Merlin system directory.</td> 
  +    *     <td>The Merlin system directory.</td>
       *   </tr>
       *   <tr>
       *     <td><code>urn:merlin:classloader.common</code></td>
  @@ -80,13 +57,13 @@
       *   <tr>
       *     <td><code>urn:merlin:classloader.system</code></td>
       *     <td>{@link java.lang.ClassLoader}</td>
  -    *     <td>The Merlin internal classloader.</td> 
  +    *     <td>The Merlin internal classloader.</td>
       *   </tr>
       *   <tr>
       *     <td><code>urn:merlin:debug</code></td>
       *     <td>{@link java.lang.String}</td>
  -    *     <td>An optional system logging priority (a value of INFO, WARN, ERROR, or DEBUG) to 
  -    *       be used for internal Merlin execution.</td> 
  +    *     <td>An optional system logging priority (a value of INFO, WARN, ERROR, or DEBUG) to
  +    *       be used for internal Merlin execution.</td>
       *   </tr>
       * </table>
       *
  @@ -98,7 +75,7 @@
   
           //
           // get the kernel configuration profile
  -        //     
  +        //
   
           File profile = (File) map.get( "urn:merlin:kernel.profile" );
   
  @@ -147,7 +124,7 @@
           }
       }
   
  -    private Configuration getKernelConfiguration( final File file ) 
  +    private Configuration getKernelConfiguration( final File file )
         throws ConfigurationException, IOException, SAXException
       {
           DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
  
  
  
  1.2       +19 -18    avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/service/ServiceManagementContext.java
  
  Index: ServiceManagementContext.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/service/ServiceManagementContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServiceManagementContext.java	13 Mar 2003 01:05:16 -0000	1.1
  +++ ServiceManagementContext.java	16 Apr 2003 14:44:15 -0000	1.2
  @@ -1,14 +1,14 @@
  -/* ==================================================================== 
  - * The Apache Software License, Version 1.1 
  - * 
  - * Copyright (c) 2002 The Apache Software Foundation. All rights 
  - * reserved. 
  - * 
  - * Redistribution and use in source and binary forms, with or without 
  - * modification, are permitted provided that the following conditions 
  - * are met: 
  - * 
  - * 1. Redistributions of source code must retain the above copyright 
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002 The Apache Software Foundation. All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
  @@ -20,13 +20,13 @@
    *    if any, must include the following acknowledgment:
    *    "This product includes software developed by the
    *    Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software 
  - *    itself, if and wherever such third-party acknowledgments  
  + *    Alternately, this acknowledgment may appear in the software
  + *    itself, if and wherever such third-party acknowledgments
    *    normally appear.
    *
  - * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation" 
  + * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
    *    must not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -49,13 +49,14 @@
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation. For more
  - * information on the Apache Software Foundation, please see 
  + * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  - */ 
  + */
   
   package org.apache.avalon.merlin.service;
   
   import java.net.MalformedURLException;
  +
   import org.apache.avalon.assembly.appliance.Appliance;
   
   /**
  
  
  

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