|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.Task | +--org.apache.tools.ant.taskdefs.MatchingTask | +--org.apache.tools.ant.taskdefs.optional.ejb.EjbJar
Provides automated ejb jar file creation for ant. 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.
Functionality is currently provided for standard EJB1.1 jars and Weblogic 5.1 jars. The weblogic deployment descriptors, used in constructing the Weblogic jar, are located based on a simple naming convention. The name of the standard deployment descriptor is taken upto the first instance of a String, specified by the attribute baseNameTerminator, and then the regular Weblogic descriptor name is appended. For example if baseNameTerminator is set to '-', its default value, and a standard descriptor is called Foo-ejb-jar.xml then the files Foo-weblogic-ejb-jar.xml and Foo-weblogic-cmp-rdbms-jar.xml will be looked for, and if found, included in the jarfile.
Attributes and setter methods are provided to support optional generation of Weblogic5.1 jars, optional deletion of generic jar files, setting alternate values for baseNameTerminator, and setting the strings to append to the names of the generated jarfiles.
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
fileset, useDefaultExcludes |
Fields inherited from class org.apache.tools.ant.Task |
description, location, project, target, taskName, taskType, wrapper |
Constructor Summary | |
EjbJar()
|
Method Summary | |
WeblogicDeploymentTool |
createWeblogic()
|
WeblogicTOPLinkDeploymentTool |
createWeblogictoplink()
|
void |
execute()
Invoked by Ant after the task is prepared, when it is ready to execute this task. |
void |
setBasejarname(java.lang.String inValue)
Setter used to store the value of descriptorDir prior to execute() being called. |
void |
setBasenameterminator(java.lang.String inValue)
Setter used to store the value of baseNameTerminator |
void |
setDescriptordir(java.io.File inDir)
Setter used to store the value of descriptorDir prior to execute() being called. |
void |
setDestdir(java.io.File inDir)
Setter used to store the value of destination directory prior to execute() being called. |
void |
setFlatdestdir(boolean inValue)
Setter used to store the value of flatDestDir. |
void |
setGenerateweblogic(java.lang.String inValue)
Setter used to store the value of generateweblogic. |
void |
setGenericjarsuffix(java.lang.String inString)
Setter used to store the suffix for the generated jar file. |
void |
setSrcdir(java.io.File inDir)
Setter used to store the value of srcDir prior to execute() being called. |
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
createExclude, createInclude, createPatternSet, getDirectoryScanner, setDefaultexcludes, setExcludes, setExcludesfile, setIncludes, setIncludesfile, XsetIgnore, XsetItems |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getProject, getRuntimeConfigurableWrapper, getTaskName, init, log, log, maybeConfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EjbJar()
Method Detail |
public WeblogicDeploymentTool createWeblogic()
public WeblogicTOPLinkDeploymentTool createWeblogictoplink()
public 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 setBasejarname(java.lang.String inValue)
inDir
- the directory containing the deployment descriptors.public void setDestdir(java.io.File inDir)
inFile
- the destination directory.public void setFlatdestdir(boolean inValue)
inValue
- a string, either 'true' or 'false'.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 setGenerateweblogic(java.lang.String inValue)
inValue
- a string, either 'true' or 'false'.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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |