org.apache.geronimo.kernel.repository
Interface ArtifactResolver

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 parentConfigurations)
          Used to search for existing artifacts that match the supplied artifact (which may be partially-populated).
 LinkedHashSet resolveInClassLoader(Collection artifacts)
          Used to search for existing artifacts that match the supplied artifact (which may be partially-populated).
 LinkedHashSet resolveInClassLoader(Collection artifacts, Collection 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-populated)
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 populated (e.g. artifact.isResolved() == true) then it will be returned. Otherwise a new fully-populated 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.

Throws:
MissingDependencyException

resolveInClassLoader

Artifact resolveInClassLoader(Artifact source,
                              Collection 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:
parentConfigurations - A Collection with entries of type Configuration
Throws:
MissingDependencyException

resolveInClassLoader

LinkedHashSet resolveInClassLoader(Collection artifacts)
                                   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.

Returns:
A sorted set ordered in the same way the input was ordered, with entries of type Artifact
Throws:
MissingDependencyException

resolveInClassLoader

LinkedHashSet resolveInClassLoader(Collection artifacts,
                                   Collection 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:
parentConfigurations - A Collection with entries of type Configuration
Returns:
A sorted set ordered in the same way the input was ordered, with entries of type Artifact
Throws:
MissingDependencyException

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).

Returns:
A matching artifact, or null of there were no matches
Throws:
MultipleMatchesException

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

Returns:
The matching artifacts, which may be 0, 1, or many


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.