org.apache.maven.plugin.ear
Class AbstractEarModule

java.lang.Object
  extended by org.apache.maven.plugin.ear.AbstractEarModule
All Implemented Interfaces:
EarModule
Direct Known Subclasses:
AppClientModule, EjbModule, HarModule, JarModule, RarModule, SarModule, WebModule

public abstract class AbstractEarModule
extends Object
implements EarModule

A base implementation of an EarModule.

Version:
$Id: AbstractEarModule.java 1228836 2012-01-08 12:59:53Z rfscholte $
Author:
Stephane Nicoll

Field Summary
protected static String ALT_DD
           
protected  String altDeploymentDescriptor
           
protected  String bundleDir
           
protected  String bundleFileName
           
protected  EarExecutionContext earExecutionContext
           
protected  Boolean excluded
           
protected static String JAVA_MODULE
           
protected static String MODULE_ELEMENT
           
protected  Boolean unpack
           
 
Constructor Summary
AbstractEarModule()
          Empty constructor to be used when the module is built based on the configuration.
AbstractEarModule(Artifact a)
          Creates an ear module from the artifact.
 
Method Summary
 boolean changeManifestClasspath()
           
 String getAltDeploymentDescriptor()
          The alt-dd element specifies an optional URI to the post-assembly version of the deployment descriptor file for a particular Java EE module.
 Artifact getArtifact()
          Returns the Artifact representing this module.
 String getArtifactId()
          Returns the artifact's Id.
 String getBundleDir()
          Returns the bundle directory.
 String getBundleFileName()
          Returns the bundle file name.
 String getClassifier()
          Returns the artifact's classifier.
 String getGroupId()
          Returns the artifact's groupId.
 String getLibDir()
           
 String getModuleId()
           
 String getUri()
          Returns the URI for this module.
 boolean isExcluded()
          Specify whether this module should be excluded or not.
 void resolveArtifact(Set<Artifact> artifacts)
          Resolves the Artifact represented by the module.
 void setEarExecutionContext(EarExecutionContext earExecutionContext)
           
 Boolean shouldUnpack()
          Specify whether this module should be unpacked in the EAR archive or not.
protected  void startModuleElement(XMLWriter writer, Boolean generateId)
          Starts a new MODULE_ELEMENT on the specified writer, possibly including an id attribute.
 String toString()
           
protected  void writeAltDeploymentDescriptor(XMLWriter writer, String version)
          Writes the alternative deployment descriptor if necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.maven.plugin.ear.EarModule
appendModule, getType
 

Field Detail

MODULE_ELEMENT

protected static final String MODULE_ELEMENT
See Also:
Constant Field Values

JAVA_MODULE

protected static final String JAVA_MODULE
See Also:
Constant Field Values

ALT_DD

protected static final String ALT_DD
See Also:
Constant Field Values

bundleDir

protected String bundleDir

bundleFileName

protected String bundleFileName

excluded

protected Boolean excluded

unpack

protected Boolean unpack

altDeploymentDescriptor

protected String altDeploymentDescriptor

earExecutionContext

protected EarExecutionContext earExecutionContext
Constructor Detail

AbstractEarModule

public AbstractEarModule()
Empty constructor to be used when the module is built based on the configuration.


AbstractEarModule

public AbstractEarModule(Artifact a)
Creates an ear module from the artifact.

Parameters:
a - the artifact
Method Detail

setEarExecutionContext

public void setEarExecutionContext(EarExecutionContext earExecutionContext)
Specified by:
setEarExecutionContext in interface EarModule

resolveArtifact

public void resolveArtifact(Set<Artifact> artifacts)
                     throws EarPluginException,
                            MojoFailureException
Resolves the Artifact represented by the module. Note that the EarExecutionContext might be used to customize further the resolution.

Specified by:
resolveArtifact in interface EarModule
Parameters:
artifacts - the project's artifacts
Throws:
EarPluginException - if the artifact could not be resolved
MojoFailureException - if an unexpected error occurred

getArtifact

public Artifact getArtifact()
Description copied from interface: EarModule
Returns the Artifact representing this module.

Note that this might return null till the module has been resolved.

Specified by:
getArtifact in interface EarModule
Returns:
the artifact
See Also:
EarModule.resolveArtifact(java.util.Set)

getModuleId

public String getModuleId()

getUri

public String getUri()
Description copied from interface: EarModule
Returns the URI for this module.

Specified by:
getUri in interface EarModule
Returns:
the URI

getGroupId

public String getGroupId()
Returns the artifact's groupId.

Returns:
the group Id

getArtifactId

public String getArtifactId()
Returns the artifact's Id.

Returns:
the artifact Id

getClassifier

public String getClassifier()
Returns the artifact's classifier.

Returns:
the artifact classifier

getBundleDir

public String getBundleDir()
Returns the bundle directory. If null, the module is bundled in the root of the EAR.

Returns:
the custom bundle directory

getBundleFileName

public String getBundleFileName()
Returns the bundle file name. If null, the artifact's file name is returned.

Returns:
the bundle file name

getAltDeploymentDescriptor

public String getAltDeploymentDescriptor()
The alt-dd element specifies an optional URI to the post-assembly version of the deployment descriptor file for a particular Java EE module. The URI must specify the full pathname of the deployment descriptor file relative to the application's root directory.

Specified by:
getAltDeploymentDescriptor in interface EarModule
Returns:
the alternative deployment descriptor for this module

isExcluded

public boolean isExcluded()
Specify whether this module should be excluded or not.

Specified by:
isExcluded in interface EarModule
Returns:
true if this module should be skipped, false otherwise

shouldUnpack

public Boolean shouldUnpack()
Description copied from interface: EarModule
Specify whether this module should be unpacked in the EAR archive or not.

Returns null if no configuration was specified so that defaulting may apply.

Specified by:
shouldUnpack in interface EarModule
Returns:
true if this module should be bundled unpacked, false otherwise

writeAltDeploymentDescriptor

protected void writeAltDeploymentDescriptor(XMLWriter writer,
                                            String version)
Writes the alternative deployment descriptor if necessary.

Parameters:
writer - the writer to use
version - the java EE version in use

startModuleElement

protected void startModuleElement(XMLWriter writer,
                                  Boolean generateId)
Starts a new MODULE_ELEMENT on the specified writer, possibly including an id attribute.

Parameters:
writer - the XML writer.
generateId - whether an id should be generated

toString

public String toString()
Overrides:
toString in class Object

changeManifestClasspath

public boolean changeManifestClasspath()
Specified by:
changeManifestClasspath in interface EarModule

getLibDir

public String getLibDir()
Specified by:
getLibDir in interface EarModule


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.