Task:
   Websphere

Rationale:
   To automate Websphere 4.0 EJB builds.

Sources affected:
   EjbJar.java- org.apache.tools.ant.taskdefs.optional.ejb (MODIFIED)
   WebsphereDeploymentTool.java - org.apache.tools.ant.taskdefs.optional.ejb
(CREATED)

Prerequisites:
   Apache Ant 1.3
   IBM Websphere 4.0 Advanced Edition (http://www.ibm.com/vadd)
   IBM DeployTool (http://www.ibm.com/vadd)

Attachments:
   EjbJar.java
   WebsphereDeploymentTool.java
   websphere.htm: Documentation page, augments the ejbjar task description
   test-websphere.zip: Contains sources, build script

--Maneesh Sahu
www.interkeel.com

Attachment: EjbJar.java
Description: Binary data

Attachment: WebsphereDeploymentTool.java
Description: Binary data

Title: Websphere Task

EjbJar- Vendor-specific deployment elements

Each vendor-specific nested element controls the generation of a deployable jar specific to that vendor's EJB container. The parameters for each supported deployment element are detailed here.

Websphere element

The websphere element is used to control the websphere.ejbdeploy tool for generating websphere EJB jars. The task expects the following deployment desciptors to be located in the same directory as the rest of the EJB Java files and the generic J2EE EJB deployment descriptor- ejb-jar.xml:

       Extensions descriptor file for the EJB- ibm-ejb-jar-ext.xmi

       Bindings for the EJB- ibm-ejb-jar-bnd.xmi

       Schema XMI for CMP beans- Schema.dbxmi

       Mapping for the CMP fields to the Schema � Map.mapxmi

Each of these elements should be prefixed with the EJB name. To support multiple database vendor deployment, the schema and mapping files should also contain the database vendor name.

Attribute

Description

Required

destdir

The base directory into which the generated websphere ready jar files are deposited. Jar files are deposited in directories corresponding to their location within the descriptordir namespace.

Yes

genericjarsuffix

A generic jar is generated as an intermediate step in build the websphere deployment jar. The suffix used to generate the generic jar file is not particularly important unless it is desired to keep the generic jar file. It should not, however, be the same as the suffix setting.

No, defaults to '-generic.jar'.

suffix

String value appended to the basename of the deployment descriptor to create the filename of the Websphere EJB jar file.

No, defaults to '.jar'.

classpath

The classpath to be used when running the websphere ejbdeploy tool. The deploytool allows only jar or zip files to be specified in the classpath and ignores entries specified in directories.

No

keepgeneric

This controls whether the generic file used as input to ejbdeploy is retained.

No, defaults to false

compiler

This allows for the selection of a different compiler to be used for the compilation of the generated Java files. This could be set, for example, to Jikes to compile with the Jikes compiler.

No

rebuild

This flag controls whether websphere.ejbdeploy is always invoked to build the jar file. In certain circumstances, such as when only a bean class has been changed, the jar can be generated by merely replacing the changed classes and not rerunning ejbdeploy. Setting this to false will reduce the time to run ejbjar.

No, defaults to true.

keepgenerated

Controls whether websphere will keep the generated Java files used to build the class files added to the jar. This can be useful when debugging

No, defaults to false.

args

Any additional arguments to be passed to the websphere.ejbdeploy tool.

No.

dbvendor

Sets the database vendor type, permissible values include:

  • SQL92
  • SQL99
  • DB2UDBWIN_V71
  • DB2UDBOS390_V6
  • DB2UDBAS400_V4R5
  • ORACLE_V8
  • INFORMIX_V92
  • SYBASE_V1192
  • MSSQLSERVER_V7
  • MYSQL_V323

No.

dbname

The name of the database to create, for top-down mapping of CMP beans only.

No.

dbschema

The name of the schema to create, for top-down mapping of CMP beans only.

No.

quiet

If true- only output errors and suppress informational messages

No, defaults to true.

tempdir

The scratch directory used by the ejbdeploy tool.

No, defaults to �_ejbdeploy_temp�

rmic

Sets additional options to use for RMIC.

No.

The websphere nested element itself support the nested <classpath> element which is used to set the additional classpath for the websphere.ejbdeploytool. This nested element is useful when setting up class paths using reference Ids.

Examples

This example shows ejbjar being used to generate deployment jars using a Weblogic EJB container. This example requires the naming standard to be used for the deployment descriptors. Using this format will create a ejb jar file for each variation of '*-ejb-jar.xml' that is found in the deployment descriptor directory.

��� <ejbjar srcdir="${build.classes}"
����������� descriptordir="${descriptor.dir}">
����� <websphere destdir="${deploymentjars.dir}"
�������������� classpath="${descriptorbuild.classpath}"/>
����� <include name="**/*-ejb-jar.xml"/>
��� </ejbjar>

 

The next example shows how EJB Jar generation for the Oracle database can be performed.

��� <ejbjar srcdir="${build.classes}"
����������� descriptordir="${descriptor.dir}">
����� <websphere dbvendor="ORACLE_V8" destdir="${deploymentjars.dir}"
��������������� classpath="${descriptorbuild.classpath}"/>
����� <include name="**/*-ejb-jar.xml"/>
��� </ejbjar>

<<attachment: test-websphere.zip>>

Reply via email to