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

cvs commit: avalon-sandbox/merlin/assembly-spi/src/java/org/apache/avalon/assembly/repository package.html Repository.java RepositoryException.java

mcconnell    2003/04/24 05:10:10

  Added:       merlin/assembly-spi/src/java/org/apache/avalon/assembly/repository
                        package.html Repository.java
                        RepositoryException.java
  Log:
  Isolation via interfaces of the mechanism used to resolve resources - used witin the assembly engine when resolving classpath resource references.
  
  Revision  Changes    Path
  1.1                  avalon-sandbox/merlin/assembly-spi/src/java/org/apache/avalon/assembly/repository/package.html
  
  Index: package.html
  ===================================================================
  <body>
  <p>
  The <code>repository</code> package contains the
  {@link org.apache.avalon.assembly.repository.Repository} interface which
  defines the contract for a abstract resource repository where resources
  references can be established based on group, name, type and version 
  attributes.
  </p>
  </body>
  
  
  
  1.1                  avalon-sandbox/merlin/assembly-spi/src/java/org/apache/avalon/assembly/repository/Repository.java
  
  Index: Repository.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.repository;
  
  import java.net.URL;
  
  /**
   * A service that provides access to versioned resources.
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   * @version $Revision: 1.1 $ $Date: 2003/04/24 12:10:10 $
   */
  public interface Repository
  {
     /**
      * The context resolution key.
      */
      static final String KEY = "urn:assembly:repository";
  
     /**
      * The seperator character between the group and resource name values
      * in an artifact name.
      */
      static final String SEPERATOR = ":";
  
     /**
      * Get a resource relative to the supplied artifact name where the artifact name
      * is equivalent to the group and resource name seperated by the colon character.
      * 
      * @param artifact the artifact name
      * @param version the version identifier
      * @param type the resource type
      * @return the resource
      */
      public URL getArtifact( 
        final String artifact, final String version, final String type )
        throws RepositoryException;
  
     /**
      * Get a resource url relative to the supplied application name, 
      * resource name, version and resource type.
      * 
      * @param group the application or group name
      * @param name the resource name
      * @param version the version identifier
      * @param type the resource type
      * @return the resource url
      */
      URL getArtifact( 
        final String group, final String name, final String version, final String type )
        throws RepositoryException;
  
  }
  
  
  
  1.1                  avalon-sandbox/merlin/assembly-spi/src/java/org/apache/avalon/assembly/repository/RepositoryException.java
  
  Index: RepositoryException.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.repository;
  
  import org.apache.avalon.framework.CascadingException;
  
  /**
   * Exception to indicate that there was a repository related error.
   *
   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
   * @version $Revision: 1.1 $ $Date: 2003/04/24 12:10:10 $
   */
  public final class RepositoryException
      extends CascadingException
  {
  
      /**
       * Construct a new <code>RepositoryException</code> instance.
       *
       * @param message The detail message for this exception.
       */
      public RepositoryException( final String message )
      {
          this( message, null );
      }
  
      /**
       * Construct a new <code>RepositoryException</code> instance.
       *
       * @param message The detail message for this exception.
       * @param throwable the root cause of the exception
       */
      public RepositoryException( final String message, final Throwable throwable )
      {
          super( message, throwable );
      }
  }
  
  
  
  

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