public class EjbJar extends MatchingTask
Extends the MatchingTask class provided in the default ant distribution to provide a directory scanning EJB jarfile generator.
The task works by taking the deployment descriptors one at a time and parsing them to locate the names of the classes which should be placed in the jar. The classnames are translated to java.io.Files by replacing periods with File.separatorChar and resolving the generated filename as a relative path under the srcDir attribute. All necessary files are then assembled into a jarfile. One jarfile is constructed for each deployment descriptor found.
Modifier and Type | Class and Description |
---|---|
static class |
EjbJar.CMPVersion
CMP versions supported
valid CMP versions are 1.0 and 2.0
|
static class |
EjbJar.DTDLocation
Inner class used to record information about the location of a local DTD
|
static class |
EjbJar.NamingScheme
An EnumeratedAttribute class for handling different EJB jar naming
schemes
|
fileset
description, location, project
Constructor and Description |
---|
EjbJar() |
Modifier and Type | Method and Description |
---|---|
protected void |
addDeploymentTool(EJBDeploymentTool deploymentTool)
Add a deployment tool to the list of deployment tools that will be
processed
|
BorlandDeploymentTool |
createBorland()
Adds a deployment tool for Borland server.
|
Path |
createClasspath()
Adds to the classpath used to locate the super classes and
interfaces of the classes that will make up the EJB JAR.
|
EjbJar.DTDLocation |
createDTD()
Create a DTD location record.
|
IPlanetDeploymentTool |
createIplanet()
Adds a deployment tool for iPlanet Application Server.
|
JbossDeploymentTool |
createJboss()
Adds a deployment tool for JBoss server.
|
JonasDeploymentTool |
createJonas()
Adds a deployment tool for JOnAS server.
|
FileSet |
createSupport()
Adds a fileset for support elements.
|
WeblogicDeploymentTool |
createWeblogic()
Adds a deployment tool for Weblogic server.
|
WeblogicTOPLinkDeploymentTool |
createWeblogictoplink()
Adds a deployment tool for Weblogic when using the Toplink
Object-Relational mapping.
|
WebsphereDeploymentTool |
createWebsphere()
Adds a deployment tool for Websphere 4.0 server.
|
void |
execute()
Invoked by Ant after the task is prepared, when it is ready to execute
this task.
|
java.lang.String |
getCmpversion()
Gets the CMP version.
|
java.io.File |
getDestdir()
Gets the destination directory.
|
void |
setBasejarname(java.lang.String inValue)
Set the base name of the EJB JAR that is to be created if it is not
to be determined from the name of the deployment descriptor files.
|
void |
setBasenameterminator(java.lang.String inValue)
The string which terminates the bean name.
|
void |
setClasspath(Path classpath)
Set the classpath to use when resolving classes for inclusion in the jar.
|
void |
setCmpversion(EjbJar.CMPVersion version)
Sets the CMP version.
|
void |
setDependency(java.lang.String analyzer)
Set the analyzer to use when adding in dependencies to the JAR.
|
void |
setDescriptordir(java.io.File inDir)
Set the descriptor directory.
|
void |
setDestdir(java.io.File inDir)
Set the destination directory.
|
void |
setFlatdestdir(boolean inValue)
Controls whether the
destination JARs are written out in the destination directory with
the same hierarchical structure from which the deployment descriptors
have been read.
|
void |
setGenericjarsuffix(java.lang.String inString)
Set the suffix for the generated jar file.
|
void |
setManifest(java.io.File manifest)
Set the Manifest file to use when jarring.
|
void |
setNaming(EjbJar.NamingScheme namingScheme)
Set the naming scheme used to determine the name of the generated jars
from the deployment descriptor
|
void |
setSrcdir(java.io.File inDir)
Sets the source directory, which is the directory that
contains the classes that will be added to the EJB jar.
|
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
clone, getDescription, getLocation, getProject, setDescription, setLocation
protected void addDeploymentTool(EJBDeploymentTool deploymentTool)
deploymentTool
- a deployment tool instance to which descriptors
will be passed for processing.public WeblogicDeploymentTool createWeblogic()
public WebsphereDeploymentTool createWebsphere()
public BorlandDeploymentTool createBorland()
public IPlanetDeploymentTool createIplanet()
public JbossDeploymentTool createJboss()
public JonasDeploymentTool createJonas()
public WeblogicTOPLinkDeploymentTool createWeblogictoplink()
public Path createClasspath()
public EjbJar.DTDLocation createDTD()
public FileSet createSupport()
public void setManifest(java.io.File manifest)
manifest
- the manifest to be used in the EJB jarpublic void setSrcdir(java.io.File inDir)
inDir
- the source directory.public void setDescriptordir(java.io.File inDir)
inDir
- the directory containing the deployment descriptors.public void setDependency(java.lang.String analyzer)
analyzer
- the name of the dependency analyzer or a class.public void setBasejarname(java.lang.String inValue)
inValue
- the basename that will be used when writing the jar
file containing the EJBpublic void setNaming(EjbJar.NamingScheme namingScheme)
namingScheme
- the naming scheme to be usedpublic java.io.File getDestdir()
public void setDestdir(java.io.File inDir)
inDir
- the destination directory in which to generate jarspublic java.lang.String getCmpversion()
public void setCmpversion(EjbJar.CMPVersion version)
version
- CMP version.
Must be either 1.0
or 2.0
.1.0
.public void setClasspath(Path classpath)
classpath
- the classpath to use.public void setFlatdestdir(boolean inValue)
inValue
- the new value of the flatdestdir flag.public void setGenericjarsuffix(java.lang.String inString)
inString
- the string to use as the suffix.public void setBasenameterminator(java.lang.String inValue)
inValue
- a string which marks the end of the basename.public void execute() throws BuildException
execute
in class Task
BuildException
- thrown whenever a problem is
encountered that cannot be recovered from, to signal to ant
that a major problem occurred within this task.