org.apache.tools.ant.taskdefs.optional.ejb

Class JonasDeploymentTool

Implemented Interfaces:
EJBDeploymentTool

public class JonasDeploymentTool
extends GenericDeploymentTool

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:
EjbJar.createJonas()

Field Summary

protected static String
DAVID_ORB
DAVID ORB.
protected static String
EJB_JAR_1_1_DTD
Name of the standard deployment descriptor DTD (these files are stored in the ${JONAS_ROOT}/xml directory).
protected static String
EJB_JAR_1_1_PUBLIC_ID
Public Id of the standard deployment descriptor DTD.
protected static String
EJB_JAR_2_0_DTD
protected static String
EJB_JAR_2_0_PUBLIC_ID
protected static String
GENIC_CLASS
GenIC class name (JOnAS 2.5)
protected static String
JEREMIE_ORB
JEREMIE ORB.
protected static String
JONAS_DD
Default JOnAS deployment descriptor name.
protected static String
JONAS_EJB_JAR_2_4_DTD
Name of the JOnAS-specific deployment descriptor DTD (these files are stored in the ${JONAS_ROOT}/xml directory).
protected static String
JONAS_EJB_JAR_2_4_PUBLIC_ID
Public Id of the JOnAS-specific deployment descriptor DTD.
protected static String
JONAS_EJB_JAR_2_5_DTD
protected static String
JONAS_EJB_JAR_2_5_PUBLIC_ID
protected static String
OLD_GENIC_CLASS_1
Old GenIC class name (JOnAS 2.4.x).
protected static String
OLD_GENIC_CLASS_2
Old GenIC class name.
protected static String
RMI_ORB
RMI ORB.

Fields inherited from class org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool

ANALYZER_CLASS_FULL, ANALYZER_CLASS_SUPER, ANALYZER_FULL, ANALYZER_NONE, ANALYZER_SUPER, DEFAULT_ANALYZER, EJB_DD, MANIFEST, META_DIR

Method Summary

protected void
addVendorFiles(Hashtable ejbFiles, String ddPrefix)
Add any vendor specific files which should be included in the EJB Jar.
protected void
checkConfiguration(String descriptorFileName, SAXParser saxParser)
This method is called as the first step in the processDescriptor method to allow vendor-specific subclasses to validate the task configuration prior to processing the descriptor.
protected String
getJarBaseName(String descriptorFileName)
Using the EJB descriptor file name passed from the ejbjar task, this method returns the "basename" which will be used to name the completed JAR file.
protected File
getVendorOutputJarFile(String baseName)
Get the vendor specific name of the Jar that will be output.
void
processDescriptor(String aDescriptorName, SAXParser saxParser)
Process a deployment descriptor, generating the necessary vendor specific deployment files.
protected void
registerKnownDTDs(DescriptorHandler handler)
Register the locations of all known DTDs.
void
setAdditionalargs(String aString)
Sets the additional arguments.
void
setJarsuffix(String aString)
Sets the jar suffix.
void
setJavac(String aString)
Sets the java compiler to use.
void
setJavacopts(String aString)
Set the options to pass to the java compiler.
void
setJonasroot(File aFile)
Set the JOnAS root directory.
void
setKeepgenerated(boolean aBoolean)
Sets the keepgenerated flag.
void
setKeepgeneric(boolean aBoolean)
Sets the keepgeneric flag.
void
setNocompil(boolean aBoolean)
Sets the nocompil flag.
void
setNogenic(boolean aBoolean)
Sets the nogenic flag.
void
setNovalidation(boolean aBoolean)
Sets the novalidation flag.
void
setOrb(String aString)
Sets the orb to construct classpath.
void
setRmicopts(String aString)
Set the options to pass to the rmi compiler.
void
setSecpropag(boolean aBoolean)
Sets the secpropag flag.
void
setVerbose(boolean aBoolean)
Sets the verbose flag.
protected void
writeJar(String baseName, File jarfile, Hashtable ejbFiles, String publicId)
Method used to encapsulate the writing of the JAR file.

Methods inherited from class org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool

addFileToJar, addSupportClasses, addVendorFiles, checkAndAddDependants, checkConfiguration, configure, createClasspath, getClassLoaderForBuild, getCombinedClasspath, getConfig, getDescriptorHandler, getDestDir, getJarBaseName, getLocation, getManifestFile, getPublicId, getTask, getVendorDDPrefix, log, needToRebuild, parseEjbFiles, processDescriptor, registerKnownDTDs, setClasspath, setDestdir, setGenericJarSuffix, setTask, usingBaseJarName, validateConfigured, writeJar

Field Details

DAVID_ORB

protected static final String DAVID_ORB
DAVID ORB.

EJB_JAR_1_1_DTD

protected static final String EJB_JAR_1_1_DTD
Name of the standard deployment descriptor DTD (these files are stored in the ${JONAS_ROOT}/xml directory).

EJB_JAR_1_1_PUBLIC_ID

protected static final String EJB_JAR_1_1_PUBLIC_ID
Public Id of the standard deployment descriptor DTD.

EJB_JAR_2_0_DTD

protected static final String EJB_JAR_2_0_DTD

EJB_JAR_2_0_PUBLIC_ID

protected static final String EJB_JAR_2_0_PUBLIC_ID

GENIC_CLASS

protected static final String GENIC_CLASS
GenIC class name (JOnAS 2.5)

JEREMIE_ORB

protected static final String JEREMIE_ORB
JEREMIE ORB.

JONAS_DD

protected static final String JONAS_DD
Default JOnAS deployment descriptor name.

JONAS_EJB_JAR_2_4_DTD

protected static final String JONAS_EJB_JAR_2_4_DTD
Name of the JOnAS-specific deployment descriptor DTD (these files are stored in the ${JONAS_ROOT}/xml directory).

JONAS_EJB_JAR_2_4_PUBLIC_ID

protected static final String JONAS_EJB_JAR_2_4_PUBLIC_ID
Public Id of the JOnAS-specific deployment descriptor DTD.

JONAS_EJB_JAR_2_5_DTD

protected static final String JONAS_EJB_JAR_2_5_DTD

JONAS_EJB_JAR_2_5_PUBLIC_ID

protected static final String JONAS_EJB_JAR_2_5_PUBLIC_ID

OLD_GENIC_CLASS_1

protected static final String OLD_GENIC_CLASS_1
Old GenIC class name (JOnAS 2.4.x).

OLD_GENIC_CLASS_2

protected static final String OLD_GENIC_CLASS_2
Old GenIC class name.

RMI_ORB

protected static final String RMI_ORB
RMI ORB.

Method Details

addVendorFiles

protected void addVendorFiles(Hashtable ejbFiles,
                              String ddPrefix)
Add any vendor specific files which should be included in the EJB Jar.
Overrides:
addVendorFiles in interface GenericDeploymentTool

checkConfiguration

protected void checkConfiguration(String descriptorFileName,
                                  SAXParser saxParser)
            throws BuildException
This method is called as the first step in the processDescriptor method to allow vendor-specific subclasses to validate the task configuration prior to processing the descriptor. If the configuration is invalid, a BuildException should be thrown.
Overrides:
checkConfiguration in interface GenericDeploymentTool
Parameters:
descriptorFileName - String representing the file name of an EJB descriptor to be processed
saxParser - SAXParser which may be used to parse the XML descriptor
Throws:
BuildException - Thrown if the configuration is invalid

getJarBaseName

protected String getJarBaseName(String descriptorFileName)
Using the EJB descriptor file name passed from the ejbjar task, this method returns the "basename" which will be used to name the completed JAR file.
Overrides:
getJarBaseName in interface GenericDeploymentTool
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

getVendorOutputJarFile

protected File getVendorOutputJarFile(String baseName)
Get the vendor specific name of the Jar that will be output. The modification date of this jar will be checked against the dependent bean classes.

processDescriptor

public void processDescriptor(String aDescriptorName,
                              SAXParser saxParser)
Process a deployment descriptor, generating the necessary vendor specific deployment files.
Specified by:
processDescriptor in interface EJBDeploymentTool
Overrides:
processDescriptor in interface GenericDeploymentTool
Parameters:
saxParser - a SAX parser which can be used to parse the deployment descriptor.

registerKnownDTDs

protected void registerKnownDTDs(DescriptorHandler handler)
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:
registerKnownDTDs in interface GenericDeploymentTool

setAdditionalargs

public void setAdditionalargs(String aString)
Sets the additional arguments.
Parameters:
aString - additional args.

setJarsuffix

public void setJarsuffix(String aString)
Sets the jar suffix.
Parameters:
aString - the string to use as the suffix.

setJavac

public void setJavac(String aString)
Sets the java compiler to use.
Parameters:
aString - the java compiler.

setJavacopts

public void setJavacopts(String aString)
Set the options to pass to the java compiler.
Parameters:
aString - the options.

setJonasroot

public void setJonasroot(File aFile)
Set the JOnAS root directory.
Parameters:
aFile - the JOnAS root directory.

setKeepgenerated

public void setKeepgenerated(boolean aBoolean)
Sets the keepgenerated flag.
Parameters:
aBoolean - true if the flag must be set.

setKeepgeneric

public void setKeepgeneric(boolean aBoolean)
Sets the keepgeneric flag.
Parameters:
aBoolean - true if the flag must be set.

setNocompil

public void setNocompil(boolean aBoolean)
Sets the nocompil flag.
Parameters:
aBoolean - true if the flag must be set.

setNogenic

public void setNogenic(boolean aBoolean)
Sets the nogenic flag.
Parameters:
aBoolean - true if the flag must be set.

setNovalidation

public void setNovalidation(boolean aBoolean)
Sets the novalidation flag.
Parameters:
aBoolean - true if the flag must be set.

setOrb

public void setOrb(String aString)
Sets the orb to construct classpath.
Parameters:
aString - 'RMI', 'JEREMIE', or 'DAVID'.

setRmicopts

public void setRmicopts(String aString)
Set the options to pass to the rmi compiler.
Parameters:
aString - the options.

setSecpropag

public void setSecpropag(boolean aBoolean)
Sets the secpropag flag.
Parameters:
aBoolean - true if the flag must be set.

setVerbose

public void setVerbose(boolean aBoolean)
Sets the verbose flag.
Parameters:
aBoolean - true if the flag must be set.

writeJar

protected void writeJar(String baseName,
                        File jarfile,
                        Hashtable ejbFiles,
                        String publicId)
            throws BuildException
Method 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:
writeJar in interface GenericDeploymentTool

Copyright B) 2000-2006 Apache Software Foundation. All Rights Reserved.