Generation of Java code into a project

If you are generating a Java program or wrapper, it is recommended (and in some cases required) that you set build descriptor option genProject, which causes generation into a project.

EGL provides various services for you when you generate into a project. The services vary by project type, as do your next tasks:

Application client project

When you generate into an application client project, EGL does as follows:

  • Provides 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.jar

    For details on the variable at the beginning of each entry, see Setting the variable EGL_GENERATORS_PLUGINDIR.

  • Provides run-time access to the EGL jar files:

  • Puts run-time values into the deployment descriptor so that you can avoid cutting and pasting entries from a generated J2EE environment file; for an overview of this subject, see Setting deployment-descriptor values

Your next tasks are as follows:

  1. If you are calling the generated program by way of TCP/IP, provide run-time access to a listener, as described in Setting up the TCP/IP listener

  2. Provide access to non-EGL jar files

  3. Now that you have placed output files in a project, continue setting up the J2EE run-time environment

EJB project

When you generate into an EJB project, EGL does as follows:

  • Provides 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.jar

    For details on the environment variable at the beginning of each entry, see Setting the variable EGL_GENERATORS_PLUGINDIR.

  • Provides run-time access to the EGL jar files:

  • Assigns the JNDI name automatically so that the EGL run-time code can access the EJB code; but this step occurs only when you generate an EJB session bean.

  • In most cases, puts run-time values into the deployment descriptor so that you can avoid cutting and pasting entries from a generated J2EE environment file; for an overview of this subject, see Setting deployment-descriptor values.

    EGL does not put run-time values into the deployment descriptor if EGL cannot find the necessary session element in the deployment descriptor. This situation occurs, for example, when the Java program is generated before the wrapper or when the build descriptor option sessionBeanID is set to a value that is not found in the deployment descriptor. For details on session elements, see sessionBeanID.

Your next tasks are as follows:

  1. Provide access to non-EGL jar files

  2. Generate deployment code

  3. Now that you have placed output files in a project, continue setting up the J2EE run-time environment

J2EE Web project

EGL does as follows:

  • Provides access to EGL jar files by importing fda6.jar and fdaj6.jar into the project's Web Content/WEB-INF/lib folder

  • Puts run-time values into the deployment descriptor so that you can avoid cutting and pasting entries from a generated J2EE environment file; for an overview of this subject, see Setting deployment-descriptor values

Your next tasks are as follows:

  1. Providing access to non-EGL jar files

  2. Now that you have placed output files in a project, continue as described in Setting up the J2EE run-time environment for EGL-generated code

Java project

If you are generating into a non-J2EE Java project for debugging or production purposes, EGL does as follows:

  • Provides 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.jar

    For details on the variable at the beginning of each entry, see Setting the variable EGL_GENERATORS_PLUGINDIR.

  • Generates a properties file, but only if the build descriptor includes the following option values:

    • 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 Java source folder, which is the folder that contains the Java packages. (The Java source folder may be either a folder within the project or the project itself.) If you request a program properties file instead, EGL places that file with the program.

    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.

Now that you have placed output files in a project, do as follows:

  • 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 code accesses MQSeries, provide access to non-EGL jar files

  • Place a linkage properties file in the module

For details on the consequence of generating into a non-existent project, see genProject.

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 variable EGL_GENERATORS_PLUGINDIR
Setting up the J2EE run-time environment for EGL-generated code
Understanding how a standard JDBC connection is made

Related reference

genProject
sessionBeanID