org.objectweb.jonas.ant.GenericDeploymentTool Class Reference

Inherited by org.objectweb.jonas.ant.JonasDeploymentTool.

Inheritance diagram for org.objectweb.jonas.ant.GenericDeploymentTool:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.jonas.ant.GenericDeploymentTool:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void setDestdir (File inDir)
void setTask (Task task)
void setGenericJarSuffix (String inString)
Path createClasspath ()
void setClasspath (Path classpath)
void configure (EjbJar.Config config)
String getVendorDDPrefix (String baseName, String descriptorFileName)
void validateConfigured () throws BuildException

Static Public Attributes

final String ANALYZER_SUPER = "super"
final String ANALYZER_FULL = "full"
final String ANALYZER_NONE = "none"
final String DEFAULT_ANALYZER = ANALYZER_SUPER
final String ANALYZER_CLASS_SUPER = "org.apache.tools.ant.util.depend.bcel.AncestorAnalyzer"
final String ANALYZER_CLASS_FULL = "org.apache.tools.ant.util.depend.bcel.FullAnalyzer"

Protected Member Functions

File getDestDir ()
Task getTask ()
EjbJar.Config getConfig ()
boolean usingBaseJarName ()
Path getCombinedClasspath ()
void log (String message, int level)
Location getLocation ()
void addFileToJar (JarOutputStream jStream, File inputFile, String logicalFilename) throws BuildException
void registerKnownDTDs (DescriptorHandler handler)
void checkConfiguration (String descriptorFileName, SAXParser saxParser) throws BuildException
Hashtable parseEjbFiles (String descriptorFileName, SAXParser saxParser) throws IOException, SAXException
void addSupportClasses (Hashtable ejbFiles)
String getJarBaseName (String descriptorFileName)
void addVendorFiles (Hashtable ejbFiles, String ddPrefix)
boolean needToRebuild (Hashtable ejbFiles, File jarFile)
String getPublicId ()
File getManifestFile (String prefix)
void writeJar (String baseName, File jarfile, Hashtable files, String publicId, boolean includeInnerClasses) throws BuildException
void checkAndAddDependants (Hashtable checkEntries) throws BuildException
ClassLoader getClassLoaderForBuild ()

Static Protected Attributes

final String META_DIR = "META-INF/"
final String MANIFEST = META_DIR + "MANIFEST.MF"
final String EJB_DD = "ejb-jar.xml"

Package Functions

File getVendorOutputJarFile (String baseName)

Detailed Description

: Method writeJar is modified. It allows to include or not inner classes for some classes). protected void writeJar(String baseName, File jarfile, Hashtable files, String publicId, boolean includeInnerClasses) throws BuildException {

Definition at line 63 of file GenericDeploymentTool.java.


Member Function Documentation

void org.objectweb.jonas.ant.GenericDeploymentTool.addFileToJar JarOutputStream  jStream,
File  inputFile,
String  logicalFilename
throws BuildException [protected]
 

Utility method that encapsulates the logic of adding a file entry to a .jar file. Used by execute() to add entries to the jar file as it is constructed.

Parameters:
jStream A JarOutputStream into which to write the jar entry.
inputFile A File from which to read the contents the file being added.
logicalFilename A String representing the name, including all relevant path information, that should be stored for the entry being added.

Definition at line 324 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.GenericDeploymentTool.log().

Referenced by org.objectweb.jonas.ant.GenericDeploymentTool.writeJar().

Here is the call graph for this function:

void org.objectweb.jonas.ant.GenericDeploymentTool.addSupportClasses Hashtable  ejbFiles  )  [protected]
 

Adds any classes the user specifies using support nested elements to the ejbFiles Hashtable.

Parameters:
ejbFiles Hashtable of EJB classes (and other) files that will be added to the completed JAR file

Definition at line 549 of file GenericDeploymentTool.java.

void org.objectweb.jonas.ant.GenericDeploymentTool.addVendorFiles Hashtable  ejbFiles,
String  ddPrefix
[protected]
 

Add any vendor specific files which should be included in the EJB Jar.

Reimplemented in org.objectweb.jonas.ant.JonasDeploymentTool.

Definition at line 653 of file GenericDeploymentTool.java.

void org.objectweb.jonas.ant.GenericDeploymentTool.checkAndAddDependants Hashtable  checkEntries  )  throws BuildException [protected]
 

Add all available classes, that depend on Remote, Home, Bean, PK

Parameters:
checkEntries files, that are extracted from the deployment descriptor

