|
- <html>
-
- <head>
- <meta http-equiv="Content-Language" content="en-us">
- <title>Ant EJB Tasks</title>
-
- </head>
-
- <body>
-
- <h1>Ant EJB Tasks User Manual</h1>
- <p>by</p>
- <!-- Names are in alphabetical order, on last name -->
- <ul>
- <li>Conor MacNeill (<a href="mailto:conor@cortexebusiness.com.au">conor@cortexebusiness.com.au</a>)</li>
- </ul>
-
- <p>Version 1.1 - 2000/07/18</p>
- <hr>
- <h2>Table of Contents</h2>
- <ul>
- <li><a href="#introduction">Introduction</a></li>
- <li><a href="#ejbtasks">EJB Tasks</a></li>
- </ul>
-
- <hr>
- <h2><a name="introduction">Introduction</a></h2>
- <p>Ant provides a number of optional tasks for developing
- <a href="http://java.sun.com/products/ejb">Enterprise Java Beans (EJBs)</a>.
- In general these tasks are specific to the particular vendor's EJB Server. At present the tasks support
- <a href="http://www.bea.com">Weblogic</a> 4.5.1 and 5.1 EJB servers. Over time we expect further optional tasks
- to support additional EJB Servers.
-
- <hr>
- <h2><a name="ejbtasks">EJB Tasks</a></h2>
- <table border="1" cellpadding="5">
- <tr><td>Task</td><td>Application Servers</td></tr>
- <tr><td><a href="#ddcreator">ddcreator</a></td><td>Weblogic 4.5</td></tr>
- <tr><td><a href="#ejbc">ejbc</a></td><td>Weblogic 4.5</td></tr>
- <tr><td><a href="#wlrun">wlrun</a></td><td>Weblogic 4.5</td></tr>
- <tr><td><a href="#wlstop">wlstop</a></td><td>Weblogic 4.5</td></tr>
- <tr><td><a href="#ejbjar">ejbjar</a></td><td>Weblogic 5.1</td></tr>
- </table>
-
- <hr>
- <h2><a name="ddcreator">ddcreator</a></h2>
- <h3><b>Description:</b></h3>
- <p>ddcreator will compile a set of Weblogic text-based deployment descriptors into a serialized
- EJB deployment descriptor. The selection of which of the text-based descriptors are to be compiled
- is based on the standard Ant include and exclude selection mechanisms.
-
-
- <h3>Parameters:</h3>
- <table border="1" cellpadding="2" cellspacing="0">
- <tr>
- <td valign="top"><b>Attribute</b></td>
- <td valign="top"><b>Description</b></td>
- <td align="center" valign="top"><b>Required</b></td>
- </tr>
- <tr>
- <td valign="top">descriptors</td>
- <td valign="top">This is the base directory from which descriptors are selected.</td>
- <td valign="top" align="center">Yes</td>
- </tr>
- <tr>
- <td valign="top">dest</td>
- <td valign="top">The directory where the serialised deployment descriptors will be written</td>
- <td valign="top" align="center">Yes</td>
- </tr>
- <tr>
- <td valign="top">classpath</td>
- <td valign="top">This is the classpath to use to run the underlying weblogic ddcreator tool.
- This must include the <code>weblogic.ejb.utils.DDCreator</code> class</td>
- <td valign="top" align="center">No</td>
- </tr>
- </table>
- <h3>Examples</h3>
- <pre><ddcreator descriptors="${dd.dir}"
- dest="${gen.classes}"
- classpath="${descriptorbuild.classpath}">
- <include name="*.txt" />
- </ddcreator></code>
- </pre>
-
- <hr>
- <h2><a name="ejbc">ejbc</a></h2>
- <h3><b>Description:</b></h3>
- <p>The ejbc task will run Weblogic's ejbc tool. This tool will take a serialised deployment descriptor,
- examine the various EJB interfaces and bean classes and then generate the required support classes
- necessary to deploy the bean in a Weblogic EJB container. This will include the RMI stubs and skeletons
- as well as the classes which implement the bean's home and remote interfaces.
- <p>
- The ant task which runs this tool is able to compile several beans in a single operation. The beans to be
- compiled are selected by including their serialised deployment descriptors. The standard ant
- <code>include</code> and <code>exclude</code> constructs can be used to select the deployment descriptors
- to be included.
- <p>
- Each descriptor is examined to determiune whether the generated classes are out of date and need to be
- regenerated. The deployment descriptor is de-serialized to discover the home, remote and
- implementation classes. The corresponding source files are determined and checked to see their
- modification times. These times and the modification time of the serialised descriptor itself are
- compared with the modification time of the generated classes. If the generated classes are not present
- or are out of date, the ejbc tool is run to generate new versions.
- <h3>Parameters:</h3>
- <table border="1" cellpadding="2" cellspacing="0">
- <tr>
- <td valign="top"><b>Attribute</b></td>
- <td valign="top"><b>Description</b></td>
- <td align="center" valign="top"><b>Required</b></td>
- </tr>
- <tr>
- <td valign="top">descriptors</td>
- <td valign="top">This is the base directory from which the serialised deployment descriptors are selected.</td>
- <td valign="top" align="center">Yes</td>
- </tr>
- <tr>
- <td valign="top">dest</td>
- <td valign="top">The base directory where the generated classes, RIM stubs and RMI skeletons are written</td>
- <td valign="top" align="center">Yes</td>
- </tr>
- <tr>
- <td valign="top">manifest</td>
- <td valign="top">The name of a manifest file to be written. This manifest will contain an entry for each EJB processed</td>
- <td valign="top" align="center">Yes</td>
- </tr>
- <tr>
- <td valign="top">src</td>
- <td valign="top">The base directory of the source tree containing the source files of the home interface,
- remote interface and bean implementation classes.</td>
- <td valign="top" align="center">Yes</td>
- </tr>
- <tr>
- <td valign="top">classpath</td>
- <td valign="top">This classpath must include both the <code>weblogic.ejbc</code> class and the
- classfiles of the bean, home interface, remote interface, etc of the bean being
- processed.</td>
- <td valign="top" align="center">No</td>
- </tr>
- </table>
- <h3>Examples</h3>
- <pre><ejbc descriptors="${gen.classes}"
- src="${src.dir}"
- dest="${gen.classes}"
- manifest="${build.manifest}"
- classpath="${descriptorbuild.classpath}">
- <include name="*.ser" />
- </ejbc></code>
- </pre>
-
- <hr>
- <h2><a name="wlrun">wlrun</a></h2>
- <h3><b>Description:</b></h3>
- <p>This is an experimental task and is not currently documented.
-
- <hr>
- <h2><a name="wlstop">wlstop</a></h2>
- <h3><b>Description:</b></h3>
- <p>This is an experimental task and is not currently documented.
-
- <hr>
- <h2><a name="ejbjar">ejbjar</a></h2>
- <h3><b>Description:</b></h3>
- <p>This task is designed to support building of arbitrary EJB1.1 jar files. Support is currently
- provided for 'vanilla' EJB1.1 jar files - i.e. those containing only the user generated class
- files and the standard deployment descriptor, as well as for WebLogic 5.1 jar files.</p>
-
- <p>The task works as a directory scanning task, and performs an action for each deployment descriptor
- found. As such the includes and excludes should be set to ensure that all desired EJB1.1
- descriptors are found, but no application server descriptors are found. For each descriptor
- found, ejbjar will parse the deployment descriptor to determine the necessary class files to
- include and assemble those files and necessary deployment descriptors into a well formed EJB
- jar file. If generateweblogic is set to true, weblogic.ejbc is then invoked (in VM) to create
- the WebLogic jar file.</p>
-
- <p>In order to locate the WebLogic deployment descriptors for each jar file, certain naming
- conventions are assumed. For the purpose of this document we will assume a basenameterminator
- of '-' (see below for how to specify this option). If you have a deployment descriptor called
- FooBean-ejb-jar.xml, the basename will be taken as FooBean, the string up to the basenameterminator.
- Descriptors will then be searched for called FooBean-weblogic-ejb-jar.xml and also
- FooBean-weblogic-cmp-rdbms-jar.xml. If generateweblogic is false, neither WebLogic descriptor is
- required, but will still be embedded if found. If generateweblogic is true, only
- FooBean-weblogic-ejb-jar.xml is required, but again, both will be embedded in the jar file if
- they are found.</p>
-
- <p>The jar files are only built if they are out of date. As more than one jar file can be built
- per deployment descriptor, this process works as follows. If generateweblogic is true use the
- modification date of the WebLogic jar file as the jar file modification date, otherwise use the
- modification date of the generic jar file. If the modification timestamp of any of the class
- files or deployment descriptors is later than the selected jar file's, a build is executed,
- otherwise a message is logged that the jar file is up to date.</p>
-
- <h3>Parameters:</h3>
- <table border="1" cellpadding="2" cellspacing="0">
- <tr>
- <td valign="top"><b>Attribute</b></td>
- <td valign="top"><b>Description</b></td>
- <td align="center" valign="top"><b>Required</b></td>
- </tr>
- <tr>
- <td valign="top">srcdir</td>
- <td valign="top">The base directory under which to scan for EJB deployment descriptors.</td>
- <td valign="top" align="center">Yes</td>
- </tr>
- <tr>
- <td valign="top">destdir</td>
- <td valign="top">The base directory under which generated jar files are deposited. Jar files are deposited in
- directories correpsonding to the package in which their deployment descriptor was found.</td>
- <td valign="top" align="center">Yes</td>
- </tr>
- <tr>
- <td valign="top">generateweblogic</td>
- <td valign="top">Boolean value specifying whether or not ejbc should be invoked to create the weblogic jar file.
- Acceptable values are 'true' and 'false'.</td>
- <td valign="top" align="center">No, defaults to 'false'.</td>
- </tr>
- <tr>
- <td valign="top">keepgeneric</td>
- <td valign="top">Boolean value specifying whether or not to keep the generic EJB1.1 jar files created. If you are
- only interested in the generated WebLogic jar files, set this to false to remove the temporary
- jar files created. Acceptable values are 'true' and 'false'.</td>
- <td valign="top" align="center">No, defaults to 'true'.</td>
- </tr>
- <tr>
- <td valign="top">basenameterminator</td>
- <td valign="top">String value used to substring out a string from the name of each deployment descriptor found,
- which is then used to locate related deployment descriptors (e.g. the WebLogic descriptors).
- For example, a basename of '.' and a deployment descriptor called 'FooBean.ejb-jar.xml' would
- result in a basename of 'FooBean' which would then be used to find FooBean.weblogic-ejb-jar.xml
- and FooBean.weblogic-cmp-rdbms-jar.xml, as well as to create the filenames of the jar files as
- FooBean-generic.jar and FooBean-wl.jar.</td>
- <td valign="top" align="center">No, defaults to '-'.</td>
- </tr>
- <tr>
- <td valign="top">genericjarsuffix</td>
- <td valign="top">String value appended to the basename of the deployment descriptor to create the filename of the
- generic EJB jar file.</td>
- <td valign="top" align="center">No, defaults to '-generic.jar'.</td>
- </tr>
- <tr>
- <td valign="top">weblogicjarsuffix</td>
- <td valign="top">String value appended to the basename of the deployment descriptor to create the filename of the
- WebLogic EJB jar file.</td>
- <td valign="top" align="center">No, defaults to '-wl.jar'.</td>
- </tr>
- </table>
-
- <h3>Examples</h3>
- <pre>
- <ejbjar srcdir="classes"
- destdir="classes"
- generateweblogic="true"
- keepgeneric="false"
- genericjarsuffix="-temp.jar"
- weblogicjarsuffix=".jar">
- <include name="**/*-ejb-jar.xml"/>
- <exclude name="**/*weblogic*.xml"/>
- </ejbjar>
- </pre>
- </body>
-
- </html>
-
|