Processing Java code that is generated into a directory
This page describes how to process code that is generated into a directory. It is recommended, however, that you avoid generating code into a directory; for details see Generation of Java code into a project.
To generate code into a directory, specify the build descriptor option genDirectory and avoid specifying the build descriptor option genProject.
Your next tasks depend on the project type:
- Application client project
- For an application client project, do as follows:
- Provide preparation-time access to EGL jar files by adding the following entries to the project's Java build path:
EGL_GENERATORS_PLUGINDIR/runtime/fda6.jar EGL_GENERATORS_PLUGINDIR/runtime/fdaj6.jarFor details on the variable at the beginning of each entry, see Setting the variable EGL_GENERATORS_PLUGINDIR.
- Provide run-time access to fda6.jar, fdaj6.jar, and (if you are calling the generated program by way of TCP/IP) EGLTcpipListener.jar:
- Access the jar files from the following directory:
installationDir\egl\eclipse\plugins\ com.ibm.etools.egl.generators_version\runtime
- installationDir
- The product installation directory, such as C:\Program Files\IBM\RSPD\6.0. If you installed and kept a Rational Developer product before installing the product that you are using now, you may need to specify the directory that was used in the earlier install.
- version
- The installed version of the plugin; for example, 6.0.0
Copy those files into each enterprise application project that references the application client project.
- Update the manifest in the application client project so that the jar files (as stored in an enterprise application project) are available.
- Provide access to non-EGL jar files (an optional task)
- Import your generated output into the project, in keeping with these rules:
- The folder appClientModule must include the top-level folder of the package that contains your generated output
- The hierarchy of folder names beneath appClientModule must match the name of your Java package
If you are importing generated output from package my.trial.package, for example, import that output into a folder that resides in the following location:
appClientModule/my/trial/package- If you generated a J2EE environment file, update that file
- Update the deployment descriptor
- Now that you have placed output files in a project, continue setting up the J2EE run-time environment
- EJB project
- For an EJB project, do as follows:
- Provide preparation-time access to EGL jar files (fda6.jar and fdaj6.jar) by adding the following entries to the project's Java build path:
EGL_GENERATORS_PLUGINDIR/runtime/fda6.jar EGL_GENERATORS_PLUGINDIR/runtime/fdaj6.jarFor details on the variable at the beginning of each entry, see Setting the variable EGL_GENERATORS_PLUGINDIR.
- Provide run-time access to the EGL jar files:
- Access fda6.jar and fdaj6.jar from the following directory:
installationDir\egl\eclipse\plugins\ com.ibm.etools.egl.generators_version\runtime
- installationDir
- The product installation directory, such as C:\Program Files\IBM\RSPD\6.0. If you installed and kept a Rational Developer product before installing the product that you are using now, you may need to specify the directory that was used in the earlier install.
- version
- The installed version of the plugin; for example, 6.0.0
Copy those files into each enterprise application project that references the EJB project.
- Update the manifest in the EJB project so that fda6.jar and fdaj6.jar (as stored in an enterprise application project) are available.
- Provide access to non-EGL jar files (an optional task)
- Import your generated output into the project, in keeping with these rules:
- The folder ejbModule must include the top-level folder of the package that contains your generated output
- The hierarchy of folder names beneath ejbModule must match the name of your Java package
If you are importing generated output from package my.trial.package, for example, import that output into a folder that resides in the following location:
ejbModule/my/trial/package- If you generated a J2EE environment file, update that file.
- Update the deployment descriptor
- Set the JNDI name
- Generate deployment code
- Now that you have placed output files in a project, continue setting up the J2EE run-time environment
- J2EE Web project
- For a Web project, do as follows:
- Provide access to EGL jar files by copying fda6.jar and fdaj6.jar into your Web project folder. To do so, import the external jars found in the following directory:
installationDir\egl\eclipse\plugins\ com.ibm.etools.egl.generators_version\runtime
- installationDir
- The product installation directory, such as C:\Program Files\IBM\RSPD\6.0. If you installed and kept a Rational Developer product before installing the product that you are using now, you may need to specify the directory that was used in the earlier install.
- version
- The installed version of the plugin; for example, 6.0.0
The destination for the files is the following project folder:
WebContent/WEB-INF/lib- Provide access to non-EGL jar files (an option)
- Import your generated output into the project, in keeping with these rules:
- The folder WebContent must include the top-level folder of the package that contains your generated output
- The hierarchy of folder names beneath WebContent must match the name of your Java package
If you are importing generated output from package my.trial.package, for example, import that output into a folder that resides in the following location:
WebContent/my/trial/package- Update the deployment descriptor
- Now that you have placed output files in a project, continue setting up the J2EE run-time environment
- Java project
- If you are generating code for use in a non-J2EE environment, you generate a properties file if you use the following combination of build descriptor options:
- genProperties is set to GLOBAL or PROGRAM; and
- J2EE is set to NO.
If you request a global properties file (rununit.properties), EGL places that file in the top-level directory. If you request a program properties file instead, EGL places that file with the program, either in the folder that corresponds to the last qualifier in the package name or in the top-level directory. (The top-level directory is used if the package name is not specified in the EGL source file.)
At run time, values in the program properties file are used to set up a standard JDBC connection. For details, see Understanding how a standard JDBC connection is made.
For a Java project, your tasks are as follows:
- Provide access to EGL jar files by adding the following entries to the project's Java build path:
EGL_GENERATORS_PLUGINDIR/runtime/fda6.jar EGL_GENERATORS_PLUGINDIR/runtime/fdaj6.jarFor details on the variable at the beginning of each entry, see Setting the variable EGL_GENERATORS_PLUGINDIR.
- If your program accesses a relational database, make sure that your Java build path includes the directory where the driver is installed. For DB2, for example, specify the directory that contains db2java.zip.
- If your generated code accesses MQSeries, provide access to non-EGL jar files
- Make sure that the program properties file (if present) is in the top-level project folder and that the global properties file (rununit.properties, if present) is either in the folder that corresponds to the last qualifier in the package name or in the top-level project folder. (The top-level folder is used if the package name is not specified in the EGL source file.)
- Place a linkage properties file in the project (an optional task)
Related concepts
Generation of Java code into a project
Related tasks
Generating deployment code for EJB projects
Deploying a linkage properties file
Setting deployment-descriptor values
Providing access to non-EGL jar files
Setting the JNDI name for EJB projects
Setting the variable EGL_GENERATORS_PLUGINDIR
Setting up the J2EE run-time environment for EGL-generated code
Understanding how a standard JDBC connection is made
Updating the deployment descriptor manually
Updating the J2EE environment file
Related reference
genDirectory
genProject