mcconnell 2003/11/30 00:11:37
Modified: repository platform.xml
repository/impl/src/java/org/apache/avalon/repository/impl
DefaultCacheManager.java DefaultFactory.java
DefaultRepository.java RepositoryCriteria.java
repository/main/src/java/org/apache/avalon/repository/main
AbstractBuilder.java DefaultBuilder.java
repository/spi/src/java/org/apache/avalon/repository/criteria
Parameter.java
repository/spi/src/java/org/apache/avalon/repository/meta
ArtifactDescriptor.java
repository/util/src/java/org/apache/avalon/repository/util
LOADER.java RepositoryUtils.java
Log:
Remove all of the javadoc errors.
Revision Changes Path
1.6 +5 -0 avalon-sandbox/repository/platform.xml
Index: platform.xml
===================================================================
RCS file: /home/cvs/avalon-sandbox/repository/platform.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- platform.xml 25 Nov 2003 18:55:15 -0000 1.5
+++ platform.xml 30 Nov 2003 08:11:36 -0000 1.6
@@ -20,6 +20,11 @@
<version>1.1-dev</version>
</dependency>
<dependency>
+ <groupId>avalon-util</groupId>
+ <artifactId>avalon-util-exception</artifactId>
+ <version>1.0-dev</version>
+ </dependency>
+ <dependency>
<id>excalibur-i18n</id>
<version>1.1</version>
</dependency>
1.2 +1 -3
avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl/DefaultCacheManager.java
Index: DefaultCacheManager.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl/DefaultCacheManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultCacheManager.java 30 Nov 2003 05:49:32 -0000 1.1
+++ DefaultCacheManager.java 30 Nov 2003 08:11:36 -0000 1.2
@@ -106,7 +106,6 @@
*
* @param base the base directory for the repository cache
* @param context the proxy context
- * @param hosts the default host addresses
*/
public DefaultCacheManager( File base, ProxyContext context )
{
@@ -145,7 +144,6 @@
* Creation of a new repository handler.
* @param hosts the set of hosts to assign to the repository
* @return the repository
- * @exception RepositoryException if an error occurs suring repository
establishment
*/
public Repository createRepository( String[] hosts )
{
1.16 +8 -2
avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl/DefaultFactory.java
Index: DefaultFactory.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl/DefaultFactory.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- DefaultFactory.java 30 Nov 2003 05:49:32 -0000 1.15
+++ DefaultFactory.java 30 Nov 2003 08:11:36 -0000 1.16
@@ -108,6 +108,11 @@
// constructor
//--------------------------------------------------------------------------
+ /**
+ * Creation of a new default repository factory.
+ * @param context the initial context
+ * @exception NullPointerException if the supplied context is null
+ */
public DefaultFactory( InitialContext context )
{
if( null == context )
@@ -141,6 +146,7 @@
* Create a new instance of a repository administrator
* using the default parameters.
* @return the application instance
+ * @exception Exception if a repository creation error occurs
*/
public Object create() throws Exception
{
@@ -151,7 +157,7 @@
* Create a new instance of a repository administrator
* using the supplied parameters.
*
- * @param criteria a map of repsotory parameters
+ * @param map a map of repository parameters
* @return the repository
*/
public Object create( Map map ) throws Exception
1.2 +52 -28
avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl/DefaultRepository.java
Index: DefaultRepository.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl/DefaultRepository.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultRepository.java 30 Nov 2003 05:49:32 -0000 1.1
+++ DefaultRepository.java 30 Nov 2003 08:11:36 -0000 1.2
@@ -107,6 +107,13 @@
// constructor
//------------------------------------------------------------------
+ /**
+ * Creation of a new instance of the default repository.
+ * @param cache the cache manager assigned to the repository
+ * @param hosts the set of remote hosts
+ * @exception NullPointerException if the cache or hosts argument
+ * is null
+ */
public DefaultRepository( CacheManager cache, String[] hosts )
{
if( cache == null ) throw new NullPointerException( "cache" );
@@ -117,36 +124,18 @@
m_hosts = getHosts( m_roots );
}
- private URL[] getHosts( String[] paths )
- {
- URL[] hosts = new URL[ paths.length ];
- for( int i=0; i<paths.length; i++ )
- {
- String path = paths[i];
- try
- {
- hosts[i] = new URL( path );
- }
- catch( Throwable e )
- {
- final String error =
- "Internal error while attempting to construct url for host: "
- + path;
- throw new RepositoryRuntimeException( error, e );
- }
- }
- return hosts;
- }
-
//------------------------------------------------------------------
// Repository
//------------------------------------------------------------------
/**
* Return the metadata attribututes associated with an artifact.
- * @return the attributes
+ * @param artifact the relative artifact from which a .meta resource will
+ * be resolved to establish the artifact attributes
+ * @return the attributes associated with the artifact
* @exception RepositoryException if an error occurs while retrieving
* or building the attributes
+ * @exception NullPointerException if the supplied artifact is null
*/
public Attributes getAttributes( Artifact artifact )
throws RepositoryException
@@ -186,7 +175,8 @@
* Get a resource url relative to the supplied artifact.
*
* @param artifact the artifact describing the resource
- * @return the resource url
+ * @param mime a mime type relative to the artifact address
+ * @return the mime instance url
*/
private URL getResource( Artifact artifact, String mime )
throws RepositoryException
@@ -196,17 +186,26 @@
}
/**
- * @see org.apache.avalon.repository.Repository#
- * getClassLoader(org.apache.avalon.repository.Artifact)
+ * Returns a classloader based on the metadata associated with
+ * a supplied artifact. The classloader is created relative to
+ * the system classloader.
+ *
+ * @param artifact the artifact fro which dependency metadata
+ * will be resolved
+ * @return the classloader
*/
- public ClassLoader getClassLoader( Artifact implementation )
+ public ClassLoader getClassLoader( Artifact artifact )
throws RepositoryException
{
return getClassLoader(
- ClassLoader.getSystemClassLoader(), implementation );
+ ClassLoader.getSystemClassLoader(), artifact );
}
/**
+ * Returns a classloader based on the metadata associated with
+ * a supplied artifact. The classloader is created relative to
+ * the supplied parent classloader.
+ *
* @param parent the parent classloader
* @param artifact the implementation artifact
* @return the classloader
@@ -253,6 +252,10 @@
return buildClassLoader( imps, spi );
}
+ /**
+ * Return a string representation of this repository.
+ * @return the string representation
+ */
public String toString()
{
return m_cache.toString();
@@ -261,6 +264,27 @@
//------------------------------------------------------------------
// implementation
//------------------------------------------------------------------
+
+ private URL[] getHosts( String[] paths )
+ {
+ URL[] hosts = new URL[ paths.length ];
+ for( int i=0; i<paths.length; i++ )
+ {
+ String path = paths[i];
+ try
+ {
+ hosts[i] = new URL( path );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Internal error while attempting to construct url for host: "
+ + path;
+ throw new RepositoryRuntimeException( error, e );
+ }
+ }
+ return hosts;
+ }
private ClassLoader buildClassLoader(
URL[] urls, ClassLoader parent )
1.4 +2 -2
avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl/RepositoryCriteria.java
Index: RepositoryCriteria.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl/RepositoryCriteria.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RepositoryCriteria.java 30 Nov 2003 05:49:32 -0000 1.3
+++ RepositoryCriteria.java 30 Nov 2003 08:11:36 -0000 1.4
@@ -179,7 +179,7 @@
/**
* Creation of a new criteria.
- * @param template the template containing the validation parameters
+ * @param context the initial context
*/
public RepositoryCriteria( InitialContext context ) throws RepositoryException
{
1.2 +3 -3
avalon-sandbox/repository/main/src/java/org/apache/avalon/repository/main/AbstractBuilder.java
Index: AbstractBuilder.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/main/src/java/org/apache/avalon/repository/main/AbstractBuilder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractBuilder.java 30 Nov 2003 05:49:32 -0000 1.1
+++ AbstractBuilder.java 30 Nov 2003 08:11:36 -0000 1.2
@@ -73,7 +73,7 @@
* Classes and their methods within newly constructed Repository ClassLoaders.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Alex Karasulu</a>
- * @author $Author$
+ * @author <a href="mailto:[EMAIL PROTECTED]">Stephen McConnell</a>
* @version $Revision$
*/
public abstract class AbstractBuilder
@@ -120,7 +120,7 @@
* </ul>
*
* @param clazz the factory class
- * @param factory the inital repository factory
+ * @param context the inital repository context
* @param args command line arguments
* @return the instantiated factory
* @exception RepositoryException if a factory creation error occurs
1.3 +6 -7
avalon-sandbox/repository/main/src/java/org/apache/avalon/repository/main/DefaultBuilder.java
Index: DefaultBuilder.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/main/src/java/org/apache/avalon/repository/main/DefaultBuilder.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DefaultBuilder.java 30 Nov 2003 07:06:10 -0000 1.2
+++ DefaultBuilder.java 30 Nov 2003 08:11:36 -0000 1.3
@@ -125,8 +125,8 @@
/**
* Creates a DefaultBuilder for a specific target application.
*
+ * @param context the initial repository context
* @param artifact the reference to the application
- * @param args the command line arguments
* @exception RepositoryException if a app factory creation error occurs
*/
public DefaultBuilder( InitialContext context, Artifact artifact )
@@ -138,10 +138,10 @@
/**
* Creates a DefaultBuilder for a specific target application.
*
+ * @param context the initial repository context
* @param artifact the reference to the application
- * @param hosts the remote hosts to assign to the repository
* @param args the command line arguments
- * @exception RepositoryException if a app factory creation error occurs
+ * @exception Exception if a app factory creation error occurs
*/
public DefaultBuilder(
InitialContext context, Artifact artifact, String[] args )
@@ -217,10 +217,10 @@
/**
* Main wrapper.
*
- * @todo add more properties to allow full repo specification via
+ * TODO add more properties to allow full repo specification via
* system properties including a repository implementation replacement.
*
- * @param args
+ * @param args the command line arguments
*/
public static void main( String [] args )
{
@@ -361,5 +361,4 @@
throw new Error( error );
}
}
-
}
1.5 +1 -3
avalon-sandbox/repository/spi/src/java/org/apache/avalon/repository/criteria/Parameter.java
Index: Parameter.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/spi/src/java/org/apache/avalon/repository/criteria/Parameter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Parameter.java 26 Nov 2003 00:41:41 -0000 1.4
+++ Parameter.java 30 Nov 2003 08:11:37 -0000 1.5
@@ -66,7 +66,6 @@
* Creation of a new required parameter constraint.
* @param key the parameter key
* @param type the name of a class constraining assigned values
- * @boolean required TRUE if the parameter is required
*/
public Parameter(
final String key, final String type )
@@ -82,7 +81,6 @@
* @param key the parameter key
* @param type the name of a class constraining assigned values
* @param value the default value
- * @boolean value the default value
*/
public Parameter(
final String key, final String type, Object value )
1.5 +7 -7
avalon-sandbox/repository/spi/src/java/org/apache/avalon/repository/meta/ArtifactDescriptor.java
Index: ArtifactDescriptor.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/spi/src/java/org/apache/avalon/repository/meta/ArtifactDescriptor.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ArtifactDescriptor.java 30 Nov 2003 05:49:32 -0000 1.4
+++ ArtifactDescriptor.java 30 Nov 2003 08:11:37 -0000 1.5
@@ -86,11 +86,10 @@
/**
* Creates a new Meta descriptor.
*
- * @param domain the domain value
- * @param classifier the classifier value
- * @param version the meta data version
- * @exception NullPointerException if the domain, classifier
- * or version attribute is undefined
+ * @param attributes the metadata attributes
+ * @exception NullPointerException if the supplied
+ * attributes argument is null
+ * @exception MetaException if an attribute is inconsitent
*/
public ArtifactDescriptor( Attributes attributes )
throws MetaException
@@ -154,7 +153,8 @@
/**
* Test is the supplied object is equal to this object.
- * @return true if the object are equivalent
+ * @param other the obhject to compare this object with
+ * @return true if the objects are equivalent
*/
public boolean equals( Object other )
{
1.4 +4 -3
avalon-sandbox/repository/util/src/java/org/apache/avalon/repository/util/LOADER.java
Index: LOADER.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/util/src/java/org/apache/avalon/repository/util/LOADER.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LOADER.java 30 Nov 2003 05:49:32 -0000 1.3
+++ LOADER.java 30 Nov 2003 08:11:37 -0000 1.4
@@ -91,7 +91,7 @@
*
* @param artifact the artifact to retrieve and cache
* @param repositories the remote repositories to try to download from
- * @param destination where to store it locally in the cache
+ * @param root the root cache directory
* @param timestamping whether to check the modified timestamp on the
* <code>destinationFile</code> against the remote <code>source</code>
* @return URL a url referencing the local resource
@@ -153,8 +153,9 @@
* the first repository does not have the artifact in question.
*
* @param artifact the artifact to retrieve and cache
+ * @param mime the mime type
* @param repositories the remote repositories to try to download from
- * @param destination where to store it locally in the cache
+ * @param root the root cache directory
* @param timestamping whether to check the modified timestamp on the
* <code>destinationFile</code> against the remote <code>source</code>
* @return URL a url referencing the local resource
1.6 +42 -36
avalon-sandbox/repository/util/src/java/org/apache/avalon/repository/util/RepositoryUtils.java
Index: RepositoryUtils.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/util/src/java/org/apache/avalon/repository/util/RepositoryUtils.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RepositoryUtils.java 30 Nov 2003 05:49:32 -0000 1.5
+++ RepositoryUtils.java 30 Nov 2003 08:11:37 -0000 1.6
@@ -129,7 +129,7 @@
* Gets the Attribues in a remote artifact.
*
* @param repositories the reprositories to search against
- * @param artifact the artifact to oload meta data from
+ * @param artifact the artifact to load meta data from
* @return the meta data as attributes
* @throws RepositoryException if there is execution failure
*/
@@ -143,8 +143,9 @@
/**
* Gets the Properties in a remote properties file.
*
- * @param a_url the url to the properties file
- * @return the loaded properties for the file
+ * @param repositories the reprositories to search against
+ * @param artifact the artifact to load meta data from
+ * @return the loaded properties
* @throws RepositoryException if there is any problem loading the
* properties
*/
@@ -194,39 +195,37 @@
/**
* Gets the Properties in a remote properties file.
*
- * @param a_url the url to the properties file
+ * @param url the url to the properties file
* @return the loaded properties for the file
- * @throws IOException if there is any problem loading the properties
+ * @throws IOException indicating a IO error during property loading
*/
- public static Properties getProperties( URL a_url ) throws IOException
+ public static Properties getProperties( URL url ) throws IOException
{
InputStream l_in = null ;
Properties l_props = new Properties() ;
- l_in = a_url.openStream() ;
+ l_in = url.openStream() ;
l_props.load( l_in ) ;
if ( l_in != null )
{
l_in.close() ;
}
-
return l_props ;
}
-
/**
* Detects whether or not a property key is of the multivalued enumeration
* kind. A multivalued key simply enumerates values by appending a '.' and
* a number after the dot: i.e. artifact.dependency.2 and artifact.alias.23
* et. cetera.
*
- * @param a_key the property name or key
+ * @param key the property name or key
* @return true if the property conforms to the enumerated property
* convention, false otherwise
*/
- public static boolean isEnumerated( String a_key )
+ public static boolean isEnumerated( String key )
{
- int l_lastDot = a_key.lastIndexOf( '.' ) ;
+ int l_lastDot = key.lastIndexOf( '.' ) ;
String l_lastComponent = null ;
if ( -1 == l_lastDot )
@@ -234,10 +233,10 @@
return false ;
}
- l_lastComponent = a_key.substring( l_lastDot + 1 ) ;
+ l_lastComponent = key.substring( l_lastDot + 1 ) ;
// names like .123 are not really considered enumerated without a base
- if ( a_key.equals( a_key.substring( l_lastDot ) ) )
+ if ( key.equals( key.substring( l_lastDot ) ) )
{
return false ;
}
@@ -259,39 +258,32 @@
* Gets the key base of an enumerated property using the multivalued
* property key naming convention.
*
- * @param a_key the enumerated key whose last name component is a number
+ * @param key the enumerated key whose last name component is a number
* @return the base name of the enumerated property
*/
- public static String getEnumeratedBase( String a_key )
+ public static String getEnumeratedBase( String key )
{
- if ( null == a_key )
+ if ( null == key )
{
return null ;
}
- if ( ! isEnumerated( a_key ) )
+ if ( ! isEnumerated( key ) )
{
- return a_key ;
+ return key ;
}
- int l_lastDot = a_key.lastIndexOf( '.' ) ;
+ int l_lastDot = key.lastIndexOf( '.' ) ;
String l_base = null ;
if ( -1 == l_lastDot )
{
- return a_key ;
+ return key ;
}
- return a_key.substring( 0, l_lastDot ) ;
+ return key.substring( 0, l_lastDot ) ;
}
-
- /**
- *
- * @param a_delimiter
- * @param a_substrate
- * @return
- */
public static String [] getDelimited( char a_delim, String a_substrate )
{
int l_start = 0, l_end = 0 ;
@@ -320,6 +312,11 @@
return ( String [] ) l_list.toArray( new String[0] ) ;
}
+ /**
+ * Convert a set of host path statements to formal urls.
+ * @param hosts the set of host names
+ * @return the equivalent URL array
+ */
public static URL[] convertToURLs( String[] hosts )
{
ArrayList list = new ArrayList();
@@ -331,11 +328,15 @@
return (URL[]) list.toArray( new URL[0] );
}
- //
- // TODO: change this so that we lot to a buffer of some kind
- //
-
+ /**
+ * Convert a path to a url.
+ * @param host the host address
+ * @return the equivalent url
+ * @exception IllegalArgumentException if the path cannot
+ * be converted to a url
+ */
public static URL convertToURL( String host )
+ throws IllegalArgumentException
{
try
{
@@ -346,11 +347,16 @@
final String error =
"Unable to convert a supplied host spec to a url: "
+ host;
- System.err.println( error );
- return null;
+ throw new IllegalArgumentException( error );
}
}
+ /**
+ * For a given set of host paths, returns an equivalent set
+ * ensuring that the path ends with the "/" character.
+ * @param hosts the set of host path names
+ * @return the equivalent host path names
+ */
public static String[] getCleanPaths( String[] hosts )
{
String[] paths = new String[ hosts.length ];
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]