mcconnell 2003/11/12 00:48:27
Modified: merlin/repository/spi/src/java/org/apache/avalon/repository
RepositoryConfig.java RepositoryFactory.java
Added: merlin/repository/spi/src/java/org/apache/avalon/repository
RepositoryContext.java
Removed: merlin/repository/spi/src/java/org/apache/avalon/repository
RepositoryLoader.java
Log:
Removed file now used in current implementation.
Revision Changes Path
1.5 +52 -30
avalon/merlin/repository/spi/src/java/org/apache/avalon/repository/RepositoryConfig.java
Index: RepositoryConfig.java
===================================================================
RCS file:
/home/cvs/avalon/merlin/repository/spi/src/java/org/apache/avalon/repository/RepositoryConfig.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- RepositoryConfig.java 3 Nov 2003 23:57:30 -0000 1.4
+++ RepositoryConfig.java 12 Nov 2003 08:48:27 -0000 1.5
@@ -48,12 +48,15 @@
*/
-package org.apache.avalon.repository ;
+package org.apache.avalon.repository;
import java.net.URL ;
import java.net.MalformedURLException ;
+import org.apache.avalon.repository.RepositoryContext;
+import org.apache.avalon.repository.ProxyContext;
+
/**
* Repository configuration parameters bean.
@@ -62,8 +65,12 @@
* @author $Author$
* @version $Revision$
*/
-public class RepositoryConfig
+public class RepositoryConfig implements RepositoryContext
{
+ //---------------------------------------------------------------
+ // state
+ //---------------------------------------------------------------
+
/** the set of remote repositories to pull jars from */
private URL [] m_remoteRepositories = null ;
@@ -73,7 +80,25 @@
/** descriptor for proxy used to access remote repositories */
private ProxyContext m_proxyCtx = null ;
-
+ //---------------------------------------------------------------
+ // constructors
+ //---------------------------------------------------------------
+
+ public RepositoryConfig()
+ {
+ }
+
+ public RepositoryConfig( RepositoryContext context )
+ {
+ m_proxyCtx = context.getProxyContext();
+ m_remoteRepositories = context.getRemoteRepositories();
+ m_cacheDir = context.getCacheDir();
+ }
+
+ //---------------------------------------------------------------
+ // RepositoryContext
+ //---------------------------------------------------------------
+
/**
* Gets the ProxyContext used by the Kernel to access remote repositories.
*
@@ -84,28 +109,40 @@
return m_proxyCtx ;
}
+ /**
+ * Gets the set of remote repositories used to download artifacts.
+ *
+ * @return the remote repositories to use
+ */
+ public URL[] getRemoteRepositories()
+ {
+ return m_remoteRepositories ;
+ }
/**
- * Sets the ProxyContext for this KernelConfig.
+ * Gets the directory where repository artifacts are stored after being
+ * downloaded from the Repository.
*
- * @param a_proxyCtx sets the proxy context
+ * @return the place to cache repository artifacts
*/
- public void setProxyContext( ProxyContext a_proxyCtx )
+ public String getCacheDir()
{
- m_proxyCtx = a_proxyCtx ;
+ return m_cacheDir ;
}
+ //---------------------------------------------------------------
+ // implementation
+ //---------------------------------------------------------------
/**
- * Gets the set of remote repositories used to download artifacts.
+ * Sets the ProxyContext for this KernelConfig.
*
- * @return the remote repositories to use
+ * @param a_proxyCtx sets the proxy context
*/
- public URL[] getRemoteRepositories()
+ public void setProxyContext( ProxyContext a_proxyCtx )
{
- return m_remoteRepositories ;
+ m_proxyCtx = a_proxyCtx ;
}
-
/**
* Gets the remote repository urls for downloading artifacts.
@@ -117,7 +154,6 @@
m_remoteRepositories = a_remoteRepositories ;
}
-
/**
* Sets the remote repository urls for downloading artifacts.
*
@@ -133,23 +169,9 @@
a_urls[ii] = new URL( urls[ii] ) ;
}
-
m_remoteRepositories = a_urls ;
}
-
-
- /**
- * Gets the directory where repository artifacts are stored after being
- * downloaded from the Repository.
- *
- * @return the place to cache repository artifacts
- */
- public String getCacheDir()
- {
- return m_cacheDir ;
- }
-
-
+
/**
* Sets the directory where we store downloaded artifacts.
*
1.2 +7 -7
avalon/merlin/repository/spi/src/java/org/apache/avalon/repository/RepositoryFactory.java
Index: RepositoryFactory.java
===================================================================
RCS file:
/home/cvs/avalon/merlin/repository/spi/src/java/org/apache/avalon/repository/RepositoryFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RepositoryFactory.java 3 Nov 2003 06:35:41 -0000 1.1
+++ RepositoryFactory.java 12 Nov 2003 08:48:27 -0000 1.2
@@ -61,19 +61,19 @@
public interface RepositoryFactory
{
/**
- * Creates a new default configuration bean populated with default values.
+ * Creates a new context populated with default values.
*
- * @return a default configuration bean used for Repository creation
+ * @return a default context used for Repository creation
* @throws RepositoryException if there is a problem generating defaults
*/
- RepositoryConfig getDefaultConfig() throws RepositoryException ;
+ RepositoryContext getDefaultContext() throws RepositoryException ;
/**
* Creates a new Repository using a configuration bean.
*
- * @param a_config the Repository configuration bean
+ * @param context the Repository context
* @return the newly created Repository
* @throws RepositoryException if there is a problem creating the Repository
*/
- Repository create( RepositoryConfig a_config ) throws RepositoryException ;
+ Repository create( RepositoryContext context ) throws RepositoryException ;
}
1.1
avalon/merlin/repository/spi/src/java/org/apache/avalon/repository/RepositoryContext.java
Index: RepositoryContext.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 [EMAIL PROTECTED]
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.repository ;
import java.net.URL ;
import java.net.MalformedURLException ;
/**
* Repository factory creation context.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Alex Karasulu</a>
* @author $Author: mcconnell $
* @version $Revision: 1.1 $
*/
public interface RepositoryContext
{
/**
* Gets the ProxyContext used by the Kernel to access remote repositories.
*
* @return the proxy context used by the Kernel
*/
ProxyContext getProxyContext();
/**
* Gets the set of remote repositories used to download artifacts.
*
* @return the remote repositories to use
*/
URL[] getRemoteRepositories();
/**
* Gets the directory where repository artifacts are stored after being
* downloaded from the Repository.
*
* @return the place to cache repository artifacts
*/
String getCacheDir();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]