Class JonasDeploymentTool
java.lang.Object
org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool
org.apache.tools.ant.taskdefs.optional.ejb.JonasDeploymentTool
- All Implemented Interfaces:
EJBDeploymentTool
The deployment tool to add the jonas specific deployment descriptors to the
ejb JAR file. JONAS only requires one additional file jonas-ejb-jar.xml.
- Version:
- 1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringDAVID ORB.protected static final StringName of the standard deployment descriptor DTD (these files are stored in the ${JONAS_ROOT}/xml directory).protected static final StringPublic Id of the standard deployment descriptor DTD.protected static final Stringprotected static final Stringprotected static final StringGenIC class name (JOnAS 2.5)protected static final StringJEREMIE ORB.protected static final StringDefault JOnAS deployment descriptor name.protected static final StringName of the JOnAS-specific deployment descriptor DTD (these files are stored in the ${JONAS_ROOT}/xml directory).protected static final StringPublic Id of the JOnAS-specific deployment descriptor DTD.protected static final Stringprotected static final Stringprotected static final StringOld GenIC class name (JOnAS 2.4.x).protected static final StringOld GenIC class name.protected static final StringRMI ORB.Fields inherited from class GenericDeploymentTool
ANALYZER_CLASS_FULL, ANALYZER_CLASS_SUPER, ANALYZER_FULL, ANALYZER_NONE, ANALYZER_SUPER, DEFAULT_ANALYZER, DEFAULT_BUFFER_SIZE, EJB_DD, JAR_COMPRESS_LEVEL, MANIFEST, META_DIRModifier and TypeFieldDescriptionstatic final StringThe analyzer class for the super analyzerstatic final StringThe analyzer class for the super analyzerstatic final StringA dependency analyzer name to find all related classesstatic final StringA dependency analyzer name for no analyzerstatic final StringA dependency analyzer name to find ancestor classesstatic final StringThe default analyzerstatic final intThe default buffer byte size to use for IOprotected static final StringName for EJB Deployment descriptor within EJB jarsstatic final intThe level to use for compressionprotected static final StringThe standard MANIFEST fileprotected static final StringThe standard META-INF directory in jar files -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddVendorFiles(Hashtable<String, File> ejbFiles, String ddPrefix) Add any vendor specific files which should be included in the EJB Jar.protected voidcheckConfiguration(String descriptorFileName, SAXParser saxParser) Verify the configuration.protected StringgetJarBaseName(String descriptorFileName) Using the EJB descriptor file name passed from theejbjartask, this method returns the "basename" which will be used to name the completed JAR file.protected FilegetVendorOutputJarFile(String baseName) .voidprocessDescriptor(String aDescriptorName, SAXParser saxParser) Process a deployment descriptor, generating the necessary vendor specific deployment files.protected voidregisterKnownDTDs(DescriptorHandler handler) Register the locations of all known DTDs.voidsetAdditionalargs(String aString) Sets the additional arguments.voidsetJarsuffix(String aString) Sets the jar suffix.voidSets the java compiler to use.voidsetJavacopts(String aString) Set the options to pass to the java compiler.voidsetJonasroot(File aFile) Set the JOnAS root directory.voidsetKeepgenerated(boolean aBoolean) Sets thekeepgeneratedflag.voidsetKeepgeneric(boolean aBoolean) Sets thekeepgenericflag.voidsetNocompil(boolean aBoolean) Sets thenocompilflag.voidsetNogenic(boolean aBoolean) Sets thenogenicflag.voidsetNovalidation(boolean aBoolean) Sets thenovalidationflag.voidSets theorbto construct classpath.voidsetRmicopts(String aString) Set the options to pass to the rmi compiler.voidsetSecpropag(boolean aBoolean) Sets thesecpropagflag.voidsetVerbose(boolean aBoolean) Sets theverboseflag.protected voidMethod used to encapsulate the writing of the JAR file.Methods inherited from class GenericDeploymentTool
addFileToJar, addSupportClasses, checkAndAddDependants, configure, createClasspath, getClassLoaderForBuild, getCombinedClasspath, getConfig, getDescriptorHandler, getDestDir, getLocation, getManifestFile, getPublicId, getTask, getVendorDDPrefix, log, needToRebuild, parseEjbFiles, setClasspath, setDestdir, setGenericJarSuffix, setTask, usingBaseJarName, validateConfiguredModifier and TypeMethodDescriptionprotected voidaddFileToJar(JarOutputStream jStream, File inputFile, String logicalFilename) Utility method that encapsulates the logic of adding a file entry to a .jar file.protected voidaddSupportClasses(Hashtable<String, File> ejbFiles) Adds any classes the user specifies using support nested elements to theejbFilesHashtable.protected voidcheckAndAddDependants(Hashtable<String, File> checkEntries) Add all available classes, that depend on Remote, Home, Bean, PKvoidconfigure(org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.Config config) Configure this tool for use in the ejbjar task.Add the classpath for the user classesprotected ClassLoaderReturns a Classloader object which parses the passed in generic EjbJar classpath.protected PathGet the classpath by combining the one from the surrounding task, if any and the one from this tool.protected org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.ConfigGet the basename terminator.protected DescriptorHandlergetDescriptorHandler(File srcDir) Get a descriptionHandler.protected FileGet the destination directory.protected LocationGet the build file location associated with this element's task.protected FilegetManifestFile(String prefix) Get the manifest file to use for building the generic jar.protected StringReturns the Public ID of the DTD specified in the EJB descriptor.protected TaskgetTask()Get the task for this tool.getVendorDDPrefix(String baseName, String descriptorFileName) Get the prefix for vendor deployment descriptors.protected voidLog a message to the Ant output.protected booleanneedToRebuild(Hashtable<String, File> ejbFiles, File jarFile) This method checks the timestamp on each file listed in theejbFilesand compares them to the timestamp on thejarFile.parseEjbFiles(String descriptorFileName, SAXParser saxParser) This method returns a list of EJB files found when the specified EJB descriptor is parsed and processed.voidsetClasspath(Path classpath) Set the classpath to be used for this compilation.voidsetDestdir(File inDir) Set the destination directory; required.voidsetGenericJarSuffix(String inString) Set the suffix for the generated jar file.voidSet the task which owns this toolprotected booleanIndicate if this build is using the base jar name.voidCalled to validate that the tool parameters have been configured.
-
Field Details
-
EJB_JAR_1_1_PUBLIC_ID
Public Id of the standard deployment descriptor DTD.- See Also:
-
EJB_JAR_2_0_PUBLIC_ID
- See Also:
-
JONAS_EJB_JAR_2_4_PUBLIC_ID
Public Id of the JOnAS-specific deployment descriptor DTD.- See Also:
-
JONAS_EJB_JAR_2_5_PUBLIC_ID
- See Also:
-
RMI_ORB
-
JEREMIE_ORB
-
DAVID_ORB
-
EJB_JAR_1_1_DTD
Name of the standard deployment descriptor DTD (these files are stored in the ${JONAS_ROOT}/xml directory).- See Also:
-
EJB_JAR_2_0_DTD
- See Also:
-
JONAS_EJB_JAR_2_4_DTD
Name of the JOnAS-specific deployment descriptor DTD (these files are stored in the ${JONAS_ROOT}/xml directory).- See Also:
-
JONAS_EJB_JAR_2_5_DTD
- See Also:
-
JONAS_DD
-
GENIC_CLASS
-
OLD_GENIC_CLASS_1
-
OLD_GENIC_CLASS_2
-
-
Constructor Details
-
JonasDeploymentTool
public JonasDeploymentTool()
-
-
Method Details
-
setKeepgenerated
public void setKeepgenerated(boolean aBoolean) Sets thekeepgeneratedflag.- Parameters:
aBoolean-trueif the flag must be set.
-
setAdditionalargs
Sets the additional arguments.- Parameters:
aString- additional args.
-
setNocompil
public void setNocompil(boolean aBoolean) Sets thenocompilflag.- Parameters:
aBoolean-trueif the flag must be set.
-
setNovalidation
public void setNovalidation(boolean aBoolean) Sets thenovalidationflag.- Parameters:
aBoolean-trueif the flag must be set.
-
setJavac
Sets the java compiler to use.- Parameters:
aString- the java compiler.
-
setJavacopts
Set the options to pass to the java compiler.- Parameters:
aString- the options.
-
setRmicopts
Set the options to pass to the rmi compiler.- Parameters:
aString- the options.
-
setSecpropag
public void setSecpropag(boolean aBoolean) Sets thesecpropagflag.- Parameters:
aBoolean-trueif the flag must be set.
-
setVerbose
public void setVerbose(boolean aBoolean) Sets theverboseflag.- Parameters:
aBoolean-trueif the flag must be set.
-
setJonasroot
Set the JOnAS root directory.- Parameters:
aFile- the JOnAS root directory.
-
setKeepgeneric
public void setKeepgeneric(boolean aBoolean) Sets thekeepgenericflag.- Parameters:
aBoolean-trueif the flag must be set.
-
setJarsuffix
Sets the jar suffix.- Parameters:
aString- the string to use as the suffix.
-
setOrb
Sets theorbto construct classpath.- Parameters:
aString- 'RMI', 'JEREMIE', or 'DAVID'.
-
setNogenic
public void setNogenic(boolean aBoolean) Sets thenogenicflag.- Parameters:
aBoolean-trueif the flag must be set.
-
processDescriptor
Process a deployment descriptor, generating the necessary vendor specific deployment files...- Specified by:
processDescriptorin interfaceEJBDeploymentTool- Overrides:
processDescriptorin classGenericDeploymentTool- Parameters:
aDescriptorName- the name of the deployment descriptorsaxParser- a SAX parser which can be used to parse the deployment descriptor.
-
writeJar
protected void writeJar(String baseName, File jarfile, Hashtable<String, File> ejbFiles, String publicId) throws BuildExceptionMethod used to encapsulate the writing of the JAR file. Iterates over the filenames/java.io.Files in the Hashtable stored on the instance variable ejbFiles..- Overrides:
writeJarin classGenericDeploymentTool- Parameters:
baseName- the base name to use.jarfile- the jar file to write to.ejbFiles- the files to write to the jar.publicId- the id to use.- Throws:
BuildException- if there is a problem.
-
addVendorFiles
Add any vendor specific files which should be included in the EJB Jar..- Overrides:
addVendorFilesin classGenericDeploymentTool- Parameters:
ejbFiles- a hashtable entryname -> file.ddPrefix- a prefix to use.
-
getVendorOutputJarFile
-
getJarBaseName
Using the EJB descriptor file name passed from theejbjartask, this method returns the "basename" which will be used to name the completed JAR file..- Overrides:
getJarBaseNamein classGenericDeploymentTool- Parameters:
descriptorFileName- String representing the file name of an EJB descriptor to be processed- Returns:
- The "basename" which will be used to name the completed JAR file
-
registerKnownDTDs
Register the locations of all known DTDs. vendor-specific subclasses should override this method to define the vendor-specific locations of the EJB DTDs.- Overrides:
registerKnownDTDsin classGenericDeploymentTool- Parameters:
handler- no used in this class.
-
checkConfiguration
protected void checkConfiguration(String descriptorFileName, SAXParser saxParser) throws BuildException Verify the configuration.- Overrides:
checkConfigurationin classGenericDeploymentTool- Parameters:
descriptorFileName- the name of the descriptor file.saxParser- not used.- Throws:
BuildException- if there is an error.
-