You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ejb.html 70 KiB

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