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

Class IPlanetDeploymentTool

public class IPlanetDeploymentTool extends GenericDeploymentTool

This class is used to generate iPlanet Application Server (iAS) 6.0 stubs and skeletons and build an EJB Jar file. It is designed to be used with the Ant ejbjar task. If only stubs and skeletons need to be generated (in other words, if no JAR file needs to be created), refer to the iplanet-ejbc task and the IPlanetEjbcTask class.

The following attributes may be specified by the user:

For each EJB descriptor found in the "ejbjar" parent task, this deployment tool will locate the three classes that comprise the EJB. If these class files cannot be located in the specified srcdir directory, the task will fail. The task will also attempt to locate the EJB stubs and skeletons in this directory. If found, the timestamps on the stubs and skeletons will be checked to ensure they are up to date. Only if these files cannot be found or if they are out of date will ejbc be called.

See Also: IPlanetEjbc

Method Summary
protected voidaddVendorFiles(Hashtable ejbFiles, String ddPrefix)
Add the iAS-specific EJB descriptor to the list of files which will be written to the JAR file.
protected voidcheckConfiguration(String descriptorFileName, SAXParser saxParser)
Verifies that the user selections are valid.
protected StringgetPublicId()
The iAS ejbc utility doesn't require the Public ID of the descriptor's DTD for it to process correctly--this method always returns null .
protected HashtableparseEjbFiles(String descriptorFileName, SAXParser saxParser)
This method returns a list of EJB files found when the specified EJB descriptor is parsed and processed.
voidprocessDescriptor(String descriptorName, SAXParser saxParser)
{@inheritDoc}.
voidsetDebug(boolean debug)
Sets whether or not debugging output will be generated when ejbc is executed.
voidsetGenericJarSuffix(String inString)
Since iAS doesn't generate a "generic" JAR as part of its processing, this attribute is ignored and a warning message is displayed to the user.
voidsetIashome(File iashome)
Setter method used to store the "home" directory of the user's iAS installation.
voidsetKeepgenerated(boolean keepgenerated)
Setter method used to specify whether the Java source files generated by the ejbc utility should be saved or automatically deleted.
voidsetSuffix(String jarSuffix)
Setter method used to specify the filename suffix (for example, ".jar") for the JAR files to be created.

Method Detail

addVendorFiles

protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix)
Add the iAS-specific EJB descriptor to the list of files which will be written to the JAR file.

Parameters: ejbFiles Hashtable of EJB class (and other) files to be added to the completed JAR file. ddPrefix not used

checkConfiguration

protected void checkConfiguration(String descriptorFileName, SAXParser saxParser)
Verifies that the user selections are valid.

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 If the user selections are invalid.

getPublicId

protected String getPublicId()
The iAS ejbc utility doesn't require the Public ID of the descriptor's DTD for it to process correctly--this method always returns null .

Returns: null.

parseEjbFiles

protected Hashtable parseEjbFiles(String descriptorFileName, SAXParser saxParser)
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

Throws: IOException An IOException from the parser, possibly from the byte stream or character stream SAXException Any SAX exception, possibly wrapping another exception

processDescriptor

public void processDescriptor(String descriptorName, SAXParser saxParser)
{@inheritDoc}.

setDebug

public void setDebug(boolean debug)
Sets whether or not debugging output will be generated when ejbc is executed.

Parameters: debug A boolean indicating if debugging output should be generated

setGenericJarSuffix

public void setGenericJarSuffix(String inString)
Since iAS doesn't generate a "generic" JAR as part of its processing, this attribute is ignored and a warning message is displayed to the user.

Parameters: inString the string to use as the suffix. This parameter is ignored.

setIashome

public void setIashome(File iashome)
Setter method used to store the "home" directory of the user's iAS installation. The directory specified should typically be [install-location]/iplanet/ias6/ias.

Parameters: iashome The home directory for the user's iAS installation.

setKeepgenerated

public void setKeepgenerated(boolean keepgenerated)
Setter method used to specify whether the Java source files generated by the ejbc utility should be saved or automatically deleted.

Parameters: keepgenerated boolean which, if true, indicates that Java source files generated by ejbc for the stubs and skeletons should be kept.

setSuffix

public void setSuffix(String jarSuffix)
Setter method used to specify the filename suffix (for example, ".jar") for the JAR files to be created.

Parameters: jarSuffix The string to use as the JAR filename suffix.