org.apache.geronimo.kernel.repository
Interface ArtifactResolver

All Known Subinterfaces:
AliasedArtifactResolver, LocalAliasedArtifactResolver
All Known Implementing Classes:
DefaultArtifactResolver, ExplicitDefaultArtifactResolver, OptionalExplicitDefaultArtifactResolver

public interface ArtifactResolver


Method Summary
 Artifact generateArtifact(Artifact source, String defaultType)
          Used to generate a fully-populated Artifact from a partially-populated Artifact when you're about to deploy/save a new artifact.
 Artifact queryArtifact(Artifact artifact)
          Used to search for existing artifacts in the server that match the supplied artifact (which may be partially-populated).
 Artifact[] queryArtifacts(Artifact artifact)
          Used to search for existing artifacts in the server that match the supplied artifact (which may be partially-populated).
 Artifact resolveInClassLoader(Artifact source)
          Used to search for existing artifacts that match the supplied artifact (which may be partially-populated).
 Artifact resolveInClassLoader(Artifact source, Collection<Configuration> parentConfigurations)
          Used to search for existing artifacts that match the supplied artifact (which may be partially-populated).
 LinkedHashSet<Artifact> resolveInClassLoader(Collection<Artifact> sources)
          Used to search for existing artifacts that match the supplied artifact (which may be partially-populated).
 LinkedHashSet<Artifact> resolveInClassLoader(Collection<Artifact> sources, Collection<Configuration> parentConfigurations)
          Used to search for existing artifacts that match the supplied artifact (which may be partially-populated).
 

Method Detail

generateArtifact

Artifact generateArtifact(Artifact source,
                          String defaultType)
Used to generate a fully-populated Artifact from a partially-populated Artifact when you're about to deploy/save a new artifact. That is, this method comes up with reasonable default values that hopefully do not conflict with anything that's already deployed.

Parameters:
source - The artifact to complete (normally partially-resolved)
defaultType - The type to use for the resulting artifact if the source artifact doesn't have a type set
Returns:
If the source artifact is fully resolved (e.g. artifact.isResolved() == true) then it will be returned. Otherwise a new fully-resolved artifact is returned.

resolveInClassLoader

Artifact resolveInClassLoader(Artifact source)
                              throws MissingDependencyException
Used to search for existing artifacts that match the supplied artifact (which may be partially-populated). Preference is given to artifacts that are already loaded, to reduce duplication. If nothing can be found that's an error, because something depends on this.

Parameters:
source - incompletely resolved Artifact
Returns:
completely resolved Artifact matching the source
Throws:
MissingDependencyException - if no matching Artifact can be found.

resolveInClassLoader

Artifact resolveInClassLoader(Artifact source,
                              Collection<Configuration> parentConfigurations)
                              throws MissingDependencyException
Used to search for existing artifacts that match the supplied artifact (which may be partially-populated). Preference is given to artifacts that are already loaded, or that exist in the parent configurations, to reduce duplication. If nothing can be found that's an error, because something depends on this.

Parameters:
source - incompletely resolved Artifact
parentConfigurations - A Collection with entries of type Configuration
Returns:
completely resolved Artifact matching the source
Throws:
MissingDependencyException - if no matching Artifact can be found.

resolveInClassLoader

LinkedHashSet<Artifact> resolveInClassLoader(Collection<Artifact> sources)
                                             throws MissingDependencyException
Used to search for existing artifacts that match the supplied artifact (which may be partially-populated). Preference is given to artifacts that are already loaded, to reduce duplication. If nothing can be found that's an error, because something depends on this.

Parameters:
sources - incompletely resolved Artifact
Returns:
A sorted set ordered in the same way the input was ordered, with entries of type Artifact
Throws:
MissingDependencyException - if no matching Artifact can be found.

resolveInClassLoader

LinkedHashSet<Artifact> resolveInClassLoader(Collection<Artifact> sources,
                                             Collection<Configuration> parentConfigurations)
                                             throws MissingDependencyException
Used to search for existing artifacts that match the supplied artifact (which may be partially-populated). Preference is given to artifacts that are already loaded, or that exist in the parent configurations, to reduce duplication. If nothing can be found that's an error, because something depends on this.

Parameters:
sources - incompletely resolved Artifacts to match
parentConfigurations - Configurations to search in
Returns:
A sorted set ordered in the same way the input was ordered, with entries of type Artifact
Throws:
MissingDependencyException - if no matching Artifact can be found.

queryArtifact

Artifact queryArtifact(Artifact artifact)
                       throws MultipleMatchesException
Used to search for existing artifacts in the server that match the supplied artifact (which may be partially-populated). This method expects either no results or one result (multiple matches is an error).

Parameters:
artifact - incompletely resolved artifact to match
Returns:
A matching artifact, or null of there were no matches
Throws:
MultipleMatchesException - if there is more than one match

queryArtifacts

Artifact[] queryArtifacts(Artifact artifact)
Used to search for existing artifacts in the server that match the supplied artifact (which may be partially-populated).

TODO: The artifacts should be sorted ascending by type then group then artifact then version

Parameters:
artifact - the Artifact to match.
Returns:
The matching artifacts, which may be 0, 1, or many


Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.