org.apache.geronimo.deployment
Class ModuleIDBuilder

java.lang.Object
  extended by org.apache.geronimo.deployment.ModuleIDBuilder

public class ModuleIDBuilder
extends Object

A utility class to flesh out any incomplete Module IDs (formerly known as config IDs) encountered during the course of a deployment. For example, an EAR may have a module ID with only an artifactId, and contain a web app with no Geronimo plan and an EJB JAR with a module ID with no version.


Constructor Summary
ModuleIDBuilder()
           
 
Method Summary
 org.apache.geronimo.kernel.repository.Artifact createDefaultArtifact(String defaultArtifact, String defaultType)
          Creates a new artifact using entirely default values.
 org.apache.geronimo.kernel.repository.Artifact resolve(org.apache.geronimo.kernel.repository.Artifact argument, String defaultType)
          Translates the argument Artifact to a fully-resolved Artifact, which is returned.
 void resolve(org.apache.geronimo.kernel.repository.Environment environment, String defaultArtifactId, String defaultType)
          Guarantees that the argument Environment will have a present and fully qualified module ID when this method returns.
 void setDefaultGroup(String defaultGroup)
          If an EAR is going to pass this module ID builder to its children, it can use this to set the default groupId to be its own.
 void setDefaultVersion(org.apache.geronimo.kernel.repository.Version defaultVersion)
          If an EAR is going to pass this module ID builder to its children, it can use this to set the default version to be its own.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleIDBuilder

public ModuleIDBuilder()
Method Detail

setDefaultGroup

public void setDefaultGroup(String defaultGroup)
If an EAR is going to pass this module ID builder to its children, it can use this to set the default groupId to be its own.


setDefaultVersion

public void setDefaultVersion(org.apache.geronimo.kernel.repository.Version defaultVersion)
If an EAR is going to pass this module ID builder to its children, it can use this to set the default version to be its own.


resolve

public org.apache.geronimo.kernel.repository.Artifact resolve(org.apache.geronimo.kernel.repository.Artifact argument,
                                                              String defaultType)
Translates the argument Artifact to a fully-resolved Artifact, which is returned. If the argument was fully-resolved to begin with it is returned as is. Otherwise, a new Artifact is returned with any missing values populated.

Parameters:
argument - The artifact to review
defaultType - The type to use if the artifact to review has no type specified
Returns:
A fully resolved Artifact
Throws:
IllegalArgumentException - Occurs when the argument artifact does not have an artifactId

createDefaultArtifact

public org.apache.geronimo.kernel.repository.Artifact createDefaultArtifact(String defaultArtifact,
                                                                            String defaultType)
Creates a new artifact using entirely default values.

Parameters:
defaultArtifact - The artifactId to use for the new Artifact
defaultType - The type to use for the new Artifact

resolve

public void resolve(org.apache.geronimo.kernel.repository.Environment environment,
                    String defaultArtifactId,
                    String defaultType)
Guarantees that the argument Environment will have a present and fully qualified module ID when this method returns. If the Environment is missing a module ID, or has a partial module ID (isResolved() == false) then this method will fill in any missing values. If the module ID is present and resolved, then this method does nothing.

Parameters:
environment - The Environment to check and populate
defaultArtifactId - The artifactId to use if the Envrionment does not have a module ID at all
defaultType - The type to use if the Environment is lacking a module ID or the module ID is lacking a type


Copyright © 2006 Apache Software Foundation. All Rights Reserved.