bea.com | products | dev2dev | support | askBEA
 Download Docs 
 Search 

Programming Guide

 Previous Next Contents Index View as PDF  

Introduction to Generating Applications

Integrating applications that run on the mainframe with applications that run within BEA WebLogic Server requires solving three significant problems:

WebLogic JAM provides Java classes that transform data to and from the native binary data types of the mainframe. WebLogic JAM provides a software development tool that allows you to generate Java applications. These generated Java applications include data translation code (DataViews) that translates data between Java and mainframe data formats. These generated Java applications also contain the methods needed to invoke mainframe applications, or to be invoked by mainframe applications, in conjunction with WebLogic JAM.

This section discusses the following topics:

 


Understanding How WebLogic JAM Uses DataViews

In order to request services from the mainframe, WebLogic JAM must know the data formats required by these services. These data formats are usually available as COBOL copybooks.

Mainframe data records are represented in WebLogic JAM by Java DataViews. These DataViews are generated by the eGen Application Generator (hereafter referred to as the eGen utility) and provide all of the data translation necessary to communicate with mainframe applications. The eGen utility parses a COBOL copybook and generates Java DataView code that captures the data record described in the copybook. (For more information on the eGen utility, see Understanding eGen.)

Figure  1-1 illustrates how WebLogic JAM uses DataViews. This illustration shows the COBOL copybook on the mainframe side, which contains the data formats for the mainframe services. When a request is made for a Java service, the data is passed through the communications components, which are described in more detail in the BEA WebLogic Java Adapter for Mainframe Introduction. As part of this process, the WebLogic JAM Gateway initializes a DataView, performing the proper translation of the data. The data is utilized by the Java applications in the form of the DataView.

When the response is sent back, the WebLogic JAM Gateway translates the data back into the copybook format and sends it back to the mainframe.

Figure 1-1 How WebLogic JAM Uses DataViews


 

 


Understanding How WebLogic JAM Provides Programmatic Access to Services

Using WebLogic JAM, BEA WebLogic Server applications can make requests for mainframe services and receive responses to those requests. Applications in which these types of requests are made are referred to as WebLogic Server to Mainframe Applications. Also, mainframe applications can make requests from Java applications (EJBs) running in WebLogic Server and receive responses to those requests. Applications in which these types of requests are made are referred to as Mainframe to WebLogic Server Applications.

WebLogic JAM provides an API that allows Java applications running under WebLogic Server to invoke services running on the mainframe. All such requests for mainframe services are made by calling the callService() method of the EgenClient class. The Java applications generated by the eGen utility contain a method that calls the callService() method of the EgenClient class. These generated applications can access the callService() method by either being extensions of the EgenClient class or having an EgenClient class as a member. Instead of using the eGen utility to generate application code, you can also write your own applications that make requests of mainframe services by calling the callService() method (see Performing Your Own Data Translation.)

WebLogic JAM provides an API that allows clients running on the mainframe to invoke services provided by stateless session EJBs running under WebLogic Server and receive responses to those requests. EJBs that can be invoked by WebLogic JAM on behalf of mainframe clients extend the EgenServerBean class. The WebLogic JAM Gateway calls the dispatch() method of the EgenServerBean class when a request is made from a mainframe client. The server EJBs generated by the eGen utility extend the EgenServerBean class. They also provide an implementation of the dispatch() method that includes the necessary data transformation, as well as making a call to the method that actually performs the business logic. You can write your own EJBs to service mainframe requests by extending the EgenServerBean class and implementing the dispatch() method.

WebLogic JAM also provides the ability for mainframe clients to queue messages on JMS queues and topics. No coding is necessary for this; it is simply a matter of configuration (see WebLogic JAM to JMS).

 


Application Model Overview

This guide provides four Java application models you can use as guides for creating your own applications. The following sections give you a brief overview of these models:

Mainframe to WebLogic Server Application Models

In a Mainframe to WebLogic Server application, a request originates from a mainframe and is serviced by an EJB invoked by a WebLogic JAM Gateway.

The following Mainframe to WebLogic Server application model is discussed in this guide:

WebLogic Server to Mainframe Application Models

In a WebLogic Server to Mainframe application, a request originates on a WebLogic client or server, and is serviced by a mainframe program invoked by the WebLogic JAM Gateway in cooperation with the CRM.

The following WebLogic Server to Mainframe application models are discussed in this guide:

 


Roadmap for WebLogic JAM Programming

The steps outlined in Figure  1-2 provide you with a high-level guideline to all of the tasks and processes that you must perform to generate applications using WebLogic JAM. You can think of these steps as a roadmap to guide you through the process and to point you to the resources available to help you.

Figure 1-2 Roadmap for JAM Programming


 

  1. Analyze the application and determine if it is Mainframe to WebLogic Server or WebLogic Server to Mainframe. If the application is WebLogic Server to Mainframe, decide which model you are going to use (see WebLogic Server to Mainframe Application Models for more information).

  2. Obtain or create a COBOL copybook (see Obtaining a COBOL Copybook for more information).

  3. Write the eGen script. The eGen script has two parts. The first part defines the DataView. The second part defines the application code (see Writing an eGen Script for more information).

  4. Use the COBOL copybook and the eGen script as input for the eGen utility. This produces the DataView and the application code (see Processing eGen Scripts with the eGen Utility for more information).

  5. Customize the application code. This can be done by extending the code to perform the tasks required for your application (see Basic Programming Techniques for more information).

 

Back to Top Previous Next