source: other-projects/trunk/realistic-books/packages/AntInstaller/web/manual1.7.0/manual/OptionalTasks/ejb.html@ 19253

Last change on this file since 19253 was 19253, checked in by davidb, 15 years ago

Establishing a source code repository for Veronica's Realistic Book's software

File size: 74.5 KB
Line 
1<!--
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<html>
18
19<head>
20<meta http-equiv="Content-Language" content="en-us">
21<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
22<title>EJB Tasks</title>
23
24</head>
25
26<body>
27
28<h1>Ant EJB Tasks User Manual</h1>
29<p>by</p>
30<!-- Names are in alphabetical order, on last name -->
31<ul>
32 <li>Paul Austin (<a href="mailto:[email protected]">[email protected]</a>)</li>
33 <li>Holger Engels (<a href="mailto:[email protected]">[email protected]</a>)</li>
34 <li>Tim Fennell (<a href="mailto:[email protected]">[email protected]</a>)</li>
35 <li>Martin Gee (<a href="mailto:[email protected]">[email protected]</a>)</li>
36 <li>Conor MacNeill</li>
37 <li>Cyrille Morvan (<a href="mailto:[email protected]">[email protected]</a>)</li>
38 <li>Greg Nelson (<a href="mailto:[email protected]">[email protected]</a>)</li>
39 <li>Rob van Oostrum(<a href="mailto:[email protected]">[email protected]</a>)</li>
40</ul>
41
42<hr>
43<h2>Table of Contents</h2>
44<ul>
45 <li><a href="#introduction">Introduction</a></li>
46 <li><a href="#ejbtasks">EJB Tasks</a></li>
47</ul>
48
49<hr>
50<h2><a name="introduction">Introduction</a></h2>
51<p>Ant provides a number of optional tasks for developing 1.x and 2.x
52<a href="http://java.sun.com/products/ejb" target="_top">Enterprise Java Beans (EJBs)</a>.
53In general these tasks are specific to the particular vendor's EJB Server.</p>
54
55<p> The tasks support:<br>
56
57<ul>
58 <li><a href="http://www.borland.com">Borland </a>
59 Application Server 4.5</li>
60 <li><a href="http://www.iplanet.com">iPlanet </a>
61 Application Server 6.0</li>
62 <li><a href="http://www.jboss.org/" target="_top">
63 JBoss 2.1</a> and above EJB servers</li>
64 <li><a href="http://www.bea.com" target="_top">Weblogic</a>
65 4.5.1 through to 7.0 EJB servers</li>
66 <li><a href="http://www.objectweb.org/jonas/" target="_top">JOnAS</a>
67 2.4.x and 2.5 Open Source EJB server</li>
68 <li><a href="http://www.ibm.com/websphere">IBM WebSphere</a> 4.0</li>
69</ul>
70 Vendors such as BEA and IBM now provide custom Ant tasks to work with their
71 particular products. More importantly, EJB3.0 renders this whole process obsolete.
72 Accordingly, developement of these tasks is effectively frozen. Bug reports
73 and especially patches are welcome, but there is no pressing need to add
74 support for new application servers. Nobody should be writing new EJB2.x applications
75 and definitely not new EJB2.x servers.
76</p>
77
78<hr>
79<h2><a name="ejbtasks">EJB Tasks</a></h2>
80<table border="1" cellpadding="2" cellspacing="0">
81 <tr><td>Task</td><td colspan="2">Application Servers</td></tr>
82 <tr><td><a href="BorlandGenerateClient.html">blgenclient</a></td><td colspan="2">Borland Application Server 4.5 and 5.x</td></tr>
83 <tr><td><a href="#ddcreator">ddcreator</a></td><td colspan="2">Weblogic 4.5.1</td></tr>
84 <tr><td><a href="#ejbc">ejbc</a></td><td colspan="2">Weblogic 4.5.1</td></tr>
85 <tr><td><a href="#iplanet-ejbc">iplanet-ejbc</a></td><td colspan="2">iPlanet Application Server 6.0</td></tr>
86 <tr><td rowspan="7"><a href="#ejbjar">ejbjar</a></td><td colspan="2" align="center"><b>Nested Elements</b></td></tr>
87 <tr><td><a href="BorlandEJBTasks.html">borland</a></td><td>Borland Application Server 4.5 and 5.x</td></tr>
88 <tr><td><a href="#ejbjar_iplanet">iPlanet</a></td><td>iPlanet Application Server 6.0</td></tr>
89 <tr><td><a href="#ejbjar_jboss">jboss</a></td><td>JBoss</td></tr>
90 <tr><td><a href="#ejbjar_jonas">jonas</a></td><td>JOnAS 2.4.x and 2.5</td></tr>
91 <tr><td><a href="#ejbjar_weblogic">weblogic</a></td><td>Weblogic 5.1 to 7.0</td></tr>
92 <tr><td><a href="#ejbjar_websphere">websphere</a></td><td>IBM WebSphere 4.0</td></tr>
93 <tr><td><a href="#wlrun">wlrun</a></td><td colspan="2">Weblogic 4.5.1 to 7.0</td></tr>
94 <tr><td><a href="#wlstop">wlstop</a></td><td colspan="2">Weblogic 4.5.1 to 7.0</td></tr>
95
96</table>
97
98<hr>
99<h2><a name="ddcreator">ddcreator</a></h2>
100<h3><b>Description:</b></h3>
101<p>ddcreator will compile a set of Weblogic text-based deployment descriptors into a serialized
102EJB deployment descriptor. The selection of which of the text-based descriptors are to be compiled
103is based on the standard Ant include and exclude selection mechanisms.
104</p>
105
106<h3>Parameters:</h3>
107<table border="1" cellpadding="2" cellspacing="0">
108 <tr>
109 <td valign="top"><b>Attribute</b></td>
110 <td valign="top"><b>Description</b></td>
111 <td align="center" valign="top"><b>Required</b></td>
112 </tr>
113 <tr>
114 <td valign="top">descriptors</td>
115 <td valign="top">This is the base directory from which descriptors are selected.</td>
116 <td valign="top" align="center">Yes</td>
117 </tr>
118 <tr>
119 <td valign="top">dest</td>
120 <td valign="top">The directory where the serialized deployment descriptors will be written</td>
121 <td valign="top" align="center">Yes</td>
122 </tr>
123 <tr>
124 <td valign="top">classpath</td>
125 <td valign="top">This is the classpath to use to run the underlying weblogic ddcreator tool.
126 This must include the <code>weblogic.ejb.utils.DDCreator</code> class</td>
127 <td valign="top" align="center">No</td>
128 </tr>
129</table>
130<h3>Examples</h3>
131<pre>
132&lt;ddcreator descriptors=&quot;${dd.dir}&quot;
133 dest=&quot;${gen.classes}&quot;
134 classpath=&quot;${descriptorbuild.classpath}&quot;&gt;
135 &lt;include name=&quot;*.txt&quot;/&gt;
136&lt;/ddcreator&gt;
137</pre>
138
139<hr>
140<h2><a name="ejbc">ejbc</a></h2>
141<h3><b>Description:</b></h3>
142<p>The ejbc task will run Weblogic's ejbc tool. This tool will take a serialized deployment descriptor,
143examine the various EJB interfaces and bean classes and then generate the required support classes
144necessary to deploy the bean in a Weblogic EJB container. This will include the RMI stubs and skeletons
145as well as the classes which implement the bean's home and remote interfaces.</p>
146<p>
147The ant task which runs this tool is able to compile several beans in a single operation. The beans to be
148compiled are selected by including their serialized deployment descriptors. The standard ant
149<code>include</code> and <code>exclude</code> constructs can be used to select the deployment descriptors
150to be included. </p>
151<p>
152Each descriptor is examined to determine whether the generated classes are out of date and need to be
153regenerated. The deployment descriptor is de-serialized to discover the home, remote and
154implementation classes. The corresponding source files are determined and checked to see their
155modification times. These times and the modification time of the serialized descriptor itself are
156compared with the modification time of the generated classes. If the generated classes are not present
157or are out of date, the ejbc tool is run to generate new versions.</p>
158<h3>Parameters:</h3>
159<table border="1" cellpadding="2" cellspacing="0">
160 <tr>
161 <td valign="top"><b>Attribute</b></td>
162 <td valign="top"><b>Description</b></td>
163 <td align="center" valign="top"><b>Required</b></td>
164 </tr>
165 <tr>
166 <td valign="top">descriptors</td>
167 <td valign="top">This is the base directory from which the serialized deployment descriptors are selected.</td>
168 <td valign="top" align="center">Yes</td>
169 </tr>
170 <tr>
171 <td valign="top">dest</td>
172 <td valign="top">The base directory where the generated classes, RIM stubs and RMI skeletons are written</td>
173 <td valign="top" align="center">Yes</td>
174 </tr>
175 <tr>
176 <td valign="top">manifest</td>
177 <td valign="top">The name of a manifest file to be written. This manifest will contain an entry for each EJB processed</td>
178 <td valign="top" align="center">Yes</td>
179 </tr>
180 <tr>
181 <td valign="top">src</td>
182 <td valign="top">The base directory of the source tree containing the source files of the home interface,
183 remote interface and bean implementation classes.</td>
184 <td valign="top" align="center">Yes</td>
185 </tr>
186 <tr>
187 <td valign="top">classpath</td>
188 <td valign="top">This classpath must include both the <code>weblogic.ejbc</code> class and the
189 class files of the bean, home interface, remote interface, etc of the bean being
190 processed.</td>
191 <td valign="top" align="center">No</td>
192 </tr>
193 <tr>
194 <td valign="top">keepgenerated</td>
195 <td>Controls whether ejbc will keep the
196 intermediate Java files used to build the class files. This can be
197 useful when debugging.</td>
198 <td>No, defaults to false.</td>
199 </tr>
200</table>
201<h3>Examples</h3>
202<pre>
203&lt;ejbc descriptors=&quot;${gen.classes}&quot;
204 src=&quot;${src.dir}&quot;
205 dest=&quot;${gen.classes}&quot;
206 manifest=&quot;${build.manifest}&quot;
207 classpath=&quot;${descriptorbuild.classpath}&quot;&gt;
208 &lt;include name=&quot;*.ser&quot;/&gt;
209&lt;/ejbc&gt;
210</pre>
211
212<hr>
213<h2>
214<a NAME="iplanet-ejbc"></a>iplanet-ejbc</h2>
215
216<h3>
217<b>Description:</b></h3>
218Task to compile EJB stubs and skeletons for the iPlanet Application Server
2196.0. Given a standard EJB 1.1 XML descriptor as well as an iAS-specific
220EJB descriptor, this task will generate the stubs and skeletons required
221to deploy the EJB to iAS. Since the XML descriptors can include multiple
222EJBs, this is a convenient way of specifying many EJBs in a single Ant
223task.
224<p>For each EJB specified, the task will locate the three classes that
225comprise the EJB in the destination directory. If these class files
226cannot be located in the destination directory, the task will fail. The
227task will also attempt to locate the EJB stubs and skeletons in this directory.
228If found, the timestamps on the stubs and skeletons will be checked to
229ensure they are up to date. Only if these files cannot be found or if they
230are out of date will the iAS ejbc utility be called to generate new stubs
231and skeletons.</p>
232<h3>
233Parameters:</h3>
234
235<table border="1" cellspacing="0" cellpadding="2">
236<tr>
237<td valign="top"><b>Attribute</b></td>
238
239<td valign="top"><b>Description</b></td>
240
241<td align="center" valign="top"><b>Required</b></td>
242</tr>
243
244<tr>
245<td valign="top">ejbdescriptor</td>
246
247<td valign="top">Standard EJB 1.1 XML descriptor (typically titled "ejb-jar.xml").</td>
248
249<td align="center" valign="top">Yes</td>
250</tr>
251
252<tr>
253<td valign="top">iasdescriptor</td>
254
255<td valign="top">iAS-specific EJB XML descriptor (typically titled "ias-ejb-jar.xml").</td>
256
257<td align="center" valign="top">Yes</td>
258</tr>
259
260<tr>
261<td valign="top">dest</td>
262
263<td valign="top">The is the base directory where the RMI stubs and skeletons
264are written. In addition, the class files for each bean (home interface,
265remote interface, and EJB implementation) must be found in this directory.</td>
266
267<td align="center" valign="top">Yes</td>
268</tr>
269
270<tr>
271<td valign="top">classpath</td>
272
273<td valign="top">The classpath used when generating EJB stubs and skeletons.
274If omitted, the classpath specified when Ant was started will be used.
275Nested "classpath" elements may also be used.</td>
276
277<td align="center" valign="top">No</td>
278</tr>
279
280<tr>
281<td valign="top">keepgenerated</td>
282
283<td valign="top">Indicates whether or not the Java source files which are
284generated by ejbc will be saved or automatically deleted. If "yes", the
285source files will be retained. If omitted, it defaults to "no". </td>
286
287<td align="center" valign="top">No</td>
288</tr>
289
290<tr>
291<td valign="top">debug</td>
292
293<td>Indicates whether or not the ejbc utility should log additional debugging
294statements to the standard output. If "yes", the additional debugging statements
295will be generated. If omitted, it defaults to "no". </td>
296
297<td align="center" valign="top">
298<center>No</center>
299</td>
300</tr>
301
302<tr>
303<td valign="top">iashome</td>
304
305<td>May be used to specify the "home" directory for this iAS installation.
306This is used to find the ejbc utility if it isn't included in the user's
307system path. If specified, it should refer to the "[install-location]/iplanet/ias6/ias"
308directory. If omitted, the ejbc utility must be on the user's system path. </td>
309
310<td align="center" valign="top">No</td>
311</tr>
312</table>
313
314<h3>
315Examples</h3>
316
317<pre>
318&lt;iplanet-ejbc ejbdescriptor="ejb-jar.xml"
319 iasdescriptor="ias-ejb-jar.xml"
320 dest="${build.classesdir}"
321 classpath="${ias.ejbc.cpath}"/&gt;
322
323
324&lt;iplanet-ejbc ejbdescriptor="ejb-jar.xml"
325 iasdescriptor="ias-ejb-jar.xml"
326 dest="${build.classesdir}"
327 keepgenerated="yes"
328 debug="yes"
329 iashome="${ias.home}"&gt;
330 &lt;classpath&gt;
331 &lt;pathelement path="."/&gt;
332 &lt;pathelement path="${build.classpath}"/&gt;
333 &lt;/classpath&gt;
334&lt;/iplanet-ejbc&gt;
335
336
337</pre>
338
339<hr>
340<h2><a name="wlrun">wlrun</a></h2>
341<h3><b>Description:</b></h3>
342
343<p>The <code>wlrun</code> task is used to start a weblogic server. The task runs
344a weblogic instance in a separate Java Virtual Machine. A number of parameters
345are used to control the operation of the weblogic instance. Note that the task,
346and hence ant, will not complete until the weblogic instance is stopped.</p>
347
348<h3>Parameters:</h3>
349<table border="1" cellpadding="2" cellspacing="0">
350 <tr>
351 <td valign="top"><b>Attribute</b></td>
352 <td valign="top"><b>Description</b></td>
353 <td align="center" valign="top"><b>Required for 4.5.1 and 5.1</b></td>
354 <td align="center" valign="top"><b>Required for 6.0</b></td>
355 </tr>
356 <tr>
357 <td valign="top">BEA Home</td>
358 <td valign="top">The location of the BEA Home where the server's config is defined.
359 If this attribute is present, wlrun assumes that the server will
360 be running under Weblogic 6.0</td>
361 <td valign="top" align="center">N/A</td>
362 <td valign="top" align="center">Yes</td>
363 </tr>
364 <tr>
365 <td valign="top">home</td>
366 <td valign="top">The location of the weblogic home that is to be used. This is the location
367 where weblogic is installed.</td>
368 <td valign="top" align="center">Yes</td>
369 <td valign="top" align="center">Yes. Note this is the absolute location, not relative to
370 BEA home.</td>
371 </tr>
372 <tr>
373 <td valign="top">Domain</td>
374 <td valign="top">The domain to which the server belongs.</td>
375 <td valign="top" align="center">N/A</td>
376 <td valign="top" align="center">Yes</td>
377 </tr>
378 <tr>
379 <td valign="top">classpath</td>
380 <td valign="top">The classpath to be used with the Java Virtual Machine that runs the Weblogic
381 Server. Prior to Weblogic 6.0, this is typically set to the Weblogic
382 boot classpath. Under Weblogic 6.0 this should include all the
383 weblogic jars</td>
384 <td valign="top" align="center">Yes</td>
385 <td valign="top" align="center">Yes</td>
386 </tr>
387 <tr>
388 <td valign="top">wlclasspath</td>
389 <td valign="top">The weblogic classpath used by the Weblogic Server.</td>
390 <td valign="top" align="center">No</td>
391 <td valign="top" align="center">N/A</td>
392 </tr>
393 <tr>
394 <td valign="top">properties</td>
395 <td valign="top">The name of the server's properties file within the weblogic home directory
396 used to control the weblogic instance.</td>
397 <td valign="top" align="center">Yes</td>
398 <td valign="top" align="center">N/A</td>
399 </tr>
400 <tr>
401 <td valign="top">name</td>
402 <td valign="top">The name of the weblogic server within the weblogic home which is to be run.
403 This defaults to &quot;myserver&quot;</td>
404 <td valign="top" align="center">No</td>
405 <td valign="top" align="center">No</td>
406 </tr>
407 <tr>
408 <td valign="top">policy</td>
409 <td valign="top">The name of the security policy file within the weblogic home directory that
410 is to be used. If not specified, the default policy file <code>weblogic.policy</code>
411 is used.</td>
412 <td valign="top" align="center">No</td>
413 <td valign="top" align="center">No</td>
414 </tr>
415 <tr>
416 <td valign="top">username</td>
417 <td valign="top">The management username used to manage the server</td>
418 <td valign="top" align="center">N/A</td>
419 <td valign="top" align="center">No</td>
420 </tr>
421 <tr>
422 <td valign="top">password</td>
423 <td valign="top">The server's management password</td>
424 <td valign="top" align="center">N/A</td>
425 <td valign="top" align="center">Yes</td>
426 </tr>
427 <tr>
428 <td valign="top">pkPassword</td>
429 <td valign="top">The private key password so the server can decrypt the SSL
430 private key file</td>
431 <td valign="top" align="center">N/A</td>
432 <td valign="top" align="center">No</td>
433 </tr>
434 <tr>
435 <td valign="top">jvmargs</td>
436 <td valign="top">Additional argument string passed to the Java Virtual Machine used to run the
437 Weblogic instance.</td>
438 <td valign="top" align="center">No</td>
439 <td valign="top" align="center">No</td>
440 </tr>
441 <tr>
442 <td valign="top">weblogicMainClass</td>
443 <td valign="top">name of the main class for weblogic</td>
444 <td valign="top" align="center">No</td>
445 <td valign="top" align="center">No</td>
446 </tr>
447</table>
448
449<h3>Nested Elements</h3>
450
451<p>The wlrun task supports nested <code>&lt;classpath&gt;</code> and <code>&lt;wlclasspath&gt;</code>
452elements to set the respective classpaths.</p>
453
454<h3>Examples</h3>
455
456<p>This example shows the use of wlrun to run a server under Weblogic 5.1</p>
457
458<pre>
459 &lt;wlrun taskname=&quot;myserver&quot;
460 classpath=&quot;${weblogic.boot.classpath}&quot;
461 wlclasspath=&quot;${weblogic.classes}:${code.jars}&quot;
462 name=&quot;myserver&quot;
463 home=&quot;${weblogic.home}&quot;
464 properties=&quot;myserver/myserver.properties&quot;/&gt;
465</pre>
466
467<p>This example shows wlrun being used to run the petstore server under
468Weblogic 6.0</p>
469
470<pre>
471 &lt;wlrun taskname=&quot;petstore&quot;
472 classpath=&quot;${weblogic.classes}&quot;
473 name=&quot;petstoreServer&quot;
474 domain=&quot;petstore&quot;
475 home=&quot;${weblogic.home}&quot;
476 password=&quot;petstorePassword&quot;
477 beahome=&quot;${bea.home}&quot;/&gt;
478</pre>
479
480<hr>
481<h2><a name="wlstop">wlstop</a></h2>
482<h3><b>Description:</b></h3>
483
484<p>The <code>wlstop</code> task is used to stop a weblogic instance which is
485currently running. To shut down an instance you must supply both a username and
486a password. These will be stored in the clear in the build script used to stop
487the instance. For security reasons, this task is therefore only appropriate in a
488development environment. </p>
489
490<p>This task works for most version of Weblogic, including 6.0. You need to
491specify the BEA Home to have this task work correctly under 6.0</p>
492
493<h3>Parameters:</h3>
494<table border="1" cellpadding="2" cellspacing="0">
495 <tr>
496 <td valign="top"><b>Attribute</b></td>
497 <td valign="top"><b>Description</b></td>
498 <td align="center" valign="top"><b>Required</b></td>
499 </tr>
500 <tr>
501 <td valign="top">BEAHome</td>
502 <td valign="top">This attribute selects Weblogic 6.0 shutdown.</td>
503 <td valign="top" align="center">No</td>
504 </tr>
505 <tr>
506 <td valign="top">classpath</td>
507 <td valign="top">The classpath to be used with the Java Virtual Machine that runs the Weblogic
508 Shutdown command.</td>
509 <td valign="top" align="center">Yes</td>
510 </tr>
511 <tr>
512 <td valign="top">user</td>
513 <td valign="top">The username of the account which will be used to shutdown the server</td>
514 <td valign="top" align="center">Yes</td>
515 </tr>
516 <tr>
517 <td valign="top">password</td>
518 <td valign="top">The password for the account specified in the user parameter.</td>
519 <td valign="top" align="center">Yes</td>
520 </tr>
521 <tr>
522 <td valign="top">url</td>
523 <td valign="top">The URL which describes the port to which the server is listening for T3 connections.
524 For example, t3://localhost:7001</td>
525 <td valign="top" align="center">Yes</td>
526 </tr>
527 <tr>
528 <td valign="top">delay</td>
529 <td valign="top">The delay in seconds after which the server will stop. This defaults to an
530 immediate shutdown.</td>
531 <td valign="top" align="center">No</td>
532 </tr>
533</table>
534
535<h3>Nested Element</h3>
536
537<p>The classpath of the wlstop task can be set by a <code>&lt;classpath&gt;</code> nested element.</p>
538
539<h3>Examples</h3>
540
541<p>This example show the shutdown for a Weblogic 6.0 server</p>
542
543<pre>
544 &lt;wlstop classpath=&quot;${weblogic.classes}&quot;
545 user=&quot;system&quot;
546 url=&quot;t3://localhost:7001&quot;
547 password=&quot;foobar&quot;
548 beahome=&quot;${bea.home}&quot;/&gt;
549</pre>
550
551<hr>
552
553<h2><a name="ejbjar">ejbjar</a></h2>
554<h3><b>Description:</b></h3>
555
556<p>This task is designed to support building of EJB jar files (EJB 1.1 &amp; 2.0).
557Support is currently provided for 'vanilla' EJB jar files - i.e. those containing only
558the user generated class files and the standard deployment descriptor. Nested
559elements provide support for vendor specific deployment tools. These currently
560include: </p>
561<ul>
562 <li>Borland Application Server 4.5</li>
563 <li>iPlanet Application Server 6.0</li>
564 <li>JBoss 2.1 and above</li>
565 <li>Weblogic 5.1/6.0 session/entity beans using the weblogic.ejbc tool</li>
566 <li>IBM WebSphere 4.0</li>
567 <li>TOPLink for WebLogic 2.5.1-enabled entity beans</li>
568 <li><a href="http://www.objectweb.org/jonas/">JOnAS</a> 2.4.x and 2.5 Open Source EJB server</li>
569</ul>
570
571
572<p>The task works as a directory scanning task, and performs an action for each
573deployment descriptor found. As such the includes and excludes should be set
574to ensure that all desired EJB descriptors are found, but no application
575server descriptors are found. For each descriptor found, ejbjar will parse the
576deployment descriptor to determine the necessary class files which implement the
577bean. These files are assembled along with the deployment descriptors into a
578well formed EJB jar file. Any support files which need to be included in the
579generated jar can be added with the <code>&lt;support&gt;</code> nested element. For each
580class included in the jar, ejbjar will scan for any super classes or super
581interfaces. These will be added to the generated jar.</p>
582
583<p>If no nested vendor-specific deployment elements are present, the task will
584simply generate a generic EJB jar. Such jars are typically used as the input to
585vendor-specific deployment tools. For each nested deployment element, a vendor
586specific deployment tool is run to generate a jar file ready for deployment in
587that vendor's EJB container. </p>
588
589<p>The jar files are only built if they are out of date. Each deployment tool
590element will examine its target jar file and determine if it is out of date with
591respect to the class files and deployment descriptors that make up the bean. If
592any of these files are newer than the jar file the jar will be rebuilt otherwise
593a message is logged that the jar file is up to date.</p>
594
595<p>The task uses the
596<a href="http://jakarta.apache.org/bcel"> jakarta-BCEL </a> framework
597to extract all dependent classes. This
598means that, in addition to the classes that are mentioned in the
599deployment descriptor, any classes that these depend on are also
600automatically included in the jar file.</p>
601
602
603<h3>Naming Convention</h3>
604
605Ejbjar handles the processing of multiple beans, and it uses a set of naming
606conventions to determine the name of the generated EJB jars. The naming convention
607that is used is controlled by the &quot;naming&quot; attribute. It supports the
608following values
609<ul>
610
611<li>descriptor</li>
612<p>This is the default naming scheme. The name of the generated bean is derived from the
613name of the deployment descriptor. For an Account bean, for example, the deployment
614descriptor would be named <code>Account-ejb-jar.xml</code>. Vendor specific descriptors are
615located using the same naming convention. The weblogic bean, for example, would be named
616<code>Account-weblogic-ejb-jar.xml</code>. Under this arrangement, the deployment descriptors
617can be separated from the code implementing the beans, which can be useful when the same bean code
618is deployed in separate beans.
619</p>
620
621<p>This scheme is useful when you are using one bean per EJB jar and where you may be
622deploying the same bean classes in different beans, with different deployment characteristics.
623
624<li>ejb-name</li>
625<p> This naming scheme uses the <code>&lt;ejb-name&gt;</code> element from the deployment descriptor to
626determine the bean name. In this situation, the descriptors normally use the generic
627descriptor names, such as <code>ejb-jar.xml</code> along with any associated vendor specific descriptor
628names. For example, If the value of the <code>&lt;ejb-name&gt;</code> were to be given in the deployment descriptor
629as follows:
630<pre>
631&lt;ejb-jar&gt;
632 &lt;enterprise-beans&gt;
633 &lt;entity&gt;
634 &lt;ejb-name&gt;Sample&lt;/ejb-name&gt;
635 &lt;home&gt;org.apache.ant.ejbsample.SampleHome&lt;/home&gt;
636</pre>
637
638then the name of the generated bean would be <code>Sample.jar</code>
639</p>
640<p> This scheme is useful where you want to use the standard deployment descriptor names, which may be more
641compatible with other EJB tools. This scheme must have one bean per jar.
642</p>
643<li>directory</li>
644<p>
645In this mode, the name of the generated bean jar is derived from the directory
646containing the deployment descriptors. Again the deployment descriptors typically use
647the standard filenames. For example, if the path to the deployment descriptor is
648<code>/home/user/dev/appserver/dd/sample</code>, then the generated
649bean will be named <code>sample.jar</code>
650</p>
651<p>
652This scheme is also useful when you want to use standard style descriptor names. It is often
653most useful when the descriptors are located in the same directory as the bean source code,
654although that is not mandatory. This scheme can handle multiple beans per jar.
655</p>
656
657<li>basejarname</li>
658<p>
659The final scheme supported by the <code>&lt;ejbjar&gt;</code> task is used when you want to specify the generated
660bean jar name directly. In this case the name of the generated jar is specified by the
661&quot;basejarname&quot; attribute. Since all generated beans will have the same name, this task should
662be only used when each descriptor is in its own directory.
663</p>
664
665<p>
666This scheme is most appropriate when you are using multiple beans per jar and only process a single
667deployment descriptor. You typically want to specify the name of the jar and not derive it from the
668beans in the jar.
669</p>
670
671</ul>
672
673<a name="ejbjar_deps"><h3>Dependencies</h3></a>
674<p>In addition to the bean classes, ejbjar is able to ad additional classes to the generated
675ejbjar. These classes are typically the support classes which are used by the bean's classes or as
676parameters to the bean's methods.</p>
677
678<p>In versions of Ant prior to 1.5, ejbjar used reflection and attempted to add the super
679classes and super interfaces of the bean classes. For this technique to work the bean
680classes had to be loaded into Ant's JVM. This was not always possible due to class dependencies.
681</p>
682
683<p>The ejbjar task in Ant releases 1.5 and later uses the
684<a href="http://jakarta.apache.org/bcel"> jakarta-BCEL </a> library
685to analyze the bean's class
686files directly, rather than loading them into the JVM. This also allows ejbjar to add all
687of the required support classes for a bean and not just super classes.
688</p>
689
690<p>In Ant 1.5, a new attribute, <code>dependency</code> has been introduced to allow the
691buildfile to control what additional classes are added to the generated jar. It takes three
692possible values</p>
693<ul>
694<li><code>none</code> - only the bean classes and interfaces described in the bean's
695descriptor are added to the jar.</li>
696<li><code>super</code> - this is the default value and replicates the original ejbjar
697behaviour where super classes and super interfaces are added to the jar</li>
698<li><code>full</code> - In this mode all classes used by the bean's classes and interfaces
699are added to the jar</li>
700</ul>
701<p>The <code>super</code> and <code>full</code> values require the
702<a href="http://jakarta.apache.org/bcel"> jakarta-BCEL </a> library
703to be available. If it is not, ejbjar will drop back to the behaviour corresponding to
704the value <code>none</code>.</p>
705
706<h3>Parameters:</h3>
707<table border="1" cellpadding="2" cellspacing="0">
708 <tr>
709 <td valign="top"><b>Attribute</b></td>
710 <td valign="top"><b>Description</b></td>
711 <td align="center" valign="top"><b>Required</b></td>
712 </tr>
713 <tr>
714 <td valign="top">descriptordir</td>
715 <td valign="top">The base directory under which to scan for EJB
716 deployment descriptors. If this attribute is not
717 specified, then the deployment descriptors must be
718 located in the directory specified by the 'srcdir'
719 attribute.</td>
720 <td valign="top" align="center">No</td>
721 </tr>
722 <tr>
723 <td valign="top">srcdir</td>
724 <td valign="top">The base directory containing the .class files that
725 make up the bean. Included are the home- remote- pk-
726 and implementation- classes and all classes, that these
727 depend on. Note that this can be the same as the
728 descriptordir if all files are in the same directory
729 tree.</td>
730 <td valign="top" align="center">Yes</td>
731 </tr>
732 <tr>
733 <td valign="top">destdir</td>
734 <td valign="top">The base directory into which generated jar files are
735 deposited. Jar files are deposited in directories
736 corresponding to their location within the descriptordir
737 namespace. Note that this attribute is only used if the
738 task is generating generic jars (i.e. no vendor-specific
739 deployment elements have been specified).</td>
740 <td valign="top" align="center">Yes, unless vendor-specific deployment elements
741 have been specified.</td>
742 </tr>
743 <tr>
744 <td valign="top">cmpversion</td>
745 <td valign="top">Either <code>1.0</code> or <code>2.0</code>.<br>
746 Default is <code>1.0</code>.<br>
747 A CMP 2.0 implementation exists currently only for JBoss.</td>
748 <td valign="top" align="center">No</td>
749 </tr>
750 <tr>
751 <td valign="top">naming</td>
752 <td valign="top">Controls the naming convention used to name generated
753 EJB jars. Please refer to the description above.</td>
754 <td valign="top" align="center">No</td>
755 </tr>
756 <tr>
757 <td valign="top">basejarname</td>
758 <td valign="top">The base name that is used for the generated jar files.
759 If this attribute is specified, the generic jar file name
760 will use this value as the prefix (followed by the value
761 specified in the 'genericjarsuffix' attribute) and the
762 resultant ejb jar file (followed by any suffix specified
763 in the nested element).</td>
764 <td valign="top" align="center">No</td>
765 </tr>
766 <tr>
767 <td valign="top">basenameterminator</td>
768 <td valign="top">String value used to substring out a string from the name
769 of each deployment descriptor found, which is then used to
770 locate related deployment descriptors (e.g. the WebLogic
771 descriptors). For example, a basename of '.' and a
772 deployment descriptor called 'FooBean.ejb-jar.xml' would
773 result in a basename of 'FooBean' which would then be used
774 to find FooBean.weblogic-ejb-jar.xml and
775 FooBean.weblogic-cmp-rdbms-jar.xml, as well as to create
776 the filenames of the jar files as FooBean-generic.jar and
777 FooBean-wl.jar. This attribute is not used if the
778 'basejarname' attribute is specified.</td>
779 <td valign="top" align="center">No, defaults to '-'.</td>
780 </tr>
781 <tr>
782 <td valign="top">genericjarsuffix</td>
783 <td valign="top">String value appended to the basename of the deployment
784 descriptor to create the filename of the generic EJB jar
785 file.</td>
786 <td valign="top" align="center">No, defaults to '-generic.jar'.</td>
787 </tr>
788 <tr>
789 <td valign="top">classpath</td>
790 <td valign="top">This classpath is used when resolving classes which
791 are to be added to the jar. Typically nested deployment
792 tool elements will also support a classpath which
793 will be combined with this classpath when resolving
794 classes</td>
795 <td valign="top" align="center">No.</td>
796 </tr>
797 <tr>
798 <td valign="top">flatdestdir</td>
799 <td valign="top">Set this attribute to true if you want all generated jars
800 to be placed in the root of the destdir, rather than
801 according to the location of the deployment descriptor
802 within the descriptor dir hierarchy.</td>
803 <td valign="top" align="center">No.</td>
804 </tr>
805 <tr>
806 <td valign="top">dependency</td>
807 <td valign="top">This attribute controls which additional classes and interfaces
808 are added to the jar. Please refer to the description
809 <a href="#ejbjar_deps">above</a></td>
810 <td valign="top" align="center">No.</td>
811 </tr>
812</table>
813
814<h3>Nested Elements</h3>
815
816<p>In addition to the vendor specific nested elements, the ejbjar task provides
817three nested elements. </p>
818
819<h4>Classpath</h4>
820
821<p>The <code>&lt;classpath&gt;</code> nested element allows the classpath
822to be set. It is useful when setting the classpath from a reference path. In all
823other respects the behaviour is the same as the classpath attribute.</p>
824
825<a name="ejbjar-dtd"><h4>dtd</h4></a>
826
827<p>The <code>&lt;dtd&gt;</code> element is used to specify the local location of DTDs to be
828used when parsing the EJB deployment descriptor. Using a local DTD is much
829faster than loading the DTD across the net. If you are running ejbjar behind a
830firewall you may not even be able to access the remote DTD. The supported
831vendor-specific nested elements know the location of the required DTDs within
832the vendor class hierarchy and, in general, this means <code>&lt;dtd&gt;</code> elements are
833not required. It does mean, however, that the vendor's class hierarchy must be
834available in the classpath when Ant is started. If your want to run Ant without
835requiring the vendor classes in the classpath, you would need to use a
836<code>&lt;dtd&gt;</code> element.</p>
837
838<table border="1" cellpadding="2" cellspacing="0">
839 <tr>
840 <td valign="top"><b>Attribute</b></td>
841 <td valign="top"><b>Description</b></td>
842 <td align="center" valign="top"><b>Required</b></td>
843 </tr>
844 <tr>
845 <td valign="top">publicId</td>
846 <td valign="top">The public Id of the DTD for which the location is being provided</td>
847 <td align="center" valign="top">Yes</td>
848 </tr>
849 <tr>
850 <td valign="top">location</td>
851 <td valign="top">The location of the local copy of the DTD. This can either be a
852 file or a resource loadable from the classpath.</td>
853 <td align="center" valign="top">Yes</td>
854 </tr>
855</table>
856
857<h4>support</h4>
858
859<p>The <code>&lt;support&gt;</code> nested element is used to supply additional classes
860(files) to be included in the generated jars. The <code>&lt;support&gt;</code> element is a
861<a href="../CoreTypes/fileset.html">FileSet</a>, so it can either reference a fileset declared elsewhere or it can be
862defined in-place with the appropriate <code>&lt;include&gt;</code> and <code>&lt;exclude&gt;</code> nested
863elements. The files in the support fileset are added into the generated EJB jar
864in the same relative location as their location within the support fileset. Note
865that when ejbjar generates more than one jar file, the support files are added
866to each one.</p>
867
868<h3>Vendor-specific deployment elements</h3>
869
870Each vendor-specific nested element controls the generation of a deployable jar
871specific to that vendor's EJB container. The parameters for each supported
872deployment element are detailed here.
873
874
875<h3><a name="ejbjar_jboss">Jboss element</a></h3>
876
877<p>The jboss element searches for the JBoss specific deployment descriptors and adds them
878to the final ejb jar file. JBoss has two deployment descriptors:
879<ul><li>jboss.xml</li>
880<li>for container manager persistence:<br>
881<table border="1">
882<tr><td><b>CMP version</b></td><td><b>File name</b></td></tr>
883<tr><td>CMP 1.0</td><td>jaws.xml</td></tr>
884<tr><td>CMP 2.0</td><td>jbosscmp-jdbc.xml</td></tr>
885</table>
886</li>
887</ul>
888<br>
889. The JBoss server uses hot deployment and does
890not require compilation of additional stubs and skeletons.</p>
891
892<table border="1" cellpadding="2" cellspacing="0">
893 <tr>
894 <td valign="top"><b>Attribute</b></td>
895 <td valign="top"><b>Description</b></td>
896 <td align="center" valign="top"><b>Required</b></td>
897 </tr>
898 <tr>
899 <td valign="top">destdir</td>
900 <td valign="top">The base directory into which the generated weblogic ready
901 jar files are deposited. Jar files are deposited in
902 directories corresponding to their location within the
903 descriptordir namespace. </td>
904 <td valign="top" align="center">Yes</td>
905 </tr>
906 <tr>
907 <td valign="top">genericjarsuffix</td>
908 <td valign="top">A generic jar is generated as an intermediate step in
909 build the weblogic deployment jar. The suffix used to
910 generate the generic jar file is not particularly
911 important unless it is desired to keep the generic
912 jar file. It should not, however, be the same
913 as the suffix setting.</td>
914 <td valign="top" align="center">No, defaults to '-generic.jar'.</td>
915 </tr>
916 <tr>
917 <td valign="top">suffix</td>
918 <td valign="top">String value appended to the basename of the deployment
919 descriptor to create the filename of the JBoss EJB
920 jar file.</td>
921 <td valign="top" align="center">No, defaults to '.jar'.</td>
922 </tr>
923 <tr>
924 <td valign="top">keepgeneric</td>
925 <td valign="top">This controls whether the generic file used as input to
926 ejbc is retained.</td>
927 <td valign="top" align="center">No, defaults to false</td>
928 </tr>
929</table>
930
931
932<h3><a name="ejbjar_weblogic">Weblogic element</a></h3>
933
934<p>The weblogic element is used to control the weblogic.ejbc compiler for
935generating weblogic EJB jars. Prior to Ant 1.3, the method of locating CMP
936descriptors was to use the ejbjar naming convention. So if your ejb-jar was
937called, Customer-ejb-jar.xml, your weblogic descriptor was called Customer-
938weblogic-ejb-jar.xml and your CMP descriptor had to be Customer-weblogic-cmp-
939rdbms-jar.xml. In addition, the <code>&lt;type-storage&gt;</code> element in the weblogic
940descriptor had to be set to the standard name META-INF/weblogic-cmp-rdbms-
941jar.xml, as that is where the CMP descriptor was mapped to in the generated
942jar.</p>
943
944<p>There are a few problems with this scheme. It does not allow for more than
945one CMP descriptor to be defined in a jar and it is not compatible with the
946deployment descriptors generated by some tools.</p>
947
948<p>In Ant 1.3, ejbjar parses the weblogic deployment descriptor to discover the
949CMP descriptors, which are then included automatically. This behaviour is
950controlled by the newCMP attribute. Note that if you move to the new method of
951determining CMP descriptors, you will need to update your weblogic deployment
952descriptor's <code>&lt;type-storage&gt;</code> element. In the above example, you would
953define this as META-INF/Customer-weblogic-cmp-rdbms-jar.xml.</p>
954
955<table border="1" cellpadding="2" cellspacing="0">
956 <tr>
957 <td valign="top"><b>Attribute</b></td>
958 <td valign="top"><b>Description</b></td>
959 <td align="center" valign="top"><b>Required</b></td>
960 </tr>
961 <tr>
962 <td valign="top">destdir</td>
963 <td valign="top">The base directory into which the generated weblogic ready
964 jar files are deposited. Jar files are deposited in
965 directories corresponding to their location within the
966 descriptordir namespace. </td>
967 <td valign="top" align="center">Yes</td>
968 </tr>
969 <tr>
970 <td valign="top">genericjarsuffix</td>
971 <td valign="top">A generic jar is generated as an intermediate step in
972 build the weblogic deployment jar. The suffix used to
973 generate the generic jar file is not particularly
974 important unless it is desired to keep the generic
975 jar file. It should not, however, be the same
976 as the suffix setting.</td>
977 <td valign="top" align="center">No, defaults to '-generic.jar'.</td>
978 </tr>
979 <tr>
980 <td valign="top">suffix</td>
981 <td valign="top">String value appended to the basename of the deployment
982 descriptor to create the filename of the WebLogic EJB
983 jar file.</td>
984 <td valign="top" align="center">No, defaults to '.jar'.</td>
985 </tr>
986 <tr>
987 <td valign="top">classpath</td>
988 <td valign="top">The classpath to be used when running the weblogic ejbc
989 tool. Note that this tool typically requires the classes
990 that make up the bean to be available on the classpath.
991 Currently, however, this will cause the ejbc tool to be
992 run in a separate VM</td>
993 <td valign="top" align="center">No</td>
994 </tr>
995 <tr>
996 <td valign="top">wlclasspath</td>
997 <td valign="top">Weblogic 6.0 will give a warning if the home and remote interfaces
998 of a bean are on the system classpath used to run weblogic.ejbc.
999 In that case, the standard weblogic classes should be set with
1000 this attribute (or equivalent nested element) and the
1001 home and remote interfaces located with the standard classpath
1002 attribute</td>
1003 <td valign="top" align="center">No</td>
1004 </tr>
1005 <tr>
1006 <td valign="top">keepgeneric</td>
1007 <td valign="top">This controls whether the generic file used as input to
1008 ejbc is retained.</td>
1009 <td valign="top" align="center">No, defaults to false</td>
1010 </tr>
1011 <tr>
1012 <td valign="top">compiler</td>
1013 <td valign="top">This allows for the selection of a different compiler
1014 to be used for the compilation of the generated Java
1015 files. This could be set, for example, to Jikes to
1016 compile with the Jikes compiler. If this is not set
1017 and the <code>build.compiler</code> property is set
1018 to jikes, the Jikes compiler will be used. If this
1019 is not desired, the value &quot;<code>default</code>&quot;
1020 may be given to use the default compiler</td>
1021 <td valign="top" align="center">No</td>
1022 </tr>
1023 <tr>
1024 <td valign="top">rebuild</td>
1025 <td valign="top">This flag controls whether weblogic.ejbc is always
1026 invoked to build the jar file. In certain circumstances,
1027 such as when only a bean class has been changed, the jar
1028 can be generated by merely replacing the changed classes
1029 and not rerunning ejbc. Setting this to false will reduce
1030 the time to run ejbjar.
1031 </td>
1032 <td valign="top" align="center">No, defaults to true.</td>
1033 </tr>
1034 <tr>
1035 <td valign="top">keepgenerated</td>
1036 <td valign="top">Controls whether weblogic will keep the generated Java
1037 files used to build the class files added to the
1038 jar. This can be useful when debugging
1039 </td>
1040 <td valign="top" align="center">No, defaults to false.</td>
1041 </tr>
1042 <tr>
1043 <td valign="top">args</td>
1044 <td valign="top">Any additional arguments to be passed to the weblogic.ejbc
1045 tool.
1046 </td>
1047 <td valign="top" align="center">No.</td>
1048 </tr>
1049 <tr>
1050 <td valign="top">weblogicdtd</td>
1051 <td valign="top"><b>Deprecated</b>. Defines the location of the ejb-jar DTD in
1052 the weblogic class hierarchy. This should not be necessary if you
1053 have weblogic in your classpath. If you do not, you should use a
1054 nested <code>&lt;dtd&gt;</code> element, described above. If you do choose
1055 to use an attribute, you should use a
1056 nested <code>&lt;dtd&gt;</code> element.
1057 </td>
1058 <td valign="top" align="center">No.</td>
1059 </tr>
1060 <tr>
1061 <td valign="top">wldtd</td>
1062 <td valign="top"><b>Deprecated</b>. Defines the location of the weblogic-ejb-jar
1063 DTD which covers the Weblogic specific deployment descriptors.
1064 This should not be necessary if you have weblogic in your
1065 classpath. If you do not, you should use a nested <code>&lt;dtd&gt;</code>
1066 element, described above.
1067 </td>
1068 <td valign="top" align="center">No.</td>
1069 </tr>
1070 <tr>
1071 <td valign="top">ejbdtd</td>
1072 <td valign="top"><b>Deprecated</b>. Defines the location of the ejb-jar DTD in
1073 the weblogic class hierarchy. This should not be necessary if you
1074 have weblogic in your classpath. If you do not, you should use a
1075 nested <code>&lt;dtd&gt;</code> element, described above.
1076 </td>
1077 <td valign="top" align="center">No.</td>
1078 </tr>
1079 <tr>
1080 <td valign="top">newCMP</td>
1081 <td valign="top">If this is set to true, the new method for locating
1082 CMP descriptors will be used.</td>
1083 <td valign="top" align="center">No. Defaults to false</td>
1084 </tr>
1085 <tr>
1086 <td valign="top">oldCMP</td>
1087 <td valign="top"><b>Deprecated</b> This is an antonym for newCMP which should be used instead.</td>
1088 <td valign="top" align="center">No.</td>
1089 </tr>
1090 <tr>
1091 <td valign="top">noEJBC</td>
1092 <td valign="top">If this attribute is set to true, Weblogic's ejbc will not be run on the EJB jar.
1093 Use this if you prefer to run ejbc at deployment time.</td>
1094 <td valign="top" align="center">No.</td>
1095 </tr>
1096 <tr>
1097 <td valign="top">ejbcclass</td>
1098 <td valign="top">Specifies the classname of the ejbc compiler. Normally ejbjar determines
1099 the appropriate class based on the DTD used for the EJB. The EJB 2.0 compiler
1100 featured in weblogic 6 has, however, been deprecated in version 7. When
1101 using with version 7 this attribute should be set to
1102 &quot;weblogic.ejbc&quot; to avoid the deprecation warning.</td>
1103 <td valign="top" align="center">No.</td>
1104 </tr>
1105 <tr>
1106 <td valign="top">jvmargs</td>
1107 <td valign="top">Any additional arguments to be passed to the Virtual Machine
1108 running weblogic.ejbc tool. For example to set the memory size,
1109 this could be jvmargs=&quot;-Xmx128m&quot;
1110 </td>
1111 <td valign="top" align="center">No.</td>
1112 </tr>
1113 <tr>
1114 <td valign="top">jvmdebuglevel</td>
1115 <td valign="top">Sets the weblogic.StdoutSeverityLevel to use when running
1116 the Virtual Machine that executes ejbc. Set to 16 to avoid
1117 the warnings about EJB Home and Remotes being in the classpath
1118 </td>
1119 <td valign="top" align="center">No.</td>
1120 </tr>
1121 <tr>
1122 <td valign="top">outputdir</td>
1123 <td valign="top">If set ejbc will be given this directory as the output
1124 destination rather than a jar file. This allows for the
1125 generation of &quot;exploded&quot; jars.
1126 </td>
1127 <td valign="top" align="center">No.</td>
1128 </tr>
1129</table>
1130
1131<p>The weblogic nested element supports three nested elements. The
1132first two, <code>&lt;classpath&gt;</code> and <code>&lt;wlclasspath&gt;</code>, are used to set the
1133respective classpaths. These nested elements are useful when setting up
1134class paths using reference Ids. The last, <code>&lt;sysproperty&gt;</code>, allows
1135Java system properties to be set during the compiler run. This turns out
1136to be necessary for supporting CMP EJB compilation in all environments.
1137</p>
1138
1139<h3>TOPLink for Weblogic element</h3>
1140
1141<p><b><i>Deprecated</i></b></p>
1142
1143<p>The toplink element is no longer required. Toplink beans can now be built with the standard
1144weblogic element, as long as the newCMP attribute is set to &quot;true&quot;
1145</p>
1146
1147<p>The TopLink element is used to handle beans which use Toplink for the CMP operations. It
1148is derived from the standard weblogic element so it supports the same set of attributes plus these
1149additional attributes</p>
1150
1151<table border="1" cellpadding="2" cellspacing="0">
1152 <tr>
1153 <td valign="top"><b>Attribute</b></td>
1154 <td valign="top"><b>Description</b></td>
1155 <td align="center" valign="top"><b>Required</b></td>
1156 </tr>
1157 <tr>
1158 <td valign="top">toplinkdescriptor</td>
1159 <td valign="top">This specifies the name of the TOPLink deployment descriptor file contained in the
1160 'descriptordir' directory.</td>
1161 <td valign="top" align="center">Yes</td>
1162 </tr>
1163 <tr>
1164 <td valign="top">toplinkdtd</td>
1165 <td valign="top">This specifies the location of the TOPLink DTD file. This can be a file path or
1166 a file URL. This attribute is not required, but using a local DTD is recommended.</td>
1167 <td valign="top" align="center">No, defaults to dtd file at www.objectpeople.com.</td>
1168 </tr>
1169</table>
1170
1171
1172<h3>Examples</h3>
1173
1174<p>This example shows ejbjar being used to generate deployment jars using a
1175Weblogic EJB container. This example requires the naming standard to be used for
1176the deployment descriptors. Using this format will create a ejb jar file for
1177each variation of '*-ejb-jar.xml' that is found in the deployment descriptor
1178directory.</p>
1179
1180<pre>
1181 &lt;ejbjar srcdir=&quot;${build.classes}&quot;
1182 descriptordir=&quot;${descriptor.dir}&quot;&gt;
1183 &lt;weblogic destdir=&quot;${deploymentjars.dir}&quot;
1184 classpath=&quot;${descriptorbuild.classpath}&quot;/&gt;
1185 &lt;include name=&quot;**/*-ejb-jar.xml&quot;/&gt;
1186 &lt;exclude name=&quot;**/*weblogic*.xml&quot;/&gt;
1187 &lt;/ejbjar&gt;
1188</pre>
1189
1190<p>If weblogic is not in the Ant classpath, the following example
1191shows how to specify the location of the weblogic DTDs. This
1192example also show the use of a nested classpath element.</p>
1193
1194<pre>
1195 &lt;ejbjar descriptordir=&quot;${src.dir}&quot; srcdir=&quot;${build.classes}&quot;&gt;
1196 &lt;weblogic destdir=&quot;${deployment.webshop.dir}&quot;
1197 keepgeneric=&quot;true&quot;
1198 args=&quot;-g -keepgenerated ${ejbc.compiler}&quot;
1199 suffix=&quot;.jar&quot;
1200 oldCMP=&quot;false&quot;&gt;
1201 &lt;classpath&gt;
1202 &lt;pathelement path=&quot;${descriptorbuild.classpath}&quot;/&gt;
1203 &lt;/classpath&gt;
1204 &lt;/weblogic&gt;
1205 &lt;include name=&quot;**/*-ejb-jar.xml&quot;/&gt;
1206 &lt;exclude name=&quot;**/*-weblogic-ejb-jar.xml&quot;/&gt;
1207 &lt;dtd publicId=&quot;-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN&quot;
1208 location=&quot;${weblogic.home}/classes/weblogic/ejb/deployment/xml/ejb-jar.dtd&quot;/&gt;
1209 &lt;dtd publicId=&quot;-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN&quot;
1210 location=&quot;${weblogic.home}/classes/weblogic/ejb/deployment/xml/weblogic-ejb-jar.dtd&quot;/&gt;
1211 &lt;/ejbjar&gt;
1212</pre>
1213
1214
1215<p>This example shows ejbjar being used to generate a single deployment jar
1216using a Weblogic EJB container. This example does not require the deployment
1217descriptors to use the naming standard. This will create only one ejb jar file -
1218'TheEJBJar.jar'.</p>
1219
1220
1221<pre>
1222 &lt;ejbjar srcdir=&quot;${build.classes}&quot;
1223 descriptordir=&quot;${descriptor.dir}&quot;
1224 basejarname=&quot;TheEJBJar&quot;&gt;
1225 &lt;weblogic destdir=&quot;${deploymentjars.dir}&quot;
1226 classpath=&quot;${descriptorbuild.classpath}&quot;/&gt;
1227 &lt;include name=&quot;**/ejb-jar.xml&quot;/&gt;
1228 &lt;exclude name=&quot;**/weblogic*.xml&quot;/&gt;
1229 &lt;/ejbjar&gt;
1230</pre>
1231
1232<p>This example shows ejbjar being used to generate deployment jars for a TOPLink-enabled entity bean using a
1233Weblogic EJB container. This example does not require the deployment descriptors to use the naming standard.
1234This will create only one TOPLink-enabled ejb jar file - 'Address.jar'.</p>
1235
1236<pre>
1237 &lt;ejbjar srcdir=&quot;${build.dir}&quot;
1238 destdir=&quot;${solant.ejb.dir}&quot;
1239 descriptordir=&quot;${descriptor.dir}&quot;
1240 basejarname=&quot;Address&quot;&gt;
1241 &lt;weblogictoplink destdir=&quot;${solant.ejb.dir}&quot;
1242 classpath=&quot;${java.class.path}&quot;
1243 keepgeneric=&quot;false&quot;
1244 toplinkdescriptor=&quot;Address.xml&quot;
1245 toplinkdtd=&quot;file:///dtdfiles/toplink-cmp_2_5_1.dtd&quot;
1246 suffix=&quot;.jar&quot;/&gt;
1247 &lt;include name=&quot;**/ejb-jar.xml&quot;/&gt;
1248 &lt;exclude name=&quot;**/weblogic-ejb-jar.xml&quot;/&gt;
1249 &lt;/ejbjar&gt;
1250</pre>
1251
1252<p>This final example shows how you would set-up ejbjar under Weblogic 6.0. It also shows the use of the
1253<code>&lt;support&gt;</code> element to add support files</p>
1254
1255<pre>
1256 &lt;ejbjar descriptordir=&quot;${dd.dir}&quot; srcdir=&quot;${build.classes.server}&quot;&gt;
1257 &lt;include name=&quot;**/*-ejb-jar.xml&quot;/&gt;
1258 &lt;exclude name=&quot;**/*-weblogic-ejb-jar.xml&quot;/&gt;
1259 &lt;support dir=&quot;${build.classes.server}&quot;&gt;
1260 &lt;include name=&quot;**/*.class&quot;/&gt;
1261 &lt;/support&gt;
1262 &lt;weblogic destdir=&quot;${deployment.dir}&quot;
1263 keepgeneric=&quot;true&quot;
1264 suffix=&quot;.jar&quot;
1265 rebuild=&quot;false&quot;&gt;
1266 &lt;classpath&gt;
1267 &lt;pathelement path=&quot;${build.classes.server}&quot;/&gt;
1268 &lt;/classpath&gt;
1269 &lt;wlclasspath&gt;
1270 &lt;pathelement path=&quot;${weblogic.classes}&quot;/&gt;
1271 &lt;/wlclasspath&gt;
1272 &lt;/weblogic&gt;
1273 &lt;/ejbjar&gt;
1274</pre>
1275
1276
1277<h3><a name="ejbjar_websphere">WebSphere element</a></h3>
1278
1279<p>The websphere element searches for the websphere specific deployment descriptors and
1280adds them to the final ejb jar file. Websphere has two specific descriptors for session
1281beans:
1282<ul>
1283 <li>ibm-ejb-jar-bnd.xmi</li>
1284 <li>ibm-ejb-jar-ext.xmi</li>
1285</ul>
1286and another two for container managed entity beans:
1287<ul>
1288 <li>Map.mapxmi</li>
1289 <li>Schema.dbxmi</li>
1290</ul>
1291In terms of WebSphere, the generation of container code and stubs is called <code>deployment</code>.
1292This step can be performed by the websphere element as part of the jar generation process. If the
1293switch <code>ejbdeploy</code> is on, the ejbdeploy tool from the websphere toolset is called for
1294every ejb-jar. Unfortunately, this step only works, if you use the ibm jdk. Otherwise, the rmic
1295(called by ejbdeploy) throws a ClassFormatError. Be sure to switch ejbdeploy off, if run ant with
1296sun jdk.
1297</p>
1298
1299<p>
1300For the websphere element to work, you have to provide a complete classpath, that contains all
1301classes, that are required to reflect the bean classes. For ejbdeploy to work, you must also provide
1302the classpath of the ejbdeploy tool and set the <i>websphere.home</i> property (look at the examples below).
1303</p>
1304
1305<table border="1" cellpadding="2" cellspacing="0">
1306 <tr>
1307 <td valign="top"><b>Attribute</b></td>
1308 <td valign="top"><b>Description</b></td>
1309 <td align="center" valign="top"><b>Required</b></td>
1310 </tr>
1311 <tr>
1312 <td valign="top">destdir</td>
1313 <td valign="top">The base directory into which the generated weblogic ready
1314 jar files are deposited. Jar files are deposited in
1315 directories corresponding to their location within the
1316 descriptordir namespace. </td>
1317 <td valign="top" align="center">Yes</td>
1318 </tr>
1319 <tr>
1320 <td valign="top">ejbdeploy</td>
1321 <td valign="top">Decides whether ejbdeploy is called. When you set this to true,
1322 be sure, to run ant with the ibm jdk.</td>
1323 <td valign="top" align="center">No, defaults to true</td>
1324 </tr>
1325 <tr>
1326 <td valign="top">suffix</td>
1327 <td valign="top">String value appended to the basename of the deployment
1328 descriptor to create the filename of the WebLogic EJB
1329 jar file.</td>
1330 <td valign="top" align="center">No, defaults to '.jar'.</td>
1331 </tr>
1332 <tr>
1333 <td valign="top">keepgeneric</td>
1334 <td valign="top">This controls whether the generic file used as input to
1335 ejbdeploy is retained.</td>
1336 <td valign="top" align="center">No, defaults to false</td>
1337 </tr>
1338 <tr>
1339 <td valign="top">rebuild</td>
1340 <td valign="top">This controls whether ejbdeploy is called although no changes
1341 have occurred.</td>
1342 <td valign="top" align="center">No, defaults to false</td>
1343 </tr>
1344 <tr>
1345 <td valign="top">tempdir</td>
1346 <td valign="top">A directory, where ejbdeploy will write temporary files</td>
1347 <td valign="top" align="center">No, defaults to '_ejbdeploy_temp'.</td>
1348 </tr>
1349 <tr>
1350 <td valign="top">dbName<br>dbSchema</td>
1351 <td valign="top">These options are passed to ejbdeploy.</td>
1352 <td valign="top" align="center">No</td>
1353 </tr>
1354 <tr>
1355 <td valign="top">dbVendor</td>
1356 <td valign="top">This option is passed to ejbdeploy.
1357 <p>
1358 Valid options can be obtained by running the following command:
1359 <code>
1360 &lt;WAS_HOME&gt;/bin/EJBDeploy.[sh/bat] -help
1361 </code>
1362 </p>
1363 This is also used to determine the name of the Map.mapxmi and
1364 Schema.dbxmi files, for example Account-DB2UDBWIN_V71-Map.mapxmi
1365 and Account-DB2UDBWIN_V71-Schema.dbxmi.
1366 </td>
1367 <td valign="top" align="center">No</td>
1368 </tr>
1369 <tr>
1370 <td valign="top">codegen<br>quiet<br>novalidate<br>noinform<br>trace<br>
1371 use35MappingRules</td>
1372 <td valign="top">These options are all passed to ejbdeploy. All options
1373 except 'quiet' default to false.</td>
1374 <td valign="top" align="center">No</td>
1375 </tr>
1376 <tr>
1377 <td valign="top">rmicOptions</td>
1378 <td valign="top">This option is passed to ejbdeploy and will be passed
1379 on to rmic.</td>
1380 <td valign="top" align="center">No</td>
1381 </tr>
1382</table>
1383
1384<p>This example shows ejbjar being used to generate deployment jars for all deployment descriptors
1385in the descriptor dir:</p>
1386
1387<pre>
1388 &lt;property name=&quot;webpshere.home&quot; value=&quot;${was4.home}&quot;/&gt;
1389 &lt;ejbjar srcdir="${build.class}" descriptordir="etc/ejb"&gt;
1390 &lt;include name="*-ejb-jar.xml"/&gt;
1391 &lt;websphere dbvendor="DB2UDBOS390_V6"
1392 ejbdeploy="true"
1393 oldCMP="false"
1394 tempdir="/tmp"
1395 destdir="${dist.server}"&gt;
1396 &lt;wasclasspath&gt;
1397 &lt;pathelement location="${was4.home}/deploytool/itp/plugins/org.eclipse.core.boot/boot.jar"/&gt;
1398 &lt;pathelement location="${was4.home}/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime/batch.jar"/&gt;
1399 &lt;pathelement location="${was4.home}/lib/xerces.jar"/&gt;
1400 &lt;pathelement location="${was4.home}/lib/ivjejb35.jar"/&gt;
1401 &lt;pathelement location="${was4.home}/lib/j2ee.jar"/&gt;
1402 &lt;pathelement location="${was4.home}/lib/vaprt.jar"/&gt;
1403 &lt;/wasclasspath&gt;
1404 &lt;classpath&gt;
1405 &lt;path refid="build.classpath"/&gt;
1406 &lt;/classpath&gt;
1407 &lt;/websphere&gt;
1408 &lt;dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
1409 location="${lib}/dtd/ejb-jar_1_1.dtd"/&gt;
1410 &lt;/ejbjar&gt;
1411</pre>
1412
1413<h3><a name="ejbjar_iplanet">iPlanet Application Server (iAS) element</a></h3>
1414
1415The &lt;iplanet&lt; nested element is used to build iAS-specific stubs and
1416
1417skeletons and construct a JAR file which may be deployed to the iPlanet
1418Application Server 6.0. The build process will always determine if
1419the EJB stubs/skeletons and the EJB-JAR file are up to date, and it will
1420do the minimum amount of work required.
1421<p>Like the WebLogic element, a naming convention for the EJB descriptors
1422is most commonly used to specify the name for the completed JAR file.
1423For example, if the EJB descriptor ejb/Account-ejb-jar.xml is found in
1424the descriptor directory, the iplanet element will search for an iAS-specific
1425EJB descriptor file named ejb/Account-ias-ejb-jar.xml (if it isn't found,
1426the task will fail) and a JAR file named ejb/Account.jar will be written
1427in the destination directory. Note that when the EJB descriptors
1428are added to the JAR file, they are automatically renamed META-INF/ejb-jar.xml
1429and META-INF/ias-ejb-jar.xml.</p>
1430<p>Of course, this naming behaviour can be modified by specifying attributes
1431in the ejbjar task (for example, basejarname, basenameterminator, and flatdestdir)
1432as well as the iplanet element (for example, suffix). Refer to the
1433appropriate documentation for more details.</p>
1434<h3>
1435Parameters:</h3>
1436
1437<table border="1" cellpadding="2" cellspacing="0">
1438<tr>
1439<td valign="top"><b>Attribute</b></td>
1440
1441<td valign="top"><b>Description</b></td>
1442
1443<td align="center" valign="top"><b>Required</b></td>
1444</tr>
1445
1446<tr>
1447<td valign="top">destdir</td>
1448
1449<td valign="top">The base directory into which the generated JAR files will
1450be written. Each JAR file is written in directories which correspond to
1451their location within the "descriptordir" namespace.</td>
1452
1453<td align="center" valign="top">Yes</td>
1454</tr>
1455
1456<tr>
1457<td valign="top">classpath</td>
1458
1459<td valign="top">The classpath used when generating EJB stubs and skeletons.
1460If omitted, the classpath specified in the "ejbjar" parent task will be
1461used. If specified, the classpath elements will be prepended to the
1462classpath specified in the parent "ejbjar" task. Note that nested "classpath"
1463elements may also be used.</td>
1464
1465<td align="center" valign="top">No</td>
1466</tr>
1467
1468<tr>
1469<td valign="top">keepgenerated</td>
1470
1471<td valign="top">Indicates whether or not the Java source files which are
1472generated by ejbc will be saved or automatically deleted. If "yes", the
1473source files will be retained. If omitted, it defaults to "no". </td>
1474
1475<td align="center" valign="top">No</td>
1476</tr>
1477
1478<tr>
1479<td valign="top">debug</td>
1480
1481<td>Indicates whether or not the ejbc utility should log additional debugging
1482statements to the standard output. If "yes", the additional debugging statements
1483will be generated. If omitted, it defaults to "no". </td>
1484
1485<td align="center" valign="top">No</td>
1486</tr>
1487
1488<tr>
1489<td valign="top">iashome</td>
1490
1491<td>May be used to specify the "home" directory for this iAS installation.
1492This is used to find the ejbc utility if it isn't included in the user's
1493system path. If specified, it should refer to the [install-location]/iplanet/ias6/ias
1494directory. If omitted, the ejbc utility must be on the user's system
1495path. </td>
1496
1497<td align="center" valign="top">No</td>
1498</tr>
1499
1500<tr>
1501<td valign="top">suffix</td>
1502
1503<td>String value appended to the JAR filename when creating each JAR.
1504If omitted, it defaults to ".jar". </td>
1505
1506<td align="center" valign="top">No</td>
1507</tr>
1508</table>
1509
1510<p>As noted above, the iplanet element supports additional <code>&lt;classpath&gt;</code>
1511nested elements.</p>
1512<h3>
1513Examples</h3>
1514This example demonstrates the typical use of the <code>&lt;iplanet&gt;</code> nested element.
1515It will name each EJB-JAR using the "basename" prepended to each standard
1516EJB descriptor. For example, if the descriptor named "Account-ejb-jar.xml"
1517is processed, the EJB-JAR will be named "Account.jar"
1518<pre>
1519 &lt;ejbjar srcdir="${build.classesdir}"
1520 descriptordir="${src}"&gt;
1521
1522 &lt;iplanet destdir="${assemble.ejbjar}"
1523 classpath="${ias.ejbc.cpath}"/&gt;
1524 &lt;include name="**/*-ejb-jar.xml"/&gt;
1525 &lt;exclude name="**/*ias-*.xml"/&gt;
1526 &lt;/ejbjar&gt;</pre>
1527
1528This example demonstrates the use of a nested classpath element as well
1529as some of the other optional attributes.
1530<pre>
1531 &lt;ejbjar srcdir="${build.classesdir}"
1532 descriptordir="${src}"&gt;
1533
1534 &lt;iplanet destdir="${assemble.ejbjar}"
1535 iashome="${ias.home}"
1536 debug="yes"
1537 keepgenerated="yes"&gt;
1538 &lt;classpath&gt;
1539 &lt;pathelement path="."/&gt;
1540 &lt;pathelement path="${build.classpath}"/&gt;
1541 &lt;/classpath&gt;
1542 &lt;/iplanet&gt;
1543 &lt;include name="**/*-ejb-jar.xml"/&gt;
1544 &lt;exclude name="**/*ias-*.xml"/&gt;
1545 &lt;/ejbjar&gt;</pre>
1546
1547This example demonstrates the use of basejarname attribute. In this
1548case, the completed EJB-JAR will be named "HelloWorld.jar" If multiple
1549EJB descriptors might be found, care must be taken to ensure that the completed
1550JAR files don't overwrite each other.
1551<pre>
1552 &lt;ejbjar srcdir="${build.classesdir}"
1553 descriptordir="${src}"
1554 basejarname="HelloWorld"&gt;
1555
1556 &lt;iplanet destdir="${assemble.ejbjar}"
1557 classpath="${ias.ejbc.cpath}"/&gt;
1558 &lt;include name="**/*-ejb-jar.xml"/&gt;
1559 &lt;exclude name="**/*ias-*.xml"/&gt;
1560 &lt;/ejbjar&gt;</pre>
1561This example demonstrates the use of the dtd nested element. If the local
1562copies of the DTDs are included in the classpath, they will be automatically
1563referenced without the nested elements. In iAS 6.0 SP2, these local DTDs are
1564found in the [iAS-install-directory]/APPS directory. In iAS 6.0 SP3, these
1565local DTDs are found in the [iAS-install-directory]/dtd directory.
1566<pre>
1567 &lt;ejbjar srcdir="${build.classesdir}"
1568 descriptordir="${src}"&gt;
1569 &lt;iplanet destdir="${assemble.ejbjar}"&gt;
1570 classpath="${ias.ejbc.cpath}"/&gt;
1571 &lt;include name="**/*-ejb-jar.xml"/&gt;
1572 &lt;exclude name="**/*ias-*.xml"/&gt;
1573
1574 &lt;dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
1575 location="${ias.home}/APPS/ejb-jar_1_1.dtd"/&gt;
1576 &lt;dtd publicId="-//Sun Microsystems, Inc.//DTD iAS Enterprise JavaBeans 1.0//EN"
1577 location="${ias.home}/APPS/IASEjb_jar_1_0.dtd"/&gt;
1578 &lt;/ejbjar&gt;</pre>
1579
1580<h3><a name="ejbjar_jonas">JOnAS (Java Open Application Server) element</a></h3>
1581
1582<p>The <code>&lt;jonas&gt;</code> nested element is used to build JOnAS-specific stubs and
1583skeletons thanks to the <code>GenIC</code> specific tool, and construct a JAR
1584file which may be deployed to the JOnAS Application Server. The build process
1585will always determine if the EJB stubs/skeletons and the EJB-JAR file are up to
1586date, and it will do the minimum amount of work required.</p>
1587
1588<p>Like the WebLogic element, a naming convention for the EJB descriptors is
1589most commonly used to specify the name for the completed JAR file. For example,
1590if the EJB descriptor <code>ejb/Account-ejb-jar.xml</code> is found in the
1591descriptor directory, the <code>&lt;jonas&gt;</code> element will search for a JOnAS-specific
1592EJB descriptor file named <code>ejb/Account-jonas-ejb-jar.xml</code> and a JAR
1593file named <code>ejb/Account.jar</code> will be written in the destination
1594directory. But the <code>&lt;jonas&gt;</code> element can also use the JOnAS naming
1595convention. With the same example as below, the EJB descriptor can also be named
1596<code>ejb/Account.xml</code> (no base name terminator here) in the descriptor
1597directory. Then the <code>&lt;jonas&gt;</code> element will search for a JOnAS-specific EJB
1598descriptor file called <code>ejb/jonas-Account.xml</code>. This convention do
1599not follow strictly the ejb-jar naming convention recommendation but is
1600supported for backward compatibility with previous version of JOnAS.</p>
1601
1602<p>Note that when the EJB descriptors are added to the JAR file, they are
1603automatically renamed <code>META-INF/ejb-jar.xml</code> and
1604<code>META-INF/jonas-ejb-jar.xml</code>.</p>
1605
1606<p>Of course, this naming behavior can be modified by specifying attributes in
1607the ejbjar task (for example, basejarname, basenameterminator, and flatdestdir)
1608as well as the iplanet element (for example, suffix). Refer to the appropriate
1609documentation for more details.</p>
1610
1611<h3> Parameters:</h3>
1612
1613<table border="1" cellspacing="0" cellpadding="2">
1614 <tbody>
1615 <tr>
1616 <td valign="Top"><b>Attribute</b></td>
1617 <td valign="Top"><b>Description</b></td>
1618 <td align="Center" valign="Top"><b>Required</b></td>
1619 </tr>
1620 <tr>
1621 <td valign="Top">destdir</td>
1622 <td valign="Top">The base directory into which the generated JAR files
1623 will be written. Each JAR file is written in directories which correspond
1624 to their location within the "<code>descriptordir</code>" namespace.</td>
1625 <td align="Center" valign="Top">Yes</td>
1626 </tr>
1627 <tr>
1628 <td valign="Top">jonasroot</td>
1629 <td valign="Top">The root directory for JOnAS.</td>
1630 <td valign="Top" align="Center">Yes</td>
1631 </tr>
1632 <tr>
1633 <td valign="Top">classpath</td>
1634 <td valign="Top">The classpath used when generating EJB stubs and
1635 skeletons. If omitted, the classpath specified in the "ejbjar" parent
1636 task will be used. If specified, the classpath elements will be prepended
1637 to the classpath specified in the parent "ejbjar" task (see also the ORB
1638 attribute documentation below). Note that nested "classpath" elements may
1639 also be used.</td>
1640 <td valign="Top" align="Center">No</td>
1641 </tr>
1642 <tr>
1643 <td valign="Top">keepgenerated</td>
1644 <td valign="Top"><code>true</code> if the intermediate Java
1645 source files generated by GenIC must be deleted or not. If
1646 omitted, it defaults to <code>false</code>.</td>
1647 <td align="Center" valign="Top">No</td>
1648 </tr>
1649 <tr>
1650 <td valign="Top">nocompil</td>
1651 <td valign="Top"><code>true</code> if the generated source files
1652 must not be compiled via the java and rmi compilers. If omitted,
1653 it defaults to <code>false</code>.</td>
1654 <td align="Center" valign="Top">No</td>
1655 </tr>
1656 <tr>
1657 <td valign="Top">novalidation</td>
1658 <td valign="Top"><code>true</code> if the XML deployment descriptors must
1659 be parsed without validation. If omitted, it defaults to <code>false</code>.</td>
1660 <td align="Center" valign="Top">No</td>
1661 </tr>
1662 <tr>
1663 <td valign="Top">javac</td>
1664 <td valign="Top">Java compiler to use. If omitted, it defaults
1665 to the value of <code>build.compiler</code> property.</td>
1666 <td align="Center" valign="Top">No</td>
1667 </tr>
1668 <tr>
1669 <td valign="Top">javacopts</td>
1670 <td valign="Top">Options to pass to the java compiler.</td>
1671 <td align="Center" valign="Top">No</td>
1672 </tr>
1673 <tr>
1674 <td valign="Top">rmicopts</td>
1675 <td valign="Top">Options to pass to the rmi compiler.</td>
1676 <td align="Center" valign="Top">No</td>
1677 </tr>
1678 <tr>
1679 <td valign="top">secpropag</td>
1680 <td valign="top"><code>true</code> if the RMI Skel. and
1681 Stub. must be modified to implement the implicit propagation of
1682 the security context (the transactional context is always
1683 provided). If omitted, it defaults to <code>false</code>.</td>
1684 <td valign="top" align="center">No</td>
1685 </tr>
1686 <tr>
1687 <td valign="Top">verbose</td>
1688 <td valign="Top">Indicates whether or not to use -verbose switch. If
1689 omitted, it defaults to <code>false</code>.</td>
1690 <td align="Center" valign="Top">No</td>
1691 </tr>
1692 <tr>
1693 <td valign="Top">additionalargs</td>
1694 <td valign="Top">Add additional args to GenIC.</td>
1695 <td align="Center" valign="Top">No</td>
1696 </tr>
1697 <tr>
1698 <td valign="Top">keepgeneric</td>
1699 <td valign="Top"><code>true</code> if the generic JAR file used as input
1700 to GenIC must be retained. If omitted, it defaults to <code>false</code>.</td>
1701 <td align="Center" valign="Top">No</td>
1702 </tr>
1703 <tr>
1704 <td valign="Top">suffix</td>
1705 <td>String value appended to the JAR filename when creating each JAR. If
1706 omitted, it defaults to ".jar". </td>
1707 <td align="Center" valign="Top">No</td>
1708 </tr>
1709 <tr>
1710 <td valign="Top">orb</td>
1711 <td>Choose your ORB : RMI, JEREMIE, DAVID. If omitted, it defaults to the
1712 one present in classpath. If specified, the corresponding JOnAS JAR is
1713 automatically added to the classpath.</td>
1714 <td align="Center" valign="Top">No</td>
1715 </tr>
1716 <tr>
1717 <td valign="Top">nogenic</td>
1718 <td valign="Top">If this attribute is set to <code>true</code>,
1719 JOnAS's GenIC will not be run on the EJB JAR. Use this if you
1720 prefer to run GenIC at deployment time. If omitted, it defaults
1721 to <code>false</code>.</td>
1722 <td align="Center" valign="Top">No</td>
1723 </tr>
1724 <tr>
1725 </tbody>
1726</table>
1727
1728<p>As noted above, the jonas element supports additional <code>&lt;classpath&gt;</code>
1729nested elements.</p>
1730
1731<h3>Examples</h3>
1732
1733<p>This example shows ejbjar being used to generate deployment jars using a
1734JOnAS EJB container. This example requires the naming standard to be used for
1735the deployment descriptors. Using this format will create a EJB JAR file for
1736each variation of &nbsp;'*-jar.xml' that is found in the deployment descriptor
1737directory.&nbsp;</p>
1738
1739<pre>
1740 &lt;ejbjar srcdir="${build.classes}"
1741 descriptordir="${descriptor.dir}"&gt;
1742 &lt;jonas destdir="${deploymentjars.dir}"
1743 jonasroot="${jonas.root}"
1744 orb="RMI"/&gt;
1745 &lt;include name="**/*.xml"/&gt;
1746 &lt;exclude name="**/jonas-*.xml"/&gt;
1747 &lt;support dir="${build.classes}"&gt;
1748 &lt;include name="**/*.class"/&gt;
1749 &lt;/support&gt;
1750 &lt;/ejbjar&gt;
1751</pre>
1752
1753<p>This example shows ejbjar being used to generate a single deployment jar
1754using a JOnAS EJB container. This example does require the deployment
1755descriptors to use the naming standard. This will create only one ejb jar file -
1756'TheEJBJar.jar'.</p>
1757
1758<pre>
1759 &lt;ejbjar srcdir="${build.classes}"
1760 descriptordir="${descriptor.dir}"
1761 basejarname="TheEJBJar"&gt;
1762 &lt;jonas destdir="${deploymentjars.dir}"
1763 jonasroot="${jonas.root}"
1764 suffix=".jar"
1765 classpath="${descriptorbuild.classpath}"/&gt;
1766 &lt;include name="**/ejb-jar.xml"/&gt;
1767 &lt;exclude name="**/jonas-ejb-jar.xml"/&gt;
1768 &lt;/ejbjar&gt;
1769</pre>
1770
1771
1772
1773
1774</body>
1775
1776</html>
Note: See TracBrowser for help on using the repository browser.