org.ow2.jonas.ant
Class JonasDeploymentTool

java.lang.Object
  extended by org.ow2.jonas.ant.GenericDeploymentTool
      extended by org.ow2.jonas.ant.JonasDeploymentTool
All 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
Author:
Cyrille Morvan , Ingenosya France , Contributor(s): Mathieu Peltier Adriana Danes: change configuration directory name from "config" to "conf"
See Also:
EjbJar.createJonas()

Field Summary
protected static String BOOTSTRAP_CLASS
          Bootstrap class name.
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.
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 JONAS_EJB_JAR_3_0_DTD
           
protected static String JONAS_EJB_JAR_3_0_PUBLIC_ID
           
protected static String JONAS_EJB_JAR_3_2_DTD
           
protected static String JONAS_EJB_JAR_3_2_PUBLIC_ID
           
protected static String JONAS_EJB_JAR_3_3_2_DTD
           
protected static String JONAS_EJB_JAR_3_3_2_PUBLIC_ID
           
protected static String JONAS_EJB_JAR_3_3_DTD
           
protected static String JONAS_EJB_JAR_3_3_PUBLIC_ID
           
 
Fields inherited from class org.ow2.jonas.ant.GenericDeploymentTool
ANALYZER_CLASS_FULL, ANALYZER_CLASS_SUPER, ANALYZER_FULL, ANALYZER_NONE, ANALYZER_SUPER, DEFAULT_ANALYZER, EJB_DD, MANIFEST, META_DIR
 
Constructor Summary
JonasDeploymentTool()
           
 
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.
protected  void mergeManifest(File manifestUserFile, File manifestGenicFile)
          Merge Manifest file
 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)
          Set the additionalargs.
 void setClasspathref(org.apache.tools.ant.types.Reference r)
          Set the classpath as a Reference on another path
 void setInvokecmd(boolean aBoolean)
          Set the #invokecmdflag.
 void setJarsuffix(String aString)
          Set the #jarsuffix.
 void setJavac(String aString)
          Set the java compiler javacto use.
 void setJavacopts(String aString)
          Set the options to pass to the java compiler.
 void setJonasbase(File aFile)
          Set the JOnAS base directory.
 void setJonasroot(File aFile)
          Set the JOnAS root directory.
 void setJvmopts(String aString)
          Set the additional args to pass to the GenIC JVM.
 void setKeepgenerated(boolean aBoolean)
          Set the keepgeneratedflag.
 void setKeepgeneric(boolean aBoolean)
          Set the keepgenericflag.
 void setMappernames(String aString)
          Do nothing because the mappernames attribute is deprecated
 void setNocompil(boolean aBoolean)
          Set the nocompilflag.
 void setNoFastRMIC(boolean value)
           
 void setNogenic(boolean aBoolean)
          Set the nogenicflag.
 void setNovalidation(boolean aBoolean)
          Set the novalidationflag.
 void setProtocols(String aString)
          Set the protocols list
 void setRmicopts(String aString)
          Set the options to pass to the rmi compiler.
 void setVerbose(boolean aBoolean)
          Set the verboseflag.
protected  void writeJar(String baseName, File jarfile, Hashtable ejbFiles, String publicId, boolean includeInnerClasses)
          Method used to encapsulate the writing of the JAR file.
 
Methods inherited from class org.ow2.jonas.ant.GenericDeploymentTool
addFileToJar, addSupportClasses, checkAndAddDependants, configure, createClasspath, getClassLoaderForBuild, getCombinedClasspath, getConfig, getDescriptorHandler, getDestDir, getLocation, getManifestFile, getPublicId, getTask, getVendorDDPrefix, log, needToRebuild, parseEjbFiles, setClasspath, setDestdir, setGenericJarSuffix, setTask, usingBaseJarName, validateConfigured
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EJB_JAR_1_1_PUBLIC_ID

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

See Also:
Constant Field Values

EJB_JAR_2_0_PUBLIC_ID

protected static final String EJB_JAR_2_0_PUBLIC_ID
See Also:
Constant Field Values

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.

See Also:
Constant Field Values

JONAS_EJB_JAR_2_5_PUBLIC_ID

protected static final String JONAS_EJB_JAR_2_5_PUBLIC_ID
See Also:
Constant Field Values

JONAS_EJB_JAR_3_0_PUBLIC_ID

protected static final String JONAS_EJB_JAR_3_0_PUBLIC_ID
See Also:
Constant Field Values

JONAS_EJB_JAR_3_2_PUBLIC_ID

protected static final String JONAS_EJB_JAR_3_2_PUBLIC_ID
See Also:
Constant Field Values

JONAS_EJB_JAR_3_3_PUBLIC_ID

protected static final String JONAS_EJB_JAR_3_3_PUBLIC_ID
See Also:
Constant Field Values

JONAS_EJB_JAR_3_3_2_PUBLIC_ID

protected static final String JONAS_EJB_JAR_3_3_2_PUBLIC_ID
See Also:
Constant Field Values

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).

See Also:
Constant Field Values

EJB_JAR_2_0_DTD

protected static final String EJB_JAR_2_0_DTD
See Also:
Constant Field Values

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).

See Also:
Constant Field Values

JONAS_EJB_JAR_2_5_DTD

protected static final String JONAS_EJB_JAR_2_5_DTD
See Also:
Constant Field Values

JONAS_EJB_JAR_3_0_DTD

protected static final String JONAS_EJB_JAR_3_0_DTD
See Also:
Constant Field Values

JONAS_EJB_JAR_3_2_DTD

protected static final String JONAS_EJB_JAR_3_2_DTD
See Also:
Constant Field Values

JONAS_EJB_JAR_3_3_DTD

protected static final String JONAS_EJB_JAR_3_3_DTD
See Also:
Constant Field Values

JONAS_EJB_JAR_3_3_2_DTD

protected static final String JONAS_EJB_JAR_3_3_2_DTD
See Also:
Constant Field Values

JONAS_DD

protected static final String JONAS_DD
Default JOnAS deployment descriptor name.

See Also:
Constant Field Values

BOOTSTRAP_CLASS

protected static final String BOOTSTRAP_CLASS
Bootstrap class name.

See Also:
Constant Field Values

GENIC_CLASS

protected static final String GENIC_CLASS
GenIC class name.

See Also:
Constant Field Values
Constructor Detail

JonasDeploymentTool

public JonasDeploymentTool()
Method Detail

setKeepgenerated

public void setKeepgenerated(boolean aBoolean)
Set the keepgeneratedflag.

Parameters:
aBoolean - true if the flag must be set.

setNoFastRMIC

public void setNoFastRMIC(boolean value)

setMappernames

public void setMappernames(String aString)
Do nothing because the mappernames attribute is deprecated

Parameters:
aString - list of mapper names separed by ,

setProtocols

public void setProtocols(String aString)
Set the protocols list

Parameters:
aString - list of the protocol names separed by ,

setClasspathref

public void setClasspathref(org.apache.tools.ant.types.Reference r)
Set the classpath as a Reference on another path

Parameters:
r - Referenced Classpath

setAdditionalargs

public void setAdditionalargs(String aString)
Set the additionalargs.

Parameters:
aString - additional args.

setNocompil

public void setNocompil(boolean aBoolean)
Set the nocompilflag.

Parameters:
aBoolean - true if the flag must be set.

setInvokecmd

public void setInvokecmd(boolean aBoolean)
Set the #invokecmdflag.

Parameters:
aBoolean - true if the flag must be set.

setNovalidation

public void setNovalidation(boolean aBoolean)
Set the novalidationflag.

Parameters:
aBoolean - true if the flag must be set.

setJavac

public void setJavac(String aString)
Set the java compiler javacto 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.

setRmicopts

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

Parameters:
aString - the options.

setVerbose

public void setVerbose(boolean aBoolean)
Set the verboseflag.

Parameters:
aBoolean - true if the flag must be set.

setJonasroot

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

Parameters:
aFile - the JOnAS root directory.

setJonasbase

public void setJonasbase(File aFile)
Set the JOnAS base directory.

Parameters:
aFile - the JOnAS base directory.

setKeepgeneric

public void setKeepgeneric(boolean aBoolean)
Set the keepgenericflag.

Parameters:
aBoolean - true if the flag must be set.

setJarsuffix

public void setJarsuffix(String aString)
Set the #jarsuffix.

Parameters:
aString - the string to use as the suffix.

setNogenic

public void setNogenic(boolean aBoolean)
Set the nogenicflag.

Parameters:
aBoolean - true if the flag must be set.

setJvmopts

public void setJvmopts(String aString)
Set the additional args to pass to the GenIC JVM.

Parameters:
aString - the options.

processDescriptor

public void processDescriptor(String aDescriptorName,
                              SAXParser saxParser)
Description copied from interface: EJBDeploymentTool
Process a deployment descriptor, generating the necessary vendor specific deployment files.

Specified by:
processDescriptor in interface EJBDeploymentTool
Overrides:
processDescriptor in class GenericDeploymentTool
Parameters:
aDescriptorName - the name of the deployment descriptor
saxParser - a SAX parser which can be used to parse the deployment descriptor.

writeJar

protected void writeJar(String baseName,
                        File jarfile,
                        Hashtable ejbFiles,
                        String publicId,
                        boolean includeInnerClasses)
                 throws org.apache.tools.ant.BuildException
Description copied from class: GenericDeploymentTool
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 class GenericDeploymentTool
includeInnerClasses - if true, include inner classes
Throws:
org.apache.tools.ant.BuildException

mergeManifest

protected void mergeManifest(File manifestUserFile,
                             File manifestGenicFile)
Merge Manifest file

Parameters:
manifestUserFile - : input file
manifestGenicFile - : output file

addVendorFiles

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

Overrides:
addVendorFiles in class GenericDeploymentTool

getVendorOutputJarFile

protected File getVendorOutputJarFile(String baseName)
Description copied from class: GenericDeploymentTool
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.


getJarBaseName

protected String getJarBaseName(String descriptorFileName)
Description copied from class: GenericDeploymentTool
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 class 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

registerKnownDTDs

protected void registerKnownDTDs(DescriptorHandler handler)
Description copied from class: GenericDeploymentTool
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 class GenericDeploymentTool

checkConfiguration

protected void checkConfiguration(String descriptorFileName,
                                  SAXParser saxParser)
                           throws org.apache.tools.ant.BuildException
Description copied from class: GenericDeploymentTool
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 class 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:
org.apache.tools.ant.BuildException - Thrown if the configuration is invalid


Copyright © 2010 OW2 Consortium. All Rights Reserved.