Definition at line 854 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.GenericDeploymentTool.log().

Here is the call graph for this function:

void org.objectweb.jonas.ant.GenericDeploymentTool.checkConfiguration String  descriptorFileName,
SAXParser  saxParser
throws BuildException [protected]
 

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.

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
Exceptions:
BuildException Thrown if the configuration is invalid

Reimplemented in org.objectweb.jonas.ant.JonasDeploymentTool.

Definition at line 487 of file GenericDeploymentTool.java.

void org.objectweb.jonas.ant.GenericDeploymentTool.configure EjbJar.Config  config  ) 
 

Configure this tool for use in the ejbjar task.

Parameters:
config the configuration from the surrounding ejbjar task.

Definition at line 305 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.EjbJar.config.

Referenced by org.objectweb.jonas.ant.EjbJar.execute().

Path org.objectweb.jonas.ant.GenericDeploymentTool.createClasspath  ) 
 

Add the classpath for the user classes

Returns:
a Path instance to be configured by Ant.

Definition at line 206 of file GenericDeploymentTool.java.

Referenced by org.objectweb.jonas.ant.JonasDeploymentTool.setClasspathref().

ClassLoader org.objectweb.jonas.ant.GenericDeploymentTool.getClassLoaderForBuild  )  [protected]
 

Returns a Classloader object which parses the passed in generic EjbJar classpath. The loader is used to dynamically load classes from javax.ejb.* and the classes being added to the jar.

Definition at line 898 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.GenericDeploymentTool.getCombinedClasspath(), and org.objectweb.jonas.ant.GenericDeploymentTool.getTask().

Here is the call graph for this function:

Path org.objectweb.jonas.ant.GenericDeploymentTool.getCombinedClasspath  )  [protected]
 

Get the classpath by combining the one from the surrounding task, if any and the one from this tool.

Returns:
the combined classpath

Definition at line 228 of file GenericDeploymentTool.java.

Referenced by org.objectweb.jonas.ant.GenericDeploymentTool.getClassLoaderForBuild().

EjbJar.Config org.objectweb.jonas.ant.GenericDeploymentTool.getConfig  )  [protected]
 

Get the basename terminator.

Returns:
an ejbjar task configuration

Definition at line 179 of file GenericDeploymentTool.java.

Referenced by org.objectweb.jonas.ant.JonasDeploymentTool.addVendorFiles(), org.objectweb.jonas.ant.JonasDeploymentTool.getJarBaseName(), and org.objectweb.jonas.ant.GenericDeploymentTool.getManifestFile().

File org.objectweb.jonas.ant.GenericDeploymentTool.getDestDir  )  [protected]
 

Get the destination directory.

Returns:
the destination directory into which EJB jars are to be written

Definition at line 151 of file GenericDeploymentTool.java.

Referenced by org.objectweb.jonas.ant.JonasDeploymentTool.getVendorOutputJarFile().

String org.objectweb.jonas.ant.GenericDeploymentTool.getJarBaseName String  descriptorFileName  )  [protected]
 

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.

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

Reimplemented in org.objectweb.jonas.ant.JonasDeploymentTool.

Definition at line 575 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.DescriptorHandler.getEjbName().

Here is the call graph for this function:

Location org.objectweb.jonas.ant.GenericDeploymentTool.getLocation  )  [protected]
 

Get the build file location associated with this element's task.

Returns:
the task's location instance.

Definition at line 256 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.GenericDeploymentTool.getTask().

Referenced by org.objectweb.jonas.ant.GenericDeploymentTool.validateConfigured(), and org.objectweb.jonas.ant.GenericDeploymentTool.writeJar().

Here is the call graph for this function:

File org.objectweb.jonas.ant.GenericDeploymentTool.getManifestFile String  prefix  )  [protected]
 

Get the manifets file to use for building the generic jar.

If the file does not exist the global manifest from the config is used otherwise the default Ant manifest will be used.

Parameters:
prefix the prefix where to llook for the manifest file based on the naming convention.
Returns:
the manifest file or null if the manifest file does not exist

Definition at line 725 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.GenericDeploymentTool.getConfig().

Here is the call graph for this function:

String org.objectweb.jonas.ant.GenericDeploymentTool.getPublicId  )  [protected]
 

Returns the Public ID of the DTD specified in the EJB descriptor. Not every vendor-specific DeploymentTool will need to reference this value or may want to determine this value in a vendor-specific way.

Returns:
Public ID of the DTD specified in the EJB descriptor.

Definition at line 710 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.DescriptorHandler.getPublicId().

Here is the call graph for this function:

Task org.objectweb.jonas.ant.GenericDeploymentTool.getTask  )  [protected]
 

Get the task for this tool.

Returns:
the Task instance this tool is associated with.

Definition at line 170 of file GenericDeploymentTool.java.

Referenced by org.objectweb.jonas.ant.GenericDeploymentTool.getClassLoaderForBuild(), org.objectweb.jonas.ant.GenericDeploymentTool.getLocation(), and org.objectweb.jonas.ant.GenericDeploymentTool.log().

String org.objectweb.jonas.ant.GenericDeploymentTool.getVendorDDPrefix String  baseName,
String  descriptorFileName
 

Get the prefix for vendor deployment descriptors.

This will contain the path and the start of the descriptor name, depending on the naming scheme

Definition at line 630 of file GenericDeploymentTool.java.

File org.objectweb.jonas.ant.GenericDeploymentTool.getVendorOutputJarFile String  baseName  )  [package]
 

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.

Reimplemented in org.objectweb.jonas.ant.JonasDeploymentTool.

Definition at line 662 of file GenericDeploymentTool.java.

void org.objectweb.jonas.ant.GenericDeploymentTool.log String  message,
int  level
[protected]
 

Log a message to the Ant output.

Parameters:
message the message to be logged.
level the severity of this message.

Definition at line 247 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.GenericDeploymentTool.getTask().

Referenced by org.objectweb.jonas.ant.GenericDeploymentTool.addFileToJar(), org.objectweb.jonas.ant.JonasDeploymentTool.addVendorFiles(), org.objectweb.jonas.ant.GenericDeploymentTool.checkAndAddDependants(), org.objectweb.jonas.ant.JonasDeploymentTool.getJarBaseName(), org.objectweb.jonas.ant.GenericDeploymentTool.needToRebuild(), org.objectweb.jonas.ant.JonasDeploymentTool.setMappernames(), org.objectweb.jonas.ant.JonasDeploymentTool.writeJar(), and org.objectweb.jonas.ant.GenericDeploymentTool.writeJar().

Here is the call graph for this function:

boolean org.objectweb.jonas.ant.GenericDeploymentTool.needToRebuild Hashtable  ejbFiles,
File  jarFile
[protected]
 

This method checks the timestamp on each file listed in the ejbFiles and compares them to the timestamp on the jarFile . If the jarFile's timestamp is more recent than each EJB file, true is returned. Otherwise, false is returned. TODO: find a way to check the manifest-file, that is found by naming convention

Parameters:
ejbFiles Hashtable of EJB classes (and other) files that will be added to the completed JAR file
jarFile JAR file which will contain all of the EJB classes (and other) files
Returns:
boolean indicating whether or not the jarFile is up to date

Definition at line 681 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.GenericDeploymentTool.log().

Here is the call graph for this function:

Hashtable org.objectweb.jonas.ant.GenericDeploymentTool.parseEjbFiles String  descriptorFileName,
SAXParser  saxParser
throws IOException, SAXException [protected]
 

This method returns a list of EJB files found when the specified EJB descriptor is parsed and processed.

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
Returns:
Hashtable of EJB class (and other) files to be added to the completed JAR file
Exceptions:
SAXException Any SAX exception, possibly wrapping another exception
IOException An IOException from the parser, possibly from a the byte stream or character stream

Definition at line 512 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.DescriptorHandler.getFiles().

Here is the call graph for this function:

void org.objectweb.jonas.ant.GenericDeploymentTool.registerKnownDTDs DescriptorHandler  handler  )  [protected]
 

Register the locations of all known DTDs.

vendor-specific subclasses should override this method to define the vendor-specific locations of the EJB DTDs

Reimplemented in org.objectweb.jonas.ant.JonasDeploymentTool.

Definition at line 384 of file GenericDeploymentTool.java.

void org.objectweb.jonas.ant.GenericDeploymentTool.setClasspath Path  classpath  ) 
 

Set the classpath to be used for this compilation.

Parameters:
classpath the classpath to be used for this build.

Definition at line 218 of file GenericDeploymentTool.java.

void org.objectweb.jonas.ant.GenericDeploymentTool.setDestdir File  inDir  ) 
 

Set the destination directory; required.

Parameters:
inDir the destination directory.

Definition at line 142 of file GenericDeploymentTool.java.

Referenced by org.objectweb.jonas.ant.EjbJar.execute().

void org.objectweb.jonas.ant.GenericDeploymentTool.setGenericJarSuffix String  inString  ) 
 

Set the suffix for the generated jar file.

Parameters:
inString the string to use as the suffix.

Definition at line 197 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.EjbJar.genericJarSuffix.

Referenced by org.objectweb.jonas.ant.EjbJar.execute().

void org.objectweb.jonas.ant.GenericDeploymentTool.setTask Task  task  ) 
 

Set the task which owns this tool

Parameters:
task the Task to which this deployment tool is associated.

Definition at line 161 of file GenericDeploymentTool.java.

Referenced by org.objectweb.jonas.ant.EjbJar.execute().

boolean org.objectweb.jonas.ant.GenericDeploymentTool.usingBaseJarName  )  [protected]
 

Indicate if this build is using the base jar name.

Returns:
true if the name of the generated jar is coming from the basejarname attribute

Definition at line 189 of file GenericDeploymentTool.java.

void org.objectweb.jonas.ant.GenericDeploymentTool.validateConfigured  )  throws BuildException
 

Called to validate that the tool parameters have been configured.

Exceptions:
BuildException If the Deployment Tool's configuration isn't valid

Definition at line 922 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.GenericDeploymentTool.getLocation().

Referenced by org.objectweb.jonas.ant.EjbJar.execute().

Here is the call graph for this function:

void org.objectweb.jonas.ant.GenericDeploymentTool.writeJar String  baseName,
File  jarfile,
Hashtable  files,
String  publicId,
boolean  includeInnerClasses
throws BuildException [protected]
 

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.

Parameters:
includeInnerClasses if true, include inner classes

Reimplemented in org.objectweb.jonas.ant.JonasDeploymentTool.

Definition at line 744 of file GenericDeploymentTool.java.

References org.objectweb.jonas.ant.GenericDeploymentTool.addFileToJar(), org.objectweb.jonas.ant.GenericDeploymentTool.getLocation(), org.objectweb.jonas.ant.GenericDeploymentTool.log(), and org.objectweb.jonas.ant.GenericDeploymentTool.MANIFEST.

Here is the call graph for this function:


Member Data Documentation

final String org.objectweb.jonas.ant.GenericDeploymentTool.ANALYZER_CLASS_FULL = "org.apache.tools.ant.util.depend.bcel.FullAnalyzer" [static]
 

The analyzer class for the super analyzer

Definition at line 88 of file GenericDeploymentTool.java.

final String org.objectweb.jonas.ant.GenericDeploymentTool.ANALYZER_CLASS_SUPER = "org.apache.tools.ant.util.depend.bcel.AncestorAnalyzer" [static]
 

The analyzer class for the super analyzer

Definition at line 85 of file GenericDeploymentTool.java.

final String org.objectweb.jonas.ant.GenericDeploymentTool.ANALYZER_FULL = "full" [static]
 

A dependency analyzer name to find all related classes

Definition at line 76 of file GenericDeploymentTool.java.

final String org.objectweb.jonas.ant.GenericDeploymentTool.ANALYZER_NONE = "none" [static]
 

A dependency analyzer name for no analyzer

Definition at line 78 of file GenericDeploymentTool.java.

final String org.objectweb.jonas.ant.GenericDeploymentTool.ANALYZER_SUPER = "super" [static]
 

A dependency analyzer name to find ancestor classes

Definition at line 74 of file GenericDeploymentTool.java.

final String org.objectweb.jonas.ant.GenericDeploymentTool.DEFAULT_ANALYZER = ANALYZER_SUPER [static]
 

The default analyzer

Definition at line 81 of file GenericDeploymentTool.java.

final String org.objectweb.jonas.ant.GenericDeploymentTool.EJB_DD = "ejb-jar.xml" [static, protected]
 

Name for EJB Deployment descriptor within EJB jars

Definition at line 71 of file GenericDeploymentTool.java.

final String org.objectweb.jonas.ant.GenericDeploymentTool.MANIFEST = META_DIR + "MANIFEST.MF" [static, protected]
 

The standard MANIFEST file

Definition at line 68 of file GenericDeploymentTool.java.

Referenced by org.objectweb.jonas.ant.GenericDeploymentTool.writeJar().

final String org.objectweb.jonas.ant.GenericDeploymentTool.META_DIR = "META-INF/" [static, protected]
 

The standard META-INF directory in jar files

Definition at line 65 of file GenericDeploymentTool.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:06:11 2005 for JOnAS by  doxygen 1.3.9.1