org.apache.geronimo.kernel.repository
Class DefaultArtifactResolver

java.lang.Object
  extended by org.apache.geronimo.kernel.repository.DefaultArtifactResolver
All Implemented Interfaces:
ArtifactResolver
Direct Known Subclasses:
ExplicitDefaultArtifactResolver

public class DefaultArtifactResolver
extends Object
implements ArtifactResolver


Field Summary
static GBeanInfo GBEAN_INFO
           
 
Constructor Summary
DefaultArtifactResolver(ArtifactManager artifactManager, Collection repositories, Map explicitResolution)
           
DefaultArtifactResolver(ArtifactManager artifactManager, ListableRepository repository)
           
 
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.
static GBeanInfo getGBeanInfo()
           
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final GBeanInfo GBEAN_INFO
Constructor Detail

DefaultArtifactResolver

public DefaultArtifactResolver(ArtifactManager artifactManager,
                               ListableRepository repository)

DefaultArtifactResolver

public DefaultArtifactResolver(ArtifactManager artifactManager,
                               Collection repositories,
                               Map explicitResolution)
Method Detail

generateArtifact

public Artifact generateArtifact(Artifact source,
                                 String defaultType)
Description copied from interface: ArtifactResolver
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.

Specified by:
generateArtifact in interface ArtifactResolver
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.

queryArtifact

public Artifact queryArtifact(Artifact artifact)
                       throws MultipleMatchesException
Description copied from interface: ArtifactResolver
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).

Specified by:
queryArtifact in interface ArtifactResolver
Returns:
A matching artifact, or null of there were no matches
Throws:
MultipleMatchesException

queryArtifacts

public Artifact[] queryArtifacts(Artifact artifact)
Description copied from interface: ArtifactResolver
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

Specified by:
queryArtifacts in interface ArtifactResolver
Returns:
The matching artifacts, which may be 0, 1, or many

resolveInClassLoader

public LinkedHashSet resolveInClassLoader(Collection artifacts)
                                   throws MissingDependencyException
Description copied from interface: ArtifactResolver
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.

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

resolveInClassLoader

public LinkedHashSet resolveInClassLoader(Collection artifacts,
                                          Collection parentConfigurations)
                                   throws MissingDependencyException
Description copied from interface: ArtifactResolver
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.

Specified by:
resolveInClassLoader in interface ArtifactResolver
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

resolveInClassLoader

public Artifact resolveInClassLoader(Artifact source)
                              throws MissingDependencyException
Description copied from interface: ArtifactResolver
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.

Specified by:
resolveInClassLoader in interface ArtifactResolver
Throws:
MissingDependencyException

resolveInClassLoader

public Artifact resolveInClassLoader(Artifact source,
                                     Collection parentConfigurations)
                              throws MissingDependencyException
Description copied from interface: ArtifactResolver
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.

Specified by:
resolveInClassLoader in interface ArtifactResolver
parentConfigurations - A Collection with entries of type Configuration
Throws:
MissingDependencyException

getGBeanInfo

public static GBeanInfo getGBeanInfo()


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