avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/merlin-smp/src/examples/afs/simple/src/test/org/apache AbstractTestCase.java
Date Tue, 29 Apr 2003 14:39:45 GMT
mcconnell    2003/04/29 07:39:45

  Modified:    merlin/assembly/src/java/org/apache/avalon/assembly/engine/impl
                        DefaultRepositoryManager.java
               merlin/assembly/src/test/org/apache/avalon/assembly/engine
                        ApplianceTestCase.java
               merlin/assembly/src/test/org/apache/avalon/assembly/engine/profile
                        ProfileRepositoryTestCase.java
               merlin/assembly/src/test/org/apache/avalon/assembly/engine/service
                        ServiceRepositoryTestCase.java
               merlin/assembly/src/test/org/apache/avalon/assembly/engine/type
                        TypeRepositoryTestCase.java
               merlin/merlin-core/src/test/org/apache/avalon/merlin
                        AbstractTestCase.java
               merlin/merlin-smp/src/examples/afs/simple/src/test/org/apache
                        AbstractTestCase.java
  Added:       merlin/assembly/src/java/org/apache/avalon/assembly/engine/impl
                        DefaultProfileRepository.java
                        DefaultProfileSelector.java
                        DefaultServiceRepository.java
                        DefaultTypeRepository.java
  Removed:     merlin/assembly/src/java/org/apache/avalon/assembly/engine/profile/impl
                        DefaultProfileRepository.java
                        DefaultProfileSelector.java package.html
               merlin/assembly/src/java/org/apache/avalon/assembly/engine/service/impl
                        DefaultServiceRepository.java package.html
               merlin/assembly/src/java/org/apache/avalon/assembly/engine/type/impl
                        DefaultTypeRepository.java package.html
  Log:
  consolidating enging impl classes
  
  Revision  Changes    Path
  1.2       +1 -4      avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/engine/impl/DefaultRepositoryManager.java
  
  Index: DefaultRepositoryManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/engine/impl/DefaultRepositoryManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultRepositoryManager.java	26 Apr 2003 12:37:43 -0000	1.1
  +++ DefaultRepositoryManager.java	29 Apr 2003 14:39:41 -0000	1.2
  @@ -71,11 +71,8 @@
   import org.apache.avalon.assembly.engine.EngineRuntimeException;
   import org.apache.avalon.assembly.engine.RepositoryManager;
   import org.apache.avalon.assembly.engine.profile.ProfileRepository;
  -import org.apache.avalon.assembly.engine.profile.impl.DefaultProfileRepository;
   import org.apache.avalon.assembly.engine.service.ServiceRepository;
  -import org.apache.avalon.assembly.engine.service.impl.DefaultServiceRepository;
   import org.apache.avalon.assembly.engine.type.TypeRepository;
  -import org.apache.avalon.assembly.engine.type.impl.DefaultTypeRepository;
   import org.apache.avalon.assembly.util.ExceptionHelper;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  
  
  
  1.1                  avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/engine/impl/DefaultProfileRepository.java
  
  Index: DefaultProfileRepository.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, 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 notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, 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 normally appear.
  
   4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
      "Apache Software Foundation"  must not be used to endorse or promote
      products derived  from this  software without  prior written
      permission. For written permission, please contact apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   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 <http://www.apache.org/>.
  
  */
  
  package org.apache.avalon.assembly.engine.impl;
  
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  
  import org.apache.avalon.assembly.engine.profile.DuplicateProfileException;
  import org.apache.avalon.assembly.engine.profile.ProfileException;
  import org.apache.avalon.assembly.engine.profile.ProfileRuntimeException;
  import org.apache.avalon.assembly.engine.profile.ProfileRepository;
  import org.apache.avalon.assembly.engine.profile.ProfileSelector;
  import org.apache.avalon.assembly.engine.type.UnknownTypeException;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.logger.LogEnabled;
  import org.apache.avalon.meta.info.DependencyDescriptor;
  import org.apache.avalon.meta.info.ReferenceDescriptor;
  import org.apache.avalon.meta.info.StageDescriptor;
  import org.apache.avalon.meta.info.Type;
  import org.apache.avalon.meta.model.Profile;
  import org.apache.avalon.meta.model.builder.ProfileBuilder;
  import org.apache.avalon.meta.model.verifier.ProfileVerifier;
  import org.apache.excalibur.configuration.ConfigurationUtil;
  
  /**
   * A profile manager implemetation provides support for the creation,
   * storage and retrival of component types.
   *
   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
   * @version $Revision: 1.1 $ $Date: 2003/04/29 14:39:41 $
   */
  public class DefaultProfileRepository extends AbstractLogEnabled implements ProfileRepository
  {
      //==============================================================
      // static
      //==============================================================
  
      /**
       * The profile builder.
       */
      private static final ProfileBuilder PROFILE_BUILDER = new ProfileBuilder();
  
      //==============================================================
      // state
      //==============================================================
  
      /**
       * The classloader supplied to the manager.
       */
      private ClassLoader m_classloader;
  
      /**
       * The parent profile manager (may be null)
       */
      private ProfileRepository m_parent;
  
      /**
       * List of component profiles.
       */
      private final List m_profiles = new ArrayList();
  
      /**
       * The default profile selector.
       */
      private final DefaultProfileSelector m_selector = new DefaultProfileSelector();
  
      //==============================================================
      // constructor
      //==============================================================
  
      /**
       * Creation of a new root profile manager.
       * @param classloader the classloder to use
       * @exception NullPointerException if the classloader is null
       */
      public DefaultProfileRepository( ClassLoader classloader ) throws NullPointerException
      {
          this( classloader, null );
      }
  
      /**
       * Creation of a new profile manager.
       * @param classloader the classloder to use
       * @param parent the parent type manager
       * @exception NullPointerException if the classloader is null
       */
      public DefaultProfileRepository( ClassLoader classloader, ProfileRepository parent )
              throws NullPointerException
      {
          if( classloader == null )
          {
              throw new NullPointerException( "classloader" );
          }
          m_classloader = classloader;
          m_parent = parent;
      }
  
      //==============================================================
      // implemetation
      //==============================================================
  
      /**
       * Load a set of packaged profiles associated with the supplied class.
       * Profiles returned from this operation are not included within the
       * manager.  To register a profile with the manager use the {@link #addProfile}
       * operation.
       *
       * @param type the component type used to locate an packaged profiles
       * @return the set of packaged component profiles
       * @exception ProfileException if an error occurs while loading package profiles
       */
      public Profile[] loadProfiles( Type type ) throws ProfileException
      {
          if( type == null )
          {
              throw new NullPointerException( "type" );
          }
  
          try
          {
              return PROFILE_BUILDER.build( m_classloader, type );
          } catch( Throwable e )
          {
              final String error =
                      "Unable to create packaged profiles for type: "
                      + type.getInfo().getClassname();
              throw new ProfileException( error, e );
          }
      }
  
      /**
       * Create a profile from a supplied configuration.
       *
       * @param type the component type that the profile qualifies
       * @param config a configuration fragment describing the deployment profile
       * @return the deployment profile
       * @exception ProfileException if an error occurs while attempting to create a profiles
       */
      public Profile createProfile( Type type, Configuration config )
              throws ProfileException
      {
          if( type == null )
          {
              throw new NullPointerException( "type" );
          }
          if( config == null )
          {
              throw new NullPointerException( "config" );
          }
  
          try
          {
              return PROFILE_BUILDER.build( type, config );
          } catch( Throwable e )
          {
              final String error =
                      "Profile build error while constructing a profile from supplied configuration:\n"
                      + ConfigurationUtil.list( config );
              throw new ProfileException( error, e );
          }
      }
  
      /**
       * Add a set of profiles to the manager.
       * @param profiles the deployment profiles to added to the manager
       * @exception DuplicateProfileException if a profile of the same name
       *   is already registered with the manager and the supplied profile
       *   is a equal or lower in priority
       * @exception ProfileException if a profile verification failure occurs
       * @see #createProfile
       */
      public void addProfiles( Profile[] profiles ) throws DuplicateProfileException, ProfileException
      {
          for( int i = 0; i < profiles.length; i++ )
          {
              Profile profile = profiles[i];
              addProfile( profile );
          }
      }
  
      /**
       * Add or replace profile to the manager.
       * @param profile the deployment profile to add to the manager
       * @exception DuplicateProfileException if a profile of the same name
       *   is already registered with the manager and the replacement policy is true
       * @exception ProfileException if a profile verification failure occurs
       * @see #createProfile
       */
      public void addProfile( Profile profile ) throws DuplicateProfileException, ProfileException
      {
          addProfile( profile, true );
      }
  
      /**
       * Add a profile to the manager using the supplied profile and replacement policy
       * @param profile the deployment profile to add to the manager
       * @exception DuplicateProfileException if a profile of the same name
       *   is already registered with the manager and the replacement policy is true
       * @exception ProfileException if a profile verification failure occurs
       * @see #createProfile
       */
      public void addProfile( Profile profile, boolean replace )
              throws DuplicateProfileException, ProfileException
      {
          if( profile == null )
          {
              throw new NullPointerException( "profile" );
          }
  
          if( getLogger() == null )
          {
              throw new IllegalStateException( "logging" );
          }
  
          try
          {
              verify( profile );
          } catch( Throwable e )
          {
              final String error =
                      "Could not register the profile: " + profile
                      + " due to a verification failure.";
              throw new ProfileException( error, e );
          }
  
          if( getLogger().isDebugEnabled() )
          {
              getLogger().debug(
                      "add: " + profile + " " + profile.getMode() );
          }
  
          m_profiles.add( profile );
  
      }
  
      /**
       * Get the preferred profile for a supplied type.
       * @param type the component type
       * @return the profile matching the type
       * @exception UnknownTypeException if the type is unknown to the manager
       */
      public Profile getProfile( Type type ) throws UnknownTypeException
      {
          Iterator iterator = m_profiles.iterator();
          while( iterator.hasNext() )
          {
              Profile profile = (Profile) iterator.next();
              if( profile.getType().equals( type ) )
              {
                  return profile;
              }
          }
  
          if( m_parent != null )
          {
              return m_parent.getProfile( type );
          } else
          {
              return null;
          }
      }
  
      /**
       * Get the set of profiles declared for a particular type.
       * @param type the component type
       * @return the set of profile matching the type.
       * @exception UnknownTypeException if the type is unknown to the manager
       */
      public Profile[] getProfiles( Type type ) throws UnknownTypeException
      {
          if( type == null )
          {
              throw new NullPointerException( "type" );
          }
  
          ArrayList list = new ArrayList();
          if( m_parent != null )
          {
              Profile[] profiles = m_parent.getProfiles( type );
              for( int i = 0; i < profiles.length; i++ )
              {
                  list.add( profiles[i] );
              }
          }
  
          Iterator iterator = m_profiles.iterator();
          while( iterator.hasNext() )
          {
              Profile profile = (Profile) iterator.next();
              if( profile.getType().equals( type ) )
              {
                  list.add( type );
              }
          }
  
          return (Profile[]) list.toArray( new Profile[0] );
      }
  
      /**
       * Locate the set of component profiles capable of services the supplied
       * dependency.
       * @param dependency a service dependency descriptor
       * @return a set of profiles capable of servicing the supplied dependency
       */
      public Profile[] getProfiles( DependencyDescriptor dependency )
      {
          if( dependency == null )
          {
              throw new NullPointerException( "dependency" );
          }
  
          ArrayList list = new ArrayList();
          if( m_parent != null )
          {
              Profile[] profiles = m_parent.getProfiles( dependency );
              for( int i = 0; i < profiles.length; i++ )
              {
                  list.add( profiles[i] );
              }
          }
  
          ReferenceDescriptor reference = dependency.getReference();
  
          Iterator iterator = m_profiles.iterator();
          while( iterator.hasNext() )
          {
              Profile profile = (Profile) iterator.next();
              Object service = profile.getService( reference );
              if( service != null )
              {
                  list.add( profile );
              }
          }
  
          return (Profile[]) list.toArray( new Profile[0] );
      }
  
      /**
       * Locate the set of component profiles that provide the supplied extension.
       * @param stage a stage descriptor
       * @return a set of types that provide the supplied service
       */
      public Profile[] getProfiles( StageDescriptor stage )
      {
          if( stage == null )
          {
              throw new NullPointerException( "stage" );
          }
  
          ArrayList list = new ArrayList();
          if( m_parent != null )
          {
              Profile[] profiles = m_parent.getProfiles( stage );
              for( int i = 0; i < profiles.length; i++ )
              {
                  list.add( profiles[i] );
              }
          }
  
          Iterator iterator = m_profiles.iterator();
          while( iterator.hasNext() )
          {
              Profile profile = (Profile) iterator.next();
              if( profile.getType().getExtension( stage ) != null )
              {
                  list.add( profile );
              }
          }
  
          return (Profile[]) list.toArray( new Profile[0] );
      }
  
      /**
       * Locate the set of profiles tied to a type capable of supporting a service
       * referenced by a supplied dependency descriptor using the default selector.
       * @param dependency a service depedency descriptor
       * @return a set of profiles capable of servicing the supplied dependency
       * @todo replace the code concerning selector establishment with full
       *   component support
       */
      public Profile getProfile( DependencyDescriptor dependency )
      {
          String classname = dependency.getAttribute( "urn:avalon:profile.selector", null );
          if( classname == null )
          {
              return getProfile( dependency, m_selector );
          } else
          {
              try
              {
                  Class clazz = m_classloader.loadClass( classname );
                  ProfileSelector selector = (ProfileSelector) clazz.newInstance();
                  if( selector instanceof LogEnabled )
                  {
                      ((LogEnabled) selector).enableLogging( getLogger().getChildLogger( "selector" ) );
                  }
                  return getProfile( dependency, selector );
              } catch( Throwable e )
              {
                  final String error =
                          "Unexpected error while attempting to create a custom seletor: "
                          + classname;
                  throw new ProfileRuntimeException( error, e );
              }
          }
      }
  
      /**
       * Locate the set of profiles tied to a type capable of supporting a service
       * referenced by a supplied dependency descriptor using a supplied selector.
       * @param dependency a service depedency descriptor
       * @param selector a profile selector
       * @return a set of profiles capable of servicing the supplied dependency
       */
      public Profile getProfile( DependencyDescriptor dependency, ProfileSelector selector )
      {
          Profile[] profiles = getProfiles( dependency );
          return selector.select( profiles, dependency );
      }
  
      /**
       * Locate a profile tied to a type capable of supporting an extension
       * referenced by a supplied stage descriptor usign the default selector.
       * @param stage a stage descriptor
       * @return a set of types that provide the supplied service
       * @todo add selector support
       */
      public Profile getProfile( StageDescriptor stage )
      {
          return getProfile( stage, m_selector );
      }
  
      /**
       * Locate a profile tied to a type capable of supporting an extension
       * referenced by a supplied stage descriptor usign the a suplied selector.
       * @param stage a stage descriptor
       * @param selector a profile selector
       * @return a set of types that provide the supplied service
       */
      public Profile getProfile( StageDescriptor stage, ProfileSelector selector )
      {
          Profile[] profiles = getProfiles( stage );
          return selector.select( profiles, stage );
      }
  
      /**
       * Verify the supplied profile.
       * @param profile the profile to verify
       * @exception ProfileException if the verification failes
       */
      private void verify( Profile profile ) throws ProfileException
      {
          if( profile == null )
          {
              throw new NullPointerException( "profile" );
          }
  
          ProfileVerifier verifier = new ProfileVerifier();
          try
          {
              verifier.verifyType( profile, m_classloader );
          } catch( Throwable e )
          {
              final String error = "Verification failure for profile: "
                      + profile.getName() + " from type: "
                      + profile.getType().getInfo().getClassname();
              throw new ProfileException( error, e );
          }
      }
  }
  
  
  
  1.1                  avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/engine/impl/DefaultProfileSelector.java
  
  Index: DefaultProfileSelector.java
  ===================================================================
  /* ====================================================================
   * 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
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    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
   *    normally appear.
   *
   * 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
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * 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
   * <http://www.apache.org/>.
   */
  
  package org.apache.avalon.assembly.engine.impl;
  
  import org.apache.avalon.assembly.engine.profile.ProfileSelector;
  import org.apache.avalon.meta.info.DependencyDescriptor;
  import org.apache.avalon.meta.info.StageDescriptor;
  import org.apache.avalon.meta.model.Mode;
  import org.apache.avalon.meta.model.Profile;
  
  /**
   * Default selector class. The default selector selcts profiles based
   * of ranking of profile relative to EXPLICIT, PACKAGED and IMPLICIT
   * status. For each category, if a supplied profile matches the category
   * the first profile matching the category is returned.
   *
   * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
   * @version $Revision: 1.1 $ $Date: 2003/04/29 14:39:41 $
   */
  class DefaultProfileSelector implements ProfileSelector
  {
  
      /**
       * Returns the preferred profile form an available selection of
       * candidate profiles.
       * @param profiles the set of candidate profiles
       * @param dependency the service dependency
       * @return the preferred profile or null if no satisfactory provider can be established
       */
      public Profile select( Profile[] profiles, DependencyDescriptor dependency )
      {
          if( profiles.length == 0 )
          {
              return null;
          }
  
          Profile profile = select( profiles, dependency, Mode.EXPLICIT );
          if( profile == null )
          {
              profile = select( profiles, dependency, Mode.PACKAGED );
          }
          if( profile == null )
          {
              profile = select( profiles, dependency, Mode.IMPLICIT );
          }
          if( profile != null )
          {
              return profile;
          }
          if( profiles.length > 0 )
          {
              return profiles[0];
          } else
          {
              return null;
          }
      }
  
      /**
       * Returns the preferred profile form an available selection of
       * candidate profiles.
       * @param profiles the set of candidate profiles
       * @param stage the service stage depedency
       * @return the prefered profile or null if no satisfactory provider can be established
       */
      public Profile select( Profile[] profiles, StageDescriptor stage )
      {
          if( profiles.length == 0 )
          {
              return null;
          }
  
          Profile profile = select( profiles, stage, Mode.EXPLICIT );
          if( profile == null )
          {
              profile = select( profiles, stage, Mode.PACKAGED );
          }
          if( profile == null )
          {
              profile = select( profiles, stage, Mode.IMPLICIT );
          }
          if( profile != null )
          {
              return profile;
          }
          if( profiles.length > 0 )
          {
              return profiles[0];
          } else
          {
              return null;
          }
      }
  
  
      /**
       * Returns the fist profile that matches the depedency and mode criteria.
       * @param profiles a set of candidate profiles
       * @param dependency the service dependency
       * @param mode the slection mode
       * @return the selected profile
       */
      private Profile select( Profile[] profiles, DependencyDescriptor dependency, Mode mode )
      {
          for( int i = 0; i < profiles.length; i++ )
          {
              Profile profile = profiles[i];
              if( profile.getService( dependency.getReference() ) != null )
              {
                  if( profile.getMode().equals( mode ) )
                  {
                      return profile;
                  }
              }
          }
          return null;
      }
  
      /**
       * Returns the fist profile that matches the stage and mode criteria.
       * @param profiles a set of candidate profiles
       * @param dependency the service dependency
       * @param mode the slection mode
       * @return the selected profile
       */
      private Profile select( Profile[] profiles, StageDescriptor stage, Mode mode )
      {
          for( int i = 0; i < profiles.length; i++ )
          {
              Profile profile = profiles[i];
              if( profile.getType().getExtension( stage ) != null )
              {
                  if( profile.getMode().equals( mode ) )
                  {
                      return profile;
                  }
              }
          }
          return null;
      }
  }
  
  
  
  1.1                  avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/engine/impl/DefaultServiceRepository.java
  
  Index: DefaultServiceRepository.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, 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 notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, 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 normally appear.
  
   4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
      "Apache Software Foundation"  must not be used to endorse or promote
      products derived  from this  software without  prior written
      permission. For written permission, please contact apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   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 <http://www.apache.org/>.
  
  */
  
  package org.apache.avalon.assembly.engine.impl;
  
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  
  import org.apache.avalon.assembly.engine.service.DuplicateServiceException;
  import org.apache.avalon.assembly.engine.service.ServiceException;
  import org.apache.avalon.assembly.engine.service.UnknownServiceException;
  import org.apache.avalon.assembly.engine.service.ServiceRepository;
  import org.apache.avalon.framework.Version;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.meta.info.ReferenceDescriptor;
  import org.apache.avalon.meta.info.Service;
  import org.apache.avalon.meta.info.builder.ServiceBuilder;
  
  /**
   * A service repository provides support for the storage and retrival
   * of service defintions.
   *
   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
   * @version $Revision: 1.1 $ $Date: 2003/04/29 14:39:41 $
   */
  public class DefaultServiceRepository extends AbstractLogEnabled implements ServiceRepository
  {
      //==============================================================
      // state
      //==============================================================
  
      /**
       * The classloader supplied to the manager.
       */
      private ClassLoader m_classloader;
  
      /**
       * The parent service manager (may be null)
       */
      private ServiceRepository m_parent;
  
      /**
       * The service builder.
       */
      private static final ServiceBuilder DEFAULT_BUILDER = new ServiceBuilder();
  
      /**
       * List of service entries.
       */
      private List m_services = new ArrayList();
  
      //==============================================================
      // constructor
      //==============================================================
  
      /**
       * Creation of a new root service manager.
       * @param classloader the classloder to use
       * @exception NullPointerException if the classloader is null
       */
      public DefaultServiceRepository( ClassLoader classloader ) throws NullPointerException
      {
          this( classloader, null );
      }
  
      /**
       * Creation of a new service manager.
       * @param classloader the classloder to use
       * @param parent the parent type manager
       * @exception NullPointerException if the classloader is null
       */
      public DefaultServiceRepository( ClassLoader classloader, ServiceRepository parent ) throws NullPointerException
      {
          if( classloader == null )
          {
              throw new NullPointerException( "classloader" );
          }
          m_classloader = classloader;
          m_parent = parent;
      }
  
      //==============================================================
      // implemetation
      //==============================================================
  
      /**
       * Create a services associated from a supplied path.
       *
       * @param clazz the service class
       * @return the service defintions
       * @exception ServiceException if an error occurs during service creation
       */
      public Service createService( Class clazz ) throws ServiceException
      {
          if( clazz == null )
          {
              throw new NullPointerException( "clazz" );
          }
  
          try
          {
              return DEFAULT_BUILDER.build( clazz.getName(), clazz.getClassLoader() );
          } catch( Throwable e )
          {
              final String error =
                      "Could not create a service relative to the path: "
                      + clazz.getName() + " due to a service build error.";
              throw new ServiceException( error, e );
          }
      }
  
      /**
       * Create a service instance based on a supplied classname.
       *
       * @param classname the component implementation classname
       * @return the service defintion
       * @exception ServiceException if an error occurs during service creation
       */
      public Service createService( String classname ) throws ServiceException
      {
          if( classname == null )
          {
              throw new NullPointerException( "classname" );
          }
  
          try
          {
              Class clazz = m_classloader.loadClass( classname );
              return createService( clazz );
          } catch( Throwable e )
          {
              final String error =
                "Unexpected error while attempting to build a service from the classname: " 
                + classname;
              throw new ServiceException( error, e );
          }
      }
  
      /**
       * Locate a {@link Service} instances associated with the
       * supplied classname and version. If a service defintion is not
       * found locally, the implementation redirects the request to
       * the parent service manager.
       *
       * @param classname the service class name
       * @param version the service version
       * @return the service matching the supplied classname and version.
       * @exception UnknownServiceException if a matching service cannot be found
       */
      public Service getService( String classname, Version version ) throws UnknownServiceException
      {
          return getService( new ReferenceDescriptor( classname, version ) );
      }
  
      /**
       * Locate a {@link Service} instances associated with the
       * supplied referecne descriptor. If a service defintion is not
       * found locally, the implementation redirects the request to
       * the parent service manager.
       *
       * @param classname the service class name
       * @param reference the reference descriptor
       * @return the service matching the supplied descriptor.
       * @exception UnknownServiceException if a matching service cannot be found
       */
      public Service getService( ReferenceDescriptor reference ) throws UnknownServiceException
      {
          Service service = getLocalService( reference );
          if( service == null )
          {
              if( m_parent != null )
              {
                  return m_parent.getService( reference );
              } else
              {
                  final String error = "Unknown service defintion: " + reference;
                  throw new UnknownServiceException( error );
              }
          }
          return service;
      }
  
      private Service getLocalService( ReferenceDescriptor reference )
      {
          Iterator iterator = m_services.iterator();
          while( iterator.hasNext() )
          {
              Service service = (Service) iterator.next();
              if( service.equals( reference ) )
              {
                  return service;
              }
          }
          return null;
      }
  
      /**
       * Add a service to the manager.
       *
       * @param service the service defintion
       * @exception DuplicateServiceException if the service already exists
       * @exception ServiceException if the service definition is invalid
       */
      public void addService( Service service ) throws DuplicateServiceException, ServiceException
      {
          if( getLogger() == null )
          {
              throw new IllegalStateException( "logging" );
          }
  
          //
          // make sure that there is not already a local defintion for
          // this service
          //
  
          try
          {
              getService( service.getReference() );
              throw new DuplicateServiceException( service.toString() );
          } catch( UnknownServiceException use )
          {
              // continue
          }
  
          //
          // make sure we are dealing with a service that is verified
          //
  
          verifyService( service );
  
          //
          // make sure that there is not already a local defintion for
          // this service
          //
  
          m_services.add( service );
  
          if( getLogger().isDebugEnabled() )
          {
              StringBuffer buffer = new StringBuffer();
              buffer.append( "add: " + service.getClassname() );
              buffer.append( ":" + service.getVersion() );
              buffer.append( ", entries: " + service.getEntries().length );
              buffer.append( ", attributes: " + service.getAttributeNames().length );
              getLogger().debug( buffer.toString() );
          }
      }
  
      /**
       * Verify that a class exists within the classloader representing the
       * service type.
       * @param service the service to verify
       * @exception ServiceException if a verification error occurs
       */
      private void verifyService( Service service ) throws ServiceException
      {
          Class clazz;
          try
          {
              clazz = m_classloader.loadClass( service.getClassname() );
          } catch( Throwable e )
          {
              final String error = "Unresolvable service class.";
              throw new ServiceException( error, e );
          }
      }
  }
  
  
  
  1.1                  avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/engine/impl/DefaultTypeRepository.java
  
  Index: DefaultTypeRepository.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, 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 notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, 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 normally appear.
  
   4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
      "Apache Software Foundation"  must not be used to endorse or promote
      products derived  from this  software without  prior written
      permission. For written permission, please contact apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   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 <http://www.apache.org/>.
  
  */
  
  package org.apache.avalon.assembly.engine.impl;
  
  import java.util.ArrayList;
  import java.util.Enumeration;
  import java.util.Hashtable;
  import java.util.Iterator;
  
  import org.apache.avalon.assembly.engine.type.DuplicateTypeException;
  import org.apache.avalon.assembly.engine.type.TypeRepository;
  import org.apache.avalon.assembly.engine.type.TypeException;
  import org.apache.avalon.assembly.engine.type.TypeRuntimeException;
  import org.apache.avalon.assembly.engine.type.UnknownTypeException;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.meta.info.DependencyDescriptor;
  import org.apache.avalon.meta.info.ReferenceDescriptor;
  import org.apache.avalon.meta.info.ServiceDescriptor;
  import org.apache.avalon.meta.info.StageDescriptor;
  import org.apache.avalon.meta.info.Type;
  import org.apache.avalon.meta.info.builder.TypeBuilder;
  import org.apache.avalon.meta.verifier.ComponentVerifier;
  
  /**
   * A type manager implemetation provides support for the creation,
   * storage and retrival of component types.
   *
   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
   * @version $Revision: 1.1 $ $Date: 2003/04/29 14:39:43 $
   */
  public class DefaultTypeRepository extends AbstractLogEnabled implements TypeRepository
  {
      //==============================================================
      // static
      //==============================================================
  
      /**
       * The type builder.
       */
      private static final TypeBuilder DEFAULT_BUILDER = new TypeBuilder();
  
      //==============================================================
      // state
      //==============================================================
  
      /**
       * The classloader supplied to the manager.
       */
      private ClassLoader m_classloader;
  
      /**
       * The parent type manager (may be null)
       */
      private TypeRepository m_parent;
  
      /**
       * Table of component types keyed by implementation classname.
       */
      private final Hashtable m_types = new Hashtable();
  
      //==============================================================
      // constructor
      //==============================================================
  
      /**
       * Creation of a new root type manager.
       * @param classloader the classloder to use
       * @exception NullPointerException if the classloader is null
       */
      public DefaultTypeRepository( ClassLoader classloader ) throws NullPointerException
      {
          this( classloader, null );
      }
  
      /**
       * Creation of a new type manager.
       * @param classloader the classloder to use
       * @param parent the parent type manager
       * @exception NullPointerException if the classloader is null
       */
      public DefaultTypeRepository( ClassLoader classloader, TypeRepository parent )
        throws NullPointerException
      {
          if( classloader == null )
          {
              throw new NullPointerException( "classloader" );
          }
          m_classloader = classloader;
          m_parent = parent;
      }
  
      //==============================================================
      // DefaultTypeRepository
      //==============================================================
  
      /**
       * Create a new type instance.  The type instance returned is not
       * registered with the manager.  To register the type the client
       * must explicity declare the type using the {@link #addType}
       * operation.
       *
       * @param clazz the component implementation class
       * @return the component type
       * @exception TypeException is a type creation error occurs
       * @see #addType
       */
      public Type createType( Class clazz ) throws TypeException
      {
          if( clazz == null )
          {
              throw new NullPointerException( "clazz" );
          }
  
          try
          {
              return DEFAULT_BUILDER.build( clazz.getName(), clazz.getClassLoader() );
          } catch( Throwable e )
          {
              final String error =
                      "Could not register a type relative to the path: "
                      + clazz.getName()
                      + " due to a type build error.";
              throw new TypeException( error, e );
          }
      }
  
      /**
       * Create a type instance based on a supplied classname and classloader.
       *
       * @param classname the component implementation classname
       * @return the component type
       * @exception TypeException is a type creation error occurs
       */
      public Type createType( String classname ) throws TypeException
      {
          if( classname == null )
          {
              throw new NullPointerException( "classname" );
          }
  
          try
          {
              Class clazz = m_classloader.loadClass( classname );
              return createType( clazz );
          } catch( Throwable e )
          {
              final String error =
                "Unexpected error while attempting to build a type from the classname: " 
                + classname;
              throw new TypeException( error, e );
          }
      }
  
      /**
       * Add a type to the manager.
       * @param type the component type description.
       * @exception DuplicateTypeException if the supplied type is already registered
       * @exception TypeException if a type verification failure occurs
       * @see #createType
       */
      public void addType( Type type ) throws DuplicateTypeException, TypeException
      {
          if( type == null )
          {
              throw new NullPointerException( "type" );
          }
  
          if( getLogger() == null )
          {
              throw new IllegalStateException( "logging" );
          }
  
          final String classname = type.getInfo().getClassname();
  
          try
          {
              type = getType( classname );
              //throw new DuplicateTypeException( classname );
              return;
          } catch( UnknownTypeException ute )
          {
              try
              {
                  verify( type );
              } catch( Throwable e )
              {
                  final String error =
                          "Could not register the type: " + classname
                          + " due to a verification failure.";
                  throw new TypeException( error, e );
              }
  
              if( getLogger().isDebugEnabled() )
              {
                  getLogger().debug( "add: " + type );
              }
  
              m_types.put( classname, type );
          }
      }
  
      /**
       * Locate a {@link Type} instances associated with the
       * supplied implementation classname.
       * @param clazz the component type implementation class.
       * @return the type matching the supplied implementation classname.
       * @exception UnknownTypeException if a matching type cannot be found
       */
      public Type getType( Class clazz ) throws UnknownTypeException
      {
          if( clazz == null )
          {
              throw new NullPointerException( "clazz" );
          }
  
          return getType( clazz.getName() );
      }
  
      /**
       * Locate a {@link Type} instances associated with the
       * supplied implementation classname.
       * @param classname the component type implementation class name.
       * @return the type matching the supplied implementation classname.
       * @exception UnknownTypeException if a matching type cannot be found
       */
      public Type getType( String classname ) throws UnknownTypeException
      {
          if( classname == null )
          {
              throw new NullPointerException( "classname" );
          }
  
          Type type = (Type) m_types.get( classname );
          if( type == null )
          {
              if( m_parent != null )
              {
                  return m_parent.getType( classname );
              } else
              {
                  throw new UnknownTypeException( classname );
              }
          }
          return type;
      }
  
      /**
       * Locate the set of component types capable of services the supplied
       * dependency.
       * @param dependency a service dependency descriptor
       * @return a set of types capable of servicing the supplied dependency
       */
      public Type[] getTypes( DependencyDescriptor dependency )
      {
          if( dependency == null )
          {
              throw new NullPointerException( "dependency" );
          }
  
          ArrayList list = new ArrayList();
          if( m_parent != null )
          {
              Type[] types = m_parent.getTypes( dependency );
              for( int i = 0; i < types.length; i++ )
              {
                  list.add( types[i] );
              }
          }
  
          ReferenceDescriptor reference = dependency.getReference();
          Enumeration enum = m_types.elements();
          while( enum.hasMoreElements() )
          {
              Type type = (Type) enum.nextElement();
              Object service = type.getService( reference );
              if( service != null )
              {
                  list.add( type );
              }
          }
          return (Type[]) list.toArray( new Type[0] );
      }
  
      /**
       * Locate the set of component types that provide the supplied extension.
       * @param stage a stage descriptor
       * @return a set of types that support the supplied stage
       */
      public Type[] getTypes( StageDescriptor stage )
      {
          if( stage == null )
          {
              throw new NullPointerException( "stage" );
          }
  
          ArrayList list = new ArrayList();
          if( m_parent != null )
          {
              Type[] types = m_parent.getTypes( stage );
              for( int i = 0; i < types.length; i++ )
              {
                  list.add( types[i] );
              }
          }
  
          Iterator iterator = m_types.entrySet().iterator();
          while( iterator.hasNext() )
          {
              Type type = (Type) iterator.next();
              if( type.getExtension( stage ) != null )
              {
                  list.add( type );
              }
          }
  
          return (Type[]) list.toArray( new Type[0] );
      }
  
      /**
       * Verify the intergrity of the supplied type.
       * @param type the type to verify
       * @exception Exception if an verification failure occurs
       */
      private void verify( Type type ) throws Exception
      {
          String name = type.getInfo().getName();
          Class clazz = getComponentClass( type );
          Class[] classes = getServiceClasses( type );
          ComponentVerifier verifier = new ComponentVerifier();
          verifier.verifyComponent( name, clazz, classes );
      }
  
      /**
       * Return the set of interface classes for a given type that are declared
       * or default to the "native" service access protocol and where the
       * service access model is undefined (i.e. native implementation).
       * access mode.
       *
       * @param type the component type
       * @return an array of classes represnting the type's service interfaces
       */
      private Class[] getServiceClasses( Type type )
      {
          ArrayList list = new ArrayList();
          ServiceDescriptor[] services = type.getServices();
          for( int i = 0; i < services.length; i++ )
          {
              ServiceDescriptor service = services[i];
              if( (service.getAttribute(
                      "urn:avalon:service.protocol", "native" ).equals( "native" ))
                      && (service.getAttribute( "urn:avalon:service.accessor", null ) == null) )
              {
                  list.add( getServiceClass( services[i] ) );
              }
          }
          return (Class[]) list.toArray( new Class[0] );
      }
  
      /**
       * Returns the component type implementation class.
       * @param type the component type descriptor
       * @return the class implementing the component type
       * @exception TypeException if a classloader error occurs
       */
      private Class getComponentClass( Type type ) throws TypeException
      {
          if( null == type )
          {
              throw new NullPointerException( "type" );
          }
  
          final String classname = type.getInfo().getClassname();
  
          try
          {
              return m_classloader.loadClass( classname );
          } catch( Throwable e )
          {
              final String error =
                      "Could not load implementation class for component type: "
                      + classname;
              throw new TypeException( error, e );
          }
      }
  
      /**
       * Returns the service type implementation class.
       * @param service the service type descriptor
       * @return the class implementing the service type
       * @exception TypeRuntimeException if a classloader error occurs
       */
      private Class getServiceClass( ServiceDescriptor service ) throws TypeRuntimeException
      {
          final String classname = service.getReference().getClassname();
          try
          {
              return m_classloader.loadClass( classname );
          } catch( Throwable e )
          {
              final String error =
                      "Could not load implementation class for service type: "
                      + classname;
              throw new TypeRuntimeException( error, e );
          }
      }
  }
  
  
  
  1.8       +1 -1      avalon-sandbox/merlin/assembly/src/test/org/apache/avalon/assembly/engine/ApplianceTestCase.java
  
  Index: ApplianceTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/test/org/apache/avalon/assembly/engine/ApplianceTestCase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ApplianceTestCase.java	26 Apr 2003 12:37:47 -0000	1.7
  +++ ApplianceTestCase.java	29 Apr 2003 14:39:44 -0000	1.8
  @@ -54,7 +54,7 @@
   import org.apache.avalon.assembly.appliance.Appliance;
   import org.apache.avalon.assembly.appliance.DependencyGraph;
   import org.apache.avalon.assembly.engine.impl.EngineClassLoader;
  -import org.apache.avalon.assembly.engine.type.impl.DefaultTypeRepository;
  +import org.apache.avalon.assembly.engine.impl.DefaultTypeRepository;
   import org.apache.avalon.assembly.locator.impl.DefaultLocator;
   import org.apache.avalon.assembly.logging.LoggingManager;
   import org.apache.avalon.assembly.util.ExceptionHelper;
  
  
  
  1.3       +2 -2      avalon-sandbox/merlin/assembly/src/test/org/apache/avalon/assembly/engine/profile/ProfileRepositoryTestCase.java
  
  Index: ProfileRepositoryTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/test/org/apache/avalon/assembly/engine/profile/ProfileRepositoryTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProfileRepositoryTestCase.java	26 Apr 2003 12:37:47 -0000	1.2
  +++ ProfileRepositoryTestCase.java	29 Apr 2003 14:39:44 -0000	1.3
  @@ -51,8 +51,8 @@
   package org.apache.avalon.assembly.engine.profile;
   
   import org.apache.avalon.assembly.TestBase;
  -import org.apache.avalon.assembly.engine.profile.impl.DefaultProfileRepository;
  -import org.apache.avalon.assembly.engine.type.impl.DefaultTypeRepository;
  +import org.apache.avalon.assembly.engine.impl.DefaultProfileRepository;
  +import org.apache.avalon.assembly.engine.impl.DefaultTypeRepository;
   import org.apache.avalon.framework.Version;
   import org.apache.avalon.meta.info.DependencyDescriptor;
   import org.apache.avalon.meta.info.ReferenceDescriptor;
  
  
  
  1.3       +1 -1      avalon-sandbox/merlin/assembly/src/test/org/apache/avalon/assembly/engine/service/ServiceRepositoryTestCase.java
  
  Index: ServiceRepositoryTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/test/org/apache/avalon/assembly/engine/service/ServiceRepositoryTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServiceRepositoryTestCase.java	26 Apr 2003 12:37:47 -0000	1.2
  +++ ServiceRepositoryTestCase.java	29 Apr 2003 14:39:44 -0000	1.3
  @@ -50,7 +50,7 @@
   
   package org.apache.avalon.assembly.engine.service;
   
  -import org.apache.avalon.assembly.engine.service.impl.DefaultServiceRepository;
  +import org.apache.avalon.assembly.engine.impl.DefaultServiceRepository;
   import org.apache.avalon.assembly.TestBase;
   import org.apache.avalon.framework.Version;
   import org.apache.avalon.meta.info.Service;
  
  
  
  1.3       +1 -1      avalon-sandbox/merlin/assembly/src/test/org/apache/avalon/assembly/engine/type/TypeRepositoryTestCase.java
  
  Index: TypeRepositoryTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/test/org/apache/avalon/assembly/engine/type/TypeRepositoryTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TypeRepositoryTestCase.java	26 Apr 2003 12:37:48 -0000	1.2
  +++ TypeRepositoryTestCase.java	29 Apr 2003 14:39:44 -0000	1.3
  @@ -50,7 +50,7 @@
   
   package org.apache.avalon.assembly.engine.type;
   
  -import org.apache.avalon.assembly.engine.type.impl.DefaultTypeRepository;
  +import org.apache.avalon.assembly.engine.impl.DefaultTypeRepository;
   import org.apache.avalon.assembly.TestBase;
   import org.apache.avalon.assembly.util.ExceptionHelper;
   import org.apache.avalon.meta.info.DependencyDescriptor;
  
  
  
  1.5       +0 -1      avalon-sandbox/merlin/merlin-core/src/test/org/apache/avalon/merlin/AbstractTestCase.java
  
  Index: AbstractTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/test/org/apache/avalon/merlin/AbstractTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractTestCase.java	26 Apr 2003 12:37:48 -0000	1.4
  +++ AbstractTestCase.java	29 Apr 2003 14:39:45 -0000	1.5
  @@ -60,7 +60,6 @@
   import junit.framework.TestCase;
   
   /**
  - * A testcase for the @link{DefaultTypeRepository}.
    *
    * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
    */
  
  
  
  1.7       +0 -1      avalon-sandbox/merlin/merlin-smp/src/examples/afs/simple/src/test/org/apache/AbstractTestCase.java
  
  Index: AbstractTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-smp/src/examples/afs/simple/src/test/org/apache/AbstractTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AbstractTestCase.java	26 Apr 2003 12:37:49 -0000	1.6
  +++ AbstractTestCase.java	29 Apr 2003 14:39:45 -0000	1.7
  @@ -58,7 +58,6 @@
   import org.apache.avalon.merlin.kernel.Kernel;
   
   /**
  - * A testcase for the @link{DefaultTypeRepository}.
    *
    * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
    */
  
  
  

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


Mime
View raw message