Version 9.6
 —  EntireX Wrapper for Enterprise JavaBeans  —

Using the EntireX Wrapper for Enterprise JavaBeans

This document covers the following topics:


Generation Process

To generate the Enterprise JavaBeans (EJB) source code, use the EntireX Workbench. This can be done interactively with the UI of the EntireX Workbench. The generation is controlled by the following properties:

Default Properties for the IDL File

Description Data Type Default Value
Broker ID String Localhost:1971
Server class String RPC
Service class String SRV1
Service name String CALLNAT
Package name String IDL file name without extension
Package name prefix String empty string

Generated Files

During the generation process for each library with the name <libname>, the following interfaces and classes source files are created in the subdirectory EJB of the home directory of the <name>.idl file.

To build the JAR files for the different application servers, we generate an Ant script which uses the XDoclet tool. This file will be generated in the EJB subdirectory:

<Package Name Prefix><Package Name>.xml

If the package prefix/name contains dots, subdirectories will be created, for example: abc.def.library will become abc/def/library/...

Top of page

Using the Wrapper for EJB Interactively

Using the Wrapper for EJB Functions

Start of instruction setTo use the Wrapper for EJB functions

  1. Open the EntireX Workbench.

  2. Create a new Java Project (e.g.: "EJB"), using File > New > Project.

    graphics/ejb1a.png

  3. Add the EntireX classes to the build path of the project (entirex.jar).

    graphics/ejb1b.png

    graphics/ejb1c.png

  4. Add the Enterprise JavaBeans classes to the build path of the project (e.g.: j2ee.jar).

    graphics/ejb1d.png

    graphics/ejb1e.png

  5. Import the IDL file into the project.

    graphics/ejb1f.png

    graphics/ejb1g.png

    graphics/ejb1h.png

  6. Activate the example.idl file.

    graphics/ejb1i.png

Setting/Modifying EntireX Enterprise JavaBeans Preferences

Start of instruction setTo set/modify the preferences

  1. Display the Preferences window.

    graphics/ejb6.png

    graphics/ejb6a.png

    graphics/ejb6b.png

Setting/Modifying IDL File Properties

Start of instruction setTo set/modify the properties

  1. Display the Properties window; use either the pop-up menu or, from the File menu, choose Properties.

  2. In the Properties window, choose the EntireX tab.

    Here it is possible to modify the common default properties for the IDL file.

  3. Choose the EntireX Wrapper for Enterprise JavaBeans tab.

    Here it is possible to modify the defaults (see table Default Properties for the IDL File, below).

  4. Confirm the entries with OK.

Start of instruction setTo generate the EJB sources

  1. From the context menu, choose Generate EJB from Software AG IDL > Enterprise JavaBeans 2.0.

  2. All generated EJB sources are in the subdirectory EJB of the home directory of the IDL file.

Top of page

Generated Classes and Interfaces

The workbench generates the following interfaces and classes from the Software AG IDL file sources.

Home Interface

The generated home interfaces EJB<libname>Home.java contain the create methods. These methods can be called by an EJB client.

create()

EJB<libname> create()

Calling this method creates an EJB with the default settings.

create( String user )

EJB<libname> create(String user)

where: String user is the Broker user name

Calling this method creates an EJB with the default settings except for the user name.

create( String user, String password )

EJB<libname> create(String user,String password)

where: String user is the Broker user name and String password the Broker user password

Calling this method creates an EJB with the default settings except for the user name and the password.

Remote Interface

The generated remote interfaces EJB<libname>.java contain the customer methods. For each RPC program a customer method is generated with the following naming conventions.

<libname><program>Output <program> (<libname><program>Input input)

where: Output is the output object and Input is the input object

These methods can be called by an EJB client.

EJB Class

The generated EJB class EJB<libname>Bean.java extends <libname>Mapper.java class. Bean implements the EJB session bean and controls the EntireX RPC communication.

Mapper Class

The generated <libname>Mapper.java class extends the Java RPC client stub <libname>.java. It implements a method for each RPC Program. Methodname is <program>. The method has one parameter, an instance of <libname><progname>Input.class.The return value of the method is an instance of <libname><progname>Output.class.

Group Classes

The group classes are serializable representations of the inner classes of the groups of the RPC library, filename is <libname><progname><innerclassname>.java. The class contains all parameters of the group.

Struct Classes

The struct classes are serializable representations of the inner classes of the structs of RPC library, filename is <libname><innerclassname>.java. The class contains all parameters of the struct.

Input/Output Classes

These classes are serializable representations of all in, out, in/out parameters of RPC program. The filename of the input classes is <libname><progname>Input.java, it holds all in and in/out parameters of the program.The filename of the output classes is <libname><progname>Output.java, it holds all out and in/out parameters of the program.

Java RPC Client Stub

The generated Java RPC Stub <libname>.java extends com.softwareag.entirex.aci.RPCService class. It is the connecting link between the EJB and the EntireX server.

Example

Top of page

Delivered Example

An example is delivered in directory <drive>:\SoftwareAG\EntireX\examples\EJBWrapper (Windows) or
/opt/softwareag/EntireX\examples\EJBWrapper (UNIX).

See the README.TXT.

Top of page