mcconnell 2004/02/17 03:06:17
Modified: repository/spi/src/java/org/apache/avalon/repository/provider
InitialContext.java
Added: repository/spi/src/java/org/apache/avalon/repository/provider
InitialContextFactory.java
Log:
Add support for an initial context factory that exposes the application root
directory. This provides sufficent info for dealing with properties management with an
IDE.
Revision Changes Path
1.8 +7 -1
avalon/repository/spi/src/java/org/apache/avalon/repository/provider/InitialContext.java
Index: InitialContext.java
===================================================================
RCS file:
/home/cvs/avalon/repository/spi/src/java/org/apache/avalon/repository/provider/InitialContext.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- InitialContext.java 31 Jan 2004 13:29:50 -0000 1.7
+++ InitialContext.java 17 Feb 2004 11:06:17 -0000 1.8
@@ -34,6 +34,12 @@
public interface InitialContext
{
/**
+ * The property key used when resolving the default implementation
+ * artifact spec.
+ */
+ String IMPLEMENTATION_KEY = "avalon.repository.implementation";
+
+ /**
* The property key used when resolving the default cache directory.
*/
String CACHE_KEY = "avalon.repository.cache";
1.1
avalon/repository/spi/src/java/org/apache/avalon/repository/provider/InitialContextFactory.java
Index: InitialContextFactory.java
===================================================================
/*
* Copyright 2004 Apache Software Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.avalon.repository.provider;
import java.io.File;
import java.io.IOException;
import org.apache.avalon.repository.Artifact;
/**
* Utility interface that provides support for the creation of a
* new initial context.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stephen McConnell</a>
* @version $Revision: 1.1 $
*/
public interface InitialContextFactory
{
/**
* An array of property keys that are used to locate default
* values.
*
* @see InitialContext#IMPLEMENTATION_KEY
* @see InitialContext#CACHE_KEY
* @see InitialContext#HOSTS_KEY
*/
String[] KEYS =
new String[]{
InitialContext.IMPLEMENTATION_KEY,
InitialContext.CACHE_KEY,
InitialContext.HOSTS_KEY };
/**
* Set the parent classloader.
*
* @param classloader the parent classloader
*/
void setParentClassLoader( ClassLoader classloader );
/**
* The initial context factory support the establishment of an
* initial context which is associated with a repository cache
* manager implementation. A client can override the default
* repository cache manager implementation by declaring an
* artifact referencing a compliant factory (not normally
* required).
*
* @param artifact the repository cache manager artifact
*/
void setImplementation( Artifact artifact );
/**
* The cache directory is the directory into which resources
* such as jar files are loaded by a repository cache manager.
*
* @param cache the repository cache directory
*/
void setCacheDirectory( File cache );
/**
* Set the initial hosts to be used by a repository cache manager
* implementation and the initial context implementation when
* resolving dependent resources. If is resource is not present
* in a local cache, remote hosts are checked in the order presented
* in the supplied list. A host may be a file url or a http url.
*
* @param hosts a sequence of remote host urls
*/
void setHosts( String[] hosts );
/**
* Creation of an inital context based on the system and working
* directory, parent classloader, repository cache manager implementation
* artifact, cache directory, and remote hosts sequence supplied to the
* factory.
*
* @return a new initial context
*/
InitialContext createInitialContext();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]