BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Jolt   |   Topic List   |   Previous   |   Next   |   Contents   |   Index

   Using BEA Jolt

Class Library Functionality Overview

The Jolt Class Library gives the BEA Tuxedo application developer the tools to develop client-side applications or applets that run as independent Java applications or in a Java-enabled Web browser. The bea.jolt package contains the Jolt Class Library. To use the Jolt Class Library, the client program or applet must import this package. For an example of how to import the bea.jolt package, refer to the listing Jolt Transfer of Funds Example (SimXfer.java).

Java Applications vs. Java Applets

Java programs that run in a browser are called applets. Applets are small, easily downloaded parts of an overall application that perform specific functions. Many popular browsers impose limitations on the capabilities of Java applets in order to provide a high degree of security for the users of the browser. Applets have the following restrictions:

Programming workarounds exist for most restrictions on Java applets. Check your browser's Web site (for example, www.netscape.com or www.microsoft.com) or developer documentation for specific information about the applet capabilities that the browser supports or restricts. You can also use Jolt Relay to work around some of the network connection restrictions.

A Java application, however, is not run in the context of a browser and is not restricted in the same ways. For example, a Java application can start another application on the host machine where it is executing. While an applet relies on the windowing environment of a browser or appletviewer for much of its user interface, a Java application requires that you create your own user interface. An applet is designed to be small and highly portable. A Java application, on the other hand, can operate much like any other non-Java program. The security restrictions for applets imposed by various browsers and the scope of the two program types are the most important differences between a Java application and a Java applet.

Jolt Class Library Features

The Jolt Class Library has the following characteristics:

Error and Exception Handling

The Jolt Class Library returns both Jolt interpreter and BEA Tuxedo errors as exceptions. The Jolt Class Library Reference contains the Jolt classes and lists the errors or exceptions thrown for each class. The API Reference in Javadoc contains the Error and Exception Class Reference.

Jolt Client/Server Relationship

BEA Jolt works in a distributed client/server environment and connects Java clients to BEA Tuxedo based applications.

The following figure illustrates the client/server relationship between a Jolt program and the Jolt Server.

Jolt Client/Server Relationship

.

As illustrated in the figure, the Jolt Server acts as a proxy for a native BEA Tuxedo client, implementing functionality available through the native BEA Tuxedo client. The BEA Jolt Server accepts requests from BEA Jolt clients and maps those requests into BEA Tuxedo service requests through the BEA Tuxedo ATMI interface. Requests and associated parameters are packaged into a message buffer and delivered over the network to the BEA Jolt Server. The BEA Jolt Connection Manager handles all communication between the BEA Jolt Server and the BEA Jolt applet using the BEA Jolt Transaction Protocol. The BEA Jolt Server unpacks the data from the message, performs any necessary data conversions, such as numeric format conversions or character set conversions, and makes the appropriate service request to BEA Tuxedo as specified by the message.

Once a service request enters the BEA Tuxedo system, it is executed in exactly the same manner as any other BEA Tuxedo request. The results are returned through the ATMI interface to the BEA Jolt Server, which packages the results and any error information into a message that is sent to the BEA Jolt client applet. The BEA Jolt client then maps the contents of the message into the various BEA Jolt client interface objects, completing the request.

On the client side, the user program contains the client application code. The Jolt Class Library packages a JoltSession and JoltTransaction, which in turn handle service requests.

The following table describes the client-side requests and Jolt Server-side actions in a simple example program.

Jolt Client/Server Interaction

Jolt Client

Jolt Server

1

attr=new JoltSessionAttributes();

attr.setString(attr.APPADDRESS, "//myhost:8000");

Binds the client to the BEA Tuxedo environment

2

session=new JoltSession(attr, username, userRole, userPassword, appPassword);

Logs the client onto BEA Tuxedo

3

withdrawal=new JoltRemoteService( servname, session );

Looks up the service attributes in the Repository

4

withdrawal.addString("accountnumber", "123");

withdrawal.addFloat("amount", (float) 100.00);

Populates variables in the client (no Jolt Server activity)

5

trans=new JoltTransaction( time-out, session);

Begins a new Tuxedo transaction

6

withdrawal.call(trans);

Executes the BEA Tuxedo service

7

trans.commit() or trans.rollback();

Completes or rolls back transaction

8

balance=withdrawal.getFloatDef("balance," (float) 0.0);

Retrieves the results (no Jolt Server activity)

9

session.endSession();

Logs the client off of BEA Tuxedo

The following tasks summarize the interaction shown in the previous table, Jolt Client/Server Interaction.

  1. Bind the client to the BEA Tuxedo environment using the JoltSessionAttributes class.

  2. Establish a session.

  3. Set variables.

  4. Perform the necessary transaction processing.

  5. Log the client off of the BEA Tuxedo system.

Each of these activities is handled through the use of the Jolt Class Library classes. These classes include methods for setting and clearing data and for handling remote service actions. Jolt Object Relationships describes the Jolt Class Library classes in more detail.