org.apache.avalon.repository
Interface Repository

All Known Implementing Classes:
DefaultRepository

public interface Repository

A service that provides access to versioned resources.

Version:
$Revision: 1.1.1.1 $ $Date: 2003/12/04 19:34:29 $
Author:
Stephen McConnell

Field Summary
static String KEY
          The context resolution key.
static String SEPERATOR
          The seperator character between the group and resource name values in an artifact name.
 
Method Summary
 Attributes getAttributes(Artifact artifact)
          Return the metadata of an artifact as attributes.
 ClassLoader getClassLoader(Artifact artifact)
          Creates a ClassLoader chain returning the lowest ClassLoader containing the jar artifact in the loader's path.
 ClassLoader getClassLoader(ClassLoader parent, Artifact artifact)
          Creates a ClassLoader chain returning the lowest ClassLoader containing the jar artifact in the loader's path.
 URL getResource(Artifact artifact)
          Get a resource url relative to the supplied artifact.
 

Field Detail

KEY

public static final String KEY
The context resolution key.

See Also:
Constant Field Values

SEPERATOR

public static final String SEPERATOR
The seperator character between the group and resource name values in an artifact name.

See Also:
Constant Field Values
Method Detail

getAttributes

public Attributes getAttributes(Artifact artifact)
                         throws RepositoryException
Return the metadata of an artifact as attributes.

Parameters:
artifact - the artifact
Returns:
the attributes resolved relative to the artifact address
Throws:
RepositoryException - if an error occurs while resolving artifact metadata attributes

getResource

public URL getResource(Artifact artifact)
                throws RepositoryException
Get a resource url relative to the supplied artifact.

Parameters:
artifact - the artifact describing the resource
Returns:
the resource url
Throws:
RepositoryException

getClassLoader

public ClassLoader getClassLoader(Artifact artifact)
                           throws RepositoryException
Creates a ClassLoader chain returning the lowest ClassLoader containing the jar artifact in the loader's path. The dependencies of the argument artifact jar and an api, spi and implementation attribute on the jar and its dependencies are used to construct the ClassLoaders.

Parameters:
artifact - the implementation artifact
Returns:
the lowest ClassLoader in a chain
Throws:
RepositoryException - if there is a problem caching and accessing repository artifacts and reading their attributes.

getClassLoader

public ClassLoader getClassLoader(ClassLoader parent,
                                  Artifact artifact)
                           throws RepositoryException
Creates a ClassLoader chain returning the lowest ClassLoader containing the jar artifact in the loader's path. The dependencies of the argument artifact jar and an api, spi and implementation attribute on the jar and its dependencies are used to construct the ClassLoaders.

Parameters:
parent - the parent classloader
artifact - the implementation artifact
Returns:
the lowest ClassLoader in a chain
Throws:
RepositoryException - if there is a problem caching and accessing repository artifacts and reading their attributes.


Copyright © Apache Software Foundation. All Rights Reserved.