Jolt 1.1.2 for NonStop TUXEDO Jolt 1.1.
Jolt 1.1.2 for NonStop TUXEDO Jolt 1.1.2 Manuals Jolt for NonStop TUXEDO User Guide About This Guide 1. Introducing Jolt 2. Installing Jolt 3. Configuring the Jolt System 4. Bulk Loading TUXEDO Services 5. Using the Jolt Repository Editor 6. Using the Jolt Class Library 7. Jolt Class Library Reference A. Jolt Class Library Errors and Exceptions B.
Jolt 1.1.2 for NonStop TUXEDO Jolt 1.1.2 Manuals Jolt Beans User Guide About This Guide 1. Introducing the JoltBeans Toolkit 2. Installing JoltBeans 3. Using JoltBeans 4. JoltBeans Toolkit Class Library Reference 5.
Jolt 1.1.2 for NonStop TUXEDO Jolt 1.1.2 Manuals WAS (Web Application Services) User Guide About This Guide 1. Introducing the Jolt Web Application Services 2. Installing the Jolt Web Application Services 3. Using the Web Application Services With Microsoft Active Server Pages 4. Web Application Services Class Library Reference 5.
About This Guide This guide describes the Jolt for NonStop TUXEDO product, discusses how to use the Jolt system, and defines messages and terms associated with using the product. Who Should Read This Guide This guide is intended for system administrators, network administrators, and developers interested in extending secure, scalable transaction-based processing from the enterprise to intranet and Internet wide availability. It assumes a familiarity with NonStop TUXEDO and Java programming.
Related Documentation ● JoltBeans User Guide, which describes the JoltBeans component of Jolt for NonStop TUXEDO. ● WAS (Web Application Services) User Guide, which describes the WAS (Web Application Services) component of Jolt for NonStop TUXEDO. ● NonStop TUXEDO Reference, which contains the online descriptions of the commands, utilities, and routines that make up the NonStop TUXEDO administrative and programmatic interfaces.
1. Introducing Jolt The Jolt product is a Java-based interface to the NonStop TUXEDO system that extends TUXEDO services to the Internet. Jolt allows you to build client programs and applets that can remotely invoke existing NonStop TUXEDO services allowing application messaging, component management, and distributed transaction processing.
services. These Repository definitions are used by Jolt at runtime to access TUXEDO services. Using the Repository Editor, you can test new and existing NonStop TUXEDO services independently of the client applications. You can export services to a Jolt client application or unexport services by hiding the definitions from the Jolt client. ● Jolt Internet Relay. The Jolt Internet Relay is a component that routes messages from a Jolt client to a Jolt Server Listener (JSL) or Jolt Server Handler (JSH).
Encryption for Secure Transaction Processing. Jolt allows you to encrypt data transmitted between Jolt clients and the JSL/JSH. When you enable encryption support, Jolt 1.1 uses a combination of DES and RC4 encryption algorithms to encrypt all data that is transmitted between a Jolt client and a Jolt server. DES (56-bit) encryption is used for key exchange and authentication, and RC4 is used for all subsequent data exchanges. Jolt 1.
such as INQUIRY, WITHDRAW, TRANSFER, and DEPOSIT. Typically, service requests are implemented in C or COBOL as a sequence of calls to a program library. Accessing a library from a native program means installing the library for the specific combination of CPU and operating system release on the client machine, a situation Java was expressly designed to avoid. The Jolt Server implementation acts as a proxy for the Jolt client, invoking the TUXEDO service on behalf of the client.
also updates or adds Jolt service definitions. Figure 1-2 illustrates the Jolt Server and Jolt Repository components. Figure 1-2. Jolt Server Components Jolt Class Library for Java The Jolt Class Library is a set of classes you can use in your Java application or applet to make service requests to the TUXEDO system from a Java enabled client. These Jolt classes allow you to access TUXEDO transaction services using objects.
The following table briefly describes the flow of activity involved in using the Jolt Class Library to access TUXEDO services. Table 1-1. Using the Jolt Class Library Process Step Action Connection 1. A Java enabled Web browser downloads an HTML page using the HTTP protocol. 2. A Jolt applet is downloaded and executed in the Java Virtual Machine on the client. 3. The first Java applet task is to open a separate connection to the Jolt Server using a private protocol. 4.
and delivered over the network to the Jolt Server. 2. The Jolt Server unpacks the data from the message, and performs any data conversions necessary, such as numeric format conversions or character set conversions. 3. The Jolt Server makes the appropriate service request to the application service requested by the Jolt client. 4. Once a service request enters the NonStop TUXEDO system, it is executed in exactly the same manner as requests issued by any other TUXEDO client. 5.
you can define, test, and export services to Jolt clients. The Jolt Repository Editor enables you to extend and distribute TUXEDO services to Jolt clients without having to modify many lines of code in widely distributed client applications. With the Jolt Repository Editor, you can modify parameters for TUXEDO services, logically group TUXEDO services into packages, and remove services from created packages.
The following steps show just how quickly and easily Jolt clients can be created and deployed. 1. Begin the process with a TUXEDO system application. For information about installing TUXEDO and creating a TUXEDO application, refer to the TUXEDO System 6 documentation set. 2. Install the Jolt system. For information about installing Jolt components, refer to the readme.txt file on the Jolt CD-ROM. 3. Configure and define services using the Jolt Repository Editor. 4.
5. Create a client application using the Jolt Class Library. The following documentation shows you how to program your client application using the Jolt Class Library: ● Section 6, Using the Jolt Class Library ● Section 7, Jolt Class Library Reference ● Appendix A, Jolt Class Library Errors and Exceptions 6. Run the Jolt-based client applet or application. Refer to Section 6, Using the Jolt Class Library to assist you in installing a Jolt Class Library on a Web Server.
2. Installing Jolt Jolt for NonStop TUXEDO must be installed in the Open System Services (OSS) environment on a NonStop Kernel system. For information about installing Jolt on OSS, refer to the readme.txt file on the Jolt CD-ROM.
3. Configuring the Jolt System This chapter explains how to configure Jolt 1.1 and describes the Jolt Internet Relay, Event Subscription, and security features. Readers of this chapter are assumed to be system administrators and/or application developers who have experience with the operating systems and workstation platforms on which they are going to configure TUXEDO and Jolt.
DES encryption, even though the data encryption is using a 128-bit key. International packages use a 40-bit session encryption key, and 56/128-bit encryption cannot be enabled. Starting the Jolt Server Type tmloadcf and tmboot -y to start all administrative and server processes. (The prompt only displays when the command is entered with none of the limiting options). See the NonStop TUXEDO Administration Guide for information on tmloadcf and tmboot.
Note Ensure that Resource Managers are not assigned as a default value for all groups in the *GROUPS section of your UBBCONFIG file. This will assign a Resource Manager to the JSL and you will receive an error during tmboot. In the *SERVERS section, default values for RESTART, MAXGEN, etc., are acceptable defaults for the JSL. *MACHINES Section The MAXWSCLIENTS parameter is required in the *MACHINES section for the configuration file and applies to specific machines.
Caution If you include the RQADDR parameter, do not specify "JSL" as its value. Enter the following parameters: 1. To identify the SRVGRP parameter, type the previously defined group name value from the *GROUPS section. 2. To indicate the SRVID, type a number between 1 and 30,000 that identifies the server within its group. 3. Verify that the syntax for the CLOPT parameter is as follows: CLOPT= "-- -n 0x0002PPPPNNNNNNNN -d /dev/tcp -m2 -M4 -x10" Note The CLOPT parameters may vary.
[-c connection_mode] Allowed connection modes from clients: RETAINED - the network connection is retained for the full duration of a session. RECONNECT - the client establishes and brings down a connection when an idle timeout is reached, reconnecting for multiple requests within a session. ANY - the server allows a client to request either a RETAINED or RECONNECT type of connection for a session. Default is ANY. (Optional) [-d device_name] The device for platforms using the Transport Layer Interface.
Specify the network address in one of three formats: ● Hexadecimal address A hexadecimal address has the form 0X0002ppppPPSSssnn where pppp is the 4-digit hexadecimal port number, PP is the 2-digit hexadecimal provider number, SS is the 2-digit hexadecimal subscriber number, ss is the 2-digit hexadecimal subnet number, and nn is the 2-digit hexadecimal node number. ● Dotted address A dotted address has the form "//prov.subs.subnet.
[-XC cmp-thresh] Enable application data sent between a Jolt client and a Jolt server (JSH) to be compressed during transmission over the network. cmp-thresh is a number between 0 and 2147483647. Any messages that are larger than the specified number of bytes are compressed before transmission. The default is 0 (no compression); that is, if cmp-thresh is not specified, Jolt does not compress messages on client or server.
*GROUPS JREPGRP GRPNO=94 LMID=SITE1 *SERVERS JREPSVR SRVGRP=JREPGRP SRVID=98 RESTART=Y GRACE=0 CLOPT="-A -- -W -P /app/jrepository" JREPSVR SRVGRP=JREPGRP SRVID=97 RESTART=Y RQADDR=JREPQ GRACE=0 CLOPT="-A -- -P /app/jrepository" JREPSVR SRVGRP=JREPGRP SRVID=96 RESTART=Y RQADDR=JREPQ REPLYQ=Y GRACE=0 CLOPT="-A -- -P /app/jrepository" Change the following sections of the UBBCONFIG file: Section Parameters to be specified *GROUPS LMID, GRPNO *SERVERS SRVGRP, SRVID *GROUPS Section A *GROUPS entry is requi
A Repository file, jrepository, is available with Jolt 1.1. This file includes bankapp services and the Repository services that you can modify, test, and delete using the Repository Editor. Start with the jrepository file provided with the installation, even if you are not going to test the bankapp application with Jolt. Delete the bankapp packages or services that are not needed. The pathname of the file must match the argument of the -P option.
Configuration Configure the TUXEDO TMUSREVT server and modify the application UBBCONFIG file. Example 3-3 shows the relevant portions TMUSREVT parameters in the UBBCONFIG file. See the TUXEDO Programmer's Guide for information regarding the syntax of the entries for the file. Example 3-3. Sample UBBCONFIG File for TMUSREVT TMUSREVT SRVGRP=EVBGRP1 SRVID=40 GRACE=3600 ENVFILE="/usr/tuxedo/bankapp/TMUSREVT.ENV" CLOPT="-e tmusrevt.out -o tmusrevt.out -A --f /usr/tuxedo/bankapp/tmusrevt.
For additional information on event subscriptions and the Jolt Class Library, refer to Section 6, Using the Jolt Class Library. Jolt Internet Relay The Jolt Internet Relay is a component that routes messages from a Jolt client to a JSL or JSH. This eliminates the need for the JSH and TUXEDO to run on the same machine as the Web server (generally considered as insecure). The Jolt Relay (JRLY) is not a TUXEDO server or a TUXEDO client.
Jolt Relay (JRLY) The JRLY (front-end relay) process may be started before or after the JRAD is started. If the JRAD is not available when the JRLY is started, the JRLY attempts to connect to the JRAD when it receives a client request. If JRLY is unable to connect to the JRAD, the client is denied access and is disconnected. A warning is written to the JRLY error log file. Starting the JRLY The JRLY process is started by typing the command name at a system prompt.
Jolt Relay Adapter (JRAD) The JRAD (back-end relay) is a TUXEDO system server. The JRAD server may or may not be located on the same TUXEDO host machine (in SHM mode) and server group that the JSL server it is connected to. The JRAD can be started independently of its associated JRLY. JRAD tracks its startup and shutdown activity in the TUXEDO log file. Starting the JRAD Type tmloadcf and tmboot to start the JRAD. Configuration entry in the UBBCONFIG is described in JRAD Configuration.
JRAD -l: -c: JSL -n:
Incorrect CLOPT options can prevent JSL from starting The Jolt Server Listener (JSL) parses the CLOPT options that occur in the string CLOPT="-- optionletters" to get command-line options. The following problems can occur if you enter an incorrect option in the CLOPT line or if it already contains an incorrect option: When the JSL first encounters an incorrect option, it stops parsing the CLOPT clause and uses the options it encountered up to the incorrect one.
4. Bulk Loading TUXEDO Services This section covers the following topics: ● Introduction to the Bulk Loader ● Getting Started Using the Bulk Loader ● Syntax of the Bulk Loader Data Files ● Troubleshooting ● Sample Bulk Load Data Introduction to the Bulk Loader As a systems administrator, you may have an existing TUXEDO application with multiple TUXEDO services. Manually creating these definitions to the repository database may take hours to complete.
-r usrrole Specifies the user role (default is admin). (Mandatory if required by security) -n Validates input file against the current repository; no updates are made to the repository. (Optional) //host:port Specifies the JRLY or JSL address (host name and IP port number). (Mandatory) filename Specifies the file containing the service definitions. (Mandatory) About the Bulk Load File The bulk load file is a text file that defines services and their associated parameters.
● ● The input file may contain multiple service definitions. Each service definition consists of multiple keywords and values.
Note Services using CARRAY or STRING buffer types should only have one parameter in the service. The recommended parameter name for a CARRAY service is "CARRAY" with "carray" as the data type. For a STRING service, the recommended parameter name is "STRING" with "string" as the data type. See Section 5, Using the Jolt Repository Editor for more information. To review the service-level keywords and values, see Table 4-2. Table 4-2.
access in out inout noaccess count Maximum number of occurrences (default is 1). The value for unlimited occurrences is 0. Used only by the Repository Editor to format test screens. Troubleshooting If you encounter any problems using the bulk loader utility, see the following table. For a complete list of bulk loader utility error messages and solutions, see Appendix B, System Messages If . . . Then . . .
service=LOGIN inbuf=VIEW inview=LOGINS outview=LOGINR export=true param=user type=string access=in param=passwd type=string access=in param=token type=integer access=out service=PAYROLL inbuf=FML outbuf=FML param=EMPLOYEE_NUM type=integer access=in param=SALARY type=float access=inout param=HIRE_DATE type=string access=inout
5. Using the Jolt Repository Editor Use the Jolt Repository Editor to add, modify, test, export, and delete TUXEDO service definitions from the Repository based on the information available from the TUXEDO configuration file. The Jolt Repository Editor accepts TUXEDO service definitions, including the names of the packages, services, and parameters.
The parts of the Repository Editor window are: Part Function 1 entry fields Enter text, numbers, or alphanumeric characters such as service names, server names, or port numbers. 2 scrollable display View lists that extend beyond the display using a button. 3 display list Select from a list of predefined items such as the Parameters list or select from a list of items that have been defined.
Starting the Repository Editor Using appletviewer To start the editor using the JavaSoft appletviewer: 1. Set the CLASSPATH to include the Jolt class directory. 2. If loading the applet from a local disk, type the following at the URL location: appletviewer /RE.html If loading the applet from the Web server, type the following at the URL location: appletviewer http:////RE.html 3. Press Enter. The Repository Editor logon window displays.
The Packages and Services options are activated. The Repository Editor Logon Window Figure 5-1. Repository Editor Logon Window Option Description Server Type the server name. Port Number Type the port number in decimal value. Note that after the server name and port number are entered, the user name and password fields are activated. Activation is based on the authentication level of the TUXEDO application. Application Password TUXEDO administrative password text entry.
Main Components of the Repository Editor The Repository Editor allows you to add, modify, or delete any of the following components: ● Packages ● Services ● Parameters In addition, you can test and group Services. Repository Editor Flow After logging on to the Repository Editor, two options are enabled, Packages and Services. Figure 5-2 illustrates the Repository Editor flow to help you determine which button to select. Figure 5-2 shows the Repository Editor option flow. Figure 5-2.
● View packages and services ● Export or unexport services ● Delete packages ● Access Package Organizer to: ❍ Move services ❍ Create a new package The available packages are displayed. When a package is selected, the services contained within a package display. The Packages Window Figure 5-3. Packages Window Option Description Packages Lists available packages. Services Lists available services within the selected package.
What is a Service? A service is a definition of an available TUXEDO service. Services are comprised of parameters such as pin number, account number, payment, and rate. Adding or editing a Jolt service does not affect an existing TUXEDO service. Use the Services window to add, edit, or delete services. Figure 5-4 is an example of a Services window with the available services. The Services Window Figure 5-4.
What is a Parameter? A service is comprised of parameters, including a pin number, account number, payment, rate, term, age, or Social Security number. A parameter is one of the service components. Adding or editing a parameter does not modify or change an existing TUXEDO service. Figure 5-5 is an example of the Services window displaying a selected service and its parameters. Figure 5-5. Services Window with Parameters Viewing a Parameter Instructions 1.
choosing Back. If Back is selected before the modified information is saved, a warning briefly displays on the status line at the bottom of the window. Adding a Package If you need to add a new group of services, a new package must be created before adding the services. Figure 5-6 shows how a new package, BALANCE, is added to the Packages listing. Figure 5-6. Adding a New Package Adding a Package Instructions 1. From the Logon window, select Packages. The Packages window displays.
Option Description Service Name Adds the name of the new service to the Repository. Input Buffer Type, Output Buffer Type VIEW - a C-structure and 16-bit integer field. Contains subtypes that have a particular structure. X_C_TYPE and X_COMMON are equivalent. X_COMMON is used for COBOL and C. VIEW32 - similar to VIEW, except 32-bit field identifiers are associated with VIEW32 structure elements.
Edit Parameter An existing parameter can be edited. This option is disabled until a new parameter is selected. Delete Parameter Deletes a parameter. This option is disabled until a new parameter is selected. Adding a Service Instructions 1. From the Logon window, select Services. 2. Select the package where the service is going to be added. If you are uncertain which package should contain the new service, select a package and use the Package Organizer to move the service to a different package.
Adding a Parameter Selecting New Parameter from the Edit Services window brings up the Edit Parameters window. Review the features in Figure 5-9. Use this window to input the parameter and window information for a service. Edit Parameters Window -- Adding a Parameter Figure 5-9. Edit Parameters Window -- Adding a Parameter Option Description Field Name Adds the field name (e.g., asset, inventory).
Direction Lists choices for direction: Input - Information is directed from the client to the server. Output - Information is directed from the server to the client. Both - Information is directed from the client to the server, and from the server to the client. Occurrence Number of times that an identical field name can be used. If 0, the field name can be used an unlimited number of times. Occurrences are used by Jolt to build test screens; not to limit information sent or retrieved by TUXEDO.
WARNING If Save Service is not selected before selecting Back, the parameters are not saved as part of the service 7. Select Back to return to the previous window. Selecting CARRAY or STRING as a Parameter Data Type If CARRAY or STRING is the selected buffer type for a new service, only carray or string can be added as the data type for the accompanying parameters of a service. In this case, only one parameter can be added.
Grouping Services Using the Package Organizer The Package Organizer moves or transfers services between packages. You may want to group related services in a package (for example, WITHDRAWAL services that are exported only at a certain time of the day can be grouped together in a package). The Package Organizer arrow buttons allow you to move a service from one package to another. These buttons are useful if you have several services to move between packages.
Option Description Available Packages (left display list) Lists packages available where the service to be moved currently resides. Available Packages (right display list) Lists packages available to move the service to. Services (left display list) Lists available services for the highlighted package that can be moved. Services (right display list) Lists available services that have been moved for the highlighted package.
Note You cannot select the same package in both the left and right display lists. Modifying Packages, Services, and Parameters If a package, service, or parameter requires any modifications, you can make the following changes: ● Editing a service ● Editing a parameter ● Deleting a parameter/service/package Note The Jolt 1.1 release does not allow you to edit a package name.
Editing a Service Instructions 1. Select the package containing the service that requires editing from the Services window. 2. Select the service to edit. The parameters are displayed in the parameters display list. 3. Select Edit. The Edit Services window displays. 4. Type or select the new information and select Save Service. Editing a Parameter All parameter elements can be changed, including the name of the parameter.
WARNING If you are creating a new parameter using an existing name, the system overwrites the existing parameter. Here is an example of the Edit Parameters window.
1. Select the parameter in the Parameters window and select Edit Parameters. The Edit Parameters: Changing Existing Parameter window displays. 2. Type the new information and select Change. 3. Select Back to return to the previous window. Deleting Parameters, Services, and Packages This section details the necessary sequential steps to delete a package. Before deleting a package, all of the services must be deleted from the package.
2. Select a package. Export and Unexport are enabled. 3. To make services available, select Export. 4. To make services unavailable, select Unexport. Note The system does not display a confirmation message indicating that the service is exported or unexported. See Reviewing the Exported/Unexported Status for additional information. Reviewing the Exported/Unexported Status When a service is exported or unexported, you can review its status from the Edit Services window.
Note The Repository Editor allows you to test an existing TUXEDO service with Jolt without writing a line of Java code. An exported or unexported service can be tested; if you need to change a service and its parameters, unexport the service prior to editing. This section explains the following: ● Jolt Repository Editor Service Test Window ● Testing a Service Instructions Repository Editor Service Test Window Test the service to ensure that the parameter information is accurate.
Service Displays the name of the tested service (read-only). Parameters displayed Tracks the parameters displayed in the window (read-only). Parameter text fields The parameter information text entry field. These fields are writable or read-only. Disabled if read-only. RUN Runs the test with the data entered. Clear Clears the text entry field. Next Lists additional parameter fields, if applicable. Prev Lists previous parameter fields, if applicable. Back Returns to the Edit Services window.
5. Select Services to display the Services window. 6. Select the package and the service that requires editing and select Edit. 7. Edit the service. 8. Save the service and then go to Step 4 in the previous list. Some Reasons Why a Test Might Fail Here are some reasons why a service test might fail and possible solutions. If this . . . Do this . . . A parameter is incorrect. Edit the service. The Jolt server is down. Check the server. The TUXEDO service is down. You do not need to edit the service.
You cannot start the Repository Editor If you are running the editor in a browser and downloading the applet via http, make sure that: ● The browser is Java-enabled. ● The Web server is running and accessible. ● The RE.html file is available to the Web server. ● The RE.html file contains the correct parameter (this is where the Jolt class files are located).
6. Using the Jolt Class Library The Jolt Class Library provides developers with a set of new object-oriented Java language classes for accessing NonStop TUXEDO services. These classes allow you to extend applications for Internet and intranet transaction processing. The application developer can use the Jolt Class Library to customize access to NonStop TUXEDO services from Java applets.
Jolt Class Library Features The Jolt Class Library has the following characteristics: ● Features fully thread-safe classes. ● Encapsulates typical transaction functions such as logon, synchronous calling, transaction begin, commit, rollback, and logoffs as Java objects. ● Contains methods that allow you to set idle time-outs for continuous and intermittent client network connections. ● Features methods that allow a Jolt client to subscribe to and receive event-based notifications.
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 TUXEDO service 7 trans.commit() or trans.rollback(); Completes or rolls back transaction 8 balance = withdrawal.
As objects, the Jolt classes interact in various relationships with each other. In Figure 6-2, the relationships are divided into three basic categories: Contains-a relationship. At the class level an object can contain other objects. For example, a JoltTransaction stores (or contains) a JoltSession object. Is-a relationship. The is-a relationship usually occurs at the class instance or sub-object level and denotes that the object is an instance of a particular object. Uses-a relationship.
Transaction Begin, Commit, and Rollback In Jolt, a transaction is represented as an object of the class JoltTransaction. The transaction begins when the transaction object is instantiated. The transaction object is created with a time out and JoltSession object parameter: trans = new JoltTransaction(timeout, session) Jolt uses an explicit transaction model for any services involved in a transaction. The transaction service invocation requires a JoltTransaction object as a parameter.
trans.commit(); Example 6-1 shows an example of a simple application for the transfer of funds using the Jolt classes. Example 6-1. Jolt Transfer of Funds Example (SimXfer.java) /* Copyright 1996 BEA Systems, Inc. All Rights Reserved */ import bea.jolt.
// remove leading "$" before converting string to float float w = Float.valueOf(wbal.substring(1)).floatValue(); if (w < 0.0) { System.err.println("Insufficient funds"); trans.rollback(); System.exit(1); } else // now attempt to deposit/transfer the funds { deposit.addInt("ACCOUNT_ID", 100001); deposit.addString("SAMOUNT", "100.00"); deposit.call(trans); String dbal = deposit.getStringDef("SBALANCE", "-1.0"); trans.commit(); System.out.println("Successful withdrawal"); System.out.
Note If you are not familiar with using the Jolt Repository Editor, refer to Adding a Service and Adding a Parameter for more information about defining your services and adding new parameters. 1. Using the Jolt Repository Editor, define the TOUPPER service for the SIMPAPP package. 2. For the TOUPPER service, define an input buffer type of STRING and an output buffer type of STRING. 3. Define only one parameter for the TOUPPER service named STRING that is both an input and an output parameter. ToUpper.
back to the client. The following example assumes that a session object was already instantiated. Example 6-2. Use of the STRING buffer type (ToUpper.java) /* Copyright 1996 BEA Systems, Inc. All Rights Reserved */ import bea.jolt.
2. Define the input buffer type and output buffer type as CARRAY for the ECHO service. 3. Define the ECHO service with only one parameter named CARRAY that is both an input and output parameter. tryOnCARRAY.java Client Code Example 6-3 illustrates how Jolt works with a service whose buffer type is CARRAY. Since Jolt does not look into the CARRAY data stream, it is the programmer's responsibility to have the matching data format between the Jolt client and the CARRAY service.
import java.io.*; import bea.jolt.*; class ... { ... public void tryOnCARRAY() { byte data[]; JoltRemoteService csvc; DataInputStream din; DataOutputStream dout; ByteArrayInputStream bin; ByteArrayOutputStream bout; /* Use java.io.DataOutputStream to put data into a byte array */ bout = new ByteArrayOutputStream(512); dout = new DataOutputStream(bout); dout.writeInt(100); dout.writeFloat((float) 300.00); dout.writeUTF("Hello World"); dout.
● Example 6-5, tryOnFml.f16 Field Definitions is the TUXEDO FML field definitions table used by the PASSFML service. ● Example 6-6, tryOnFml.c Source Code is the server code fragment that contains the server side C code for handling the data sent by the Jolt client. tryOnFml.java Client Code The tryOnFml.java Java code fragment in Example 6-4 illustrates how Jolt works with a service whose buffer type is FML. The following example assumes that a session object was already instantiated. Example 6-4.
Note If you are not familiar with using the Jolt Repository Editor, refer to Adding a Service and Adding a Parameter for more information about defining your services and adding new parameters. 1. Using the Jolt Repository Editor, define the PASSFML service with an input buffer type of FML and an output buffer type of FML. 2. Define the parameters for the PASSFML service. In this example, the parameters are: INPUTSTRING, OUTPUTINT, INPUTINT, OUTPUTSTRING, OUTPUTFLOAT, INPUTFLOAT. tryOnFml.
Example 6-6 illustrates the server side code for using the FML buffer type. The PASSFML service reads in a input FML buffer and outputs a FML buffer. Example 6-6. tryOnFml.c Source Code /* * tryOnFml.c * * Copyright (c) 1997 BEA Systems, Inc. * * Contains the PASSFML TUXEDO server. * */ #include #include #include #include #include #include #include #include #include #include #include
/* We could just pass the FML buffer back as is, put lets */ /* store it into another FML buffer and pass it back.
/* Copyright 1997 BEA Systems, Inc. All Rights Reserved */ /* * This code fragment illustrates how Jolt works with a service whose buffer * type is VIEW. */ import bea.jolt.*; class ... { ... public void simpview () { JoltRemoteService ViewSvc; String outString; int outInt; float outFloat; // Create a Jolt Service for the TUXEDO service "SIMPVIEW" ViewSvc = new JoltRemoteService("SIMPVIEW",session); // Set the input parametes required for SIMPVIEW ViewSvc.setString("inString", "John"); ViewSvc.
Note If you are not familiar with using the Jolt Repository Editor, refer to Adding a Service and Adding a Parameter for more information about defining your services and adding new parameters. In the Repository Editor add the VIEW service as follows: 1. Add a VIEWSVC service for the SIMPAPP package, defining it with an input buffer type of VIEW and an output buffer type of VIEW. 2. Define the parameters for the VIEW service.
In the following server code, the input and output buffers are VIEW. The code accepts the VIEW buffer data as input and outputs the same data as VIEW. Example 6-9. simpview.c Source Code /* * SIMPVIEW.c * * Copyright (c) 1997 BEA Systems, Inc. * * Contains the SIMPVIEW Tuxedo server. * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include All rights reserved
strcpy (svcinfo->outString, "Return from SIMPVIEW"); svcinfo->outInt = 100; svcinfo->outFloat = (float) 100.00; /* * If there was an error, return TPFAIL * tpreturn(TPFAIL, ErrorCode, (char *)svcinfo, sizeof (*svcinfo), 0); */ tpreturn(TPSUCCESS, 0, (char *)svcinfo, sizeof (*svcinfo), 0); } Multithreaded Applications As a Java based set of classes, Jolt supports multithreaded applications.
The typical usage is to make the following call in all long running code segments or potentially time-consuming loops: Thread.currentThread.yield(); Without sending this message, the threads used by the Jolt library may never get scheduled, and as such, the Jolt operation will be impaired. The only virtual machine known to use non-preemptive threading is the Java Developer's Kit (JDK version 1.0, 1.0.1, 1.0.2) machine running on a Sun platform. If you want your applet to work on JDK 1.
// instantiate domain // check authentication level switch (dattr.checkAuthenticationLevel()) { case JoltSessionAttributes.NOAUTH: System.out.println("NOAUTH\n"); break; case JoltSessionAttributes.APPASSWORD: appPasswd = "myAppPasswd"; break; case JoltSessionAttributes.USRPASSWORD: userName = "myName"; userPasswd = "mySecret"; appPasswd = "myAppPasswd"; break; } dattr.setInt(dattr.
session.endSession(); } catch (SessionException e) { System.err.println(e); } finally { System.out.println("normal ThreadBank term"); } } } class T1 extends Thread { JoltSession j_session; JoltRemoteService j_withdrawal; public T1 (JoltSession session) { j_session=session; j_withdrawal= new JoltRemoteService("WITHDRAWAL",j_session); } public void run() { j_withdrawal.addInt("ACCOUNT_ID",10001); j_withdrawal.addString("SAMOUNT","100.00"); try { System.out.
{ e.printStackTrace(); System.err.println(e); } } } Event Subscription and Notifications Programmers developing client applications using Jolt can receive event notifications from either TUXEDO Services or other TUXEDO clients. The Jolt Class Library contains classes that support the following types of TUXEDO notifications for handling event-based communication: ● Unsolicited Event Notifications.
Connection Modes Jolt supports notification receipt for clients working in either connection-retained or connection-less modes of operation. Connection-retained clients receive all notifications. Jolt clients working in connection-less mode will receive notifications while they have an active network connection to the Jolt Session Handler (JSH). When the network connection is closed, the JSH logs and drops notifications destined for the client.
● If a client is subscribed to only a single event, unsubscribing disables both the event notification and unsolicited messages. ● If a client has multiple subscriptions, then unsubscribing from any single subscription disables just that single subscription. Unsolicited notifications continue. Only the last subscription to be unsubscribed causes unsolicited notification to stop.
... // Unsubscribe the HELLO event and unsolicited notification. helloEvent.unsubscribe(); unsolEvent.unsubscribe(); } } Clearing Parameter Values The Jolt Class Library includes a method (the clear method) that allows the developer to remove an object's existing attributes and in effect provides for the reuse of the object. The reuseSample.java example illustrates how to use the clear method for clearing parameter values. The reuseSample.
public static void main( String args[] ) { String host; short port; JoltRemoteService svc; if (args.length != 2) { System.err.println("Usage: reuseSample host port"); System.exit(1); } /* Get the host name and port number for initialization. */ host = args[0]; port = (short)Integer.parseInt(args[1]); init(host, port); /* Get the object reference to the DELREC service. This * service has no output parameters, but has only one input * parameter.
/* Copyright 1996 BEA Systems, Inc. All Rights Reserved */ import java.net.*; import java.io.*; import bea.jolt.*; /* * This Jolt sample code fragment illustrates how to customize * JoltRemoteService.
class extendSample { public static void main( String args[] ) { JoltSession s_session; String host; short port; TransferService xfer; String failure; if (args.length != 2) { System.err.println("Usage: reuseSample host port"); System.exit(1); } /* Get the host name and port number for initialization. */ host = args[0]; port = (short)Integer.parseInt(args[1]); /* Prepare to connect to the TUXEDO domain. */ JoltSessionAttributes attr = new JoltSessionAttributes(); attr.setString(attr.
} if ((failure = xfer.doxfer(51334, 40343, "$123.25")) != null) System.err.println("Tranasaction failed: " + failure); else { System.out.println("Transaction is done."); System.out.println("From Acct Balance: "+xfer.fromBal); System.out.println(" To Acct Balance: "+xfer.toBal); } } } Application Deployment and Localization The Jolt Class Library allows you to build Java applications that execute from within a client Web browser.
Since all Jolt classes belong to package bea.jolt, all Jolt class files are put in /classes/bea/jolt subdirectory (i.e., "jolt" is a subdirectory of "bea" which is a subdirectory of "classes"). The HTML file for the Jolt applet should refer the codebase to the "classes" directory. For example: /export/html/ |___ classes/ | |_____ bea/ | | |______ jolt/ | | |_____ JoltSessionAttributes.class | | |_____ JoltRemoteServices.class | | |_____ ... | |_____ mycompany/ | |________ app.class |___ ex1.html |___ ex2.
7. Jolt Class Library Reference The Jolt Class Library consists of object-oriented Java language classes for accessing NonStop TUXEDO services and defining transactions. The Jolt Class Library package is designed to be small, simple, and easy to incorporate into your Java application. The classes for this package provide TUXEDO logon/logoff, synchronous calling, and transaction services for a client Java applet.
always at position zero. For example, if you have a list of account numbers and you use a delete method, the item at position zero is deleted. For example: delete ( "ACCTNUM") Deletes the account number at position zero of the account number list. setInt ( "ACCTNUM", 3200) Sets the account number at position zero to the value 3200. Changing Items by Item Position The following types of methods in the Jolt Class Library are position dependent.
The JoltSessionAttributes class defines the acceptable attributes for the JoltSession constructor. The set methods add the attribute if one does not exist. Otherwise, the set method overwrites the old value. The get and set methods throw the java.lang.NoSuchFieldError or java.lang.IllegalAccessError. By default, these errors are caught by the Java virtual machine. public class JoltSessionAttributes { /* The supported authentication levels.
Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute. java.lang.NoSuchFieldError. Occurs when the user tries to set an attribute which is not one of the predefined attributes. JoltSessionAttributes Methods The following methods are used in conjunction with the JoltSessionAttributes class. ● checkAuthenticationLevel and clear methods. These methods provide a means to retrieve the values set for system access and to remove data. ● get methods.
Usage The JoltSessionAttributes class contains data that must be removed for object reuse. Use the clear method to remove data. getByteDef Gets the byte value of a specified item. byte getByteDef ( String name, byte defValue ); Usage Gets the byte value (8-bit) of the item specified in the name parameter or the specified defValue, if the name does not exist. Returns This method returns a single byte value. Throws java.lang.IllegalAccessError.
Occurs when the user tries to set an attribute which is not one of the predefined attributes. getFloatDef Gets the floating point value of an item. float getFloatDef( String name, float defValue ); Usage Gets the floating point value of the item specified in the name parameter or the specified defValue, if the name does not exist. Returns This method returns a floating point value (32-bit). Throws java.lang.IllegalAccessError.
getStringDef Gets the string value of an item. String getStringDef( String name, String defValue ); Usage Gets the string value of the item specified in the name parameter or the specified defValue, if the name does not exist. The default value can be a null string or any other text string. Returns This method returns a text string. Throws java.lang.IllegalAccessError. Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute. java.lang.NoSuchFieldError.
setDouble Sets the double precision value of a specified item. void setDouble( String name, double value ); Usage Sets the value of the item specified in the name parameter to the double precision value specified in the value parameter. The value is in 64-bits. Throws java.lang.IllegalAccessError. Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute. java.lang.NoSuchFieldError.
Usage Sets the value of the item specified in the name parameter to the short (16-bit) integer value specified in the value parameter. Throws java.lang.IllegalAccessError. Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute. java.lang.NoSuchFieldError. Occurs when the user tries to set an attribute which is not one of the predefined attributes. setString Sets the string value of a specified item.
IDLETIMEOUT Defines an integer representing the timeout interval in seconds. Set the IDLETIMEOUT to an interval of time that is less than the SESSIONTIMEOUT value. IDLETIMEOUT is used to hint to the system when to drop the network connection while retaining the session. When the IDLETIMEOUT is set to 0, the system is notified that the network connection is always retained. This ensures that when the system times out, the network connection to the target system is terminated, and the session is terminated.
public void onReply ( JoltReply reply ); protected void finalize( ); } For more information see the following classes: JoltSessionAttributes, JoltRemoteService, JoltTransaction, JoltReply. JoltSession Constructor The JoltSession constructor creates a JoltSession object with attributes from the JoltSessionAttributes class. The JoltSession object is the logon to the target system which is identified in the APPADDRESS name of the JoltSessionAttributes.
Usage The endSession method is used to terminate the session and obsolete the session object. The endSession method allows the user to log off the Jolt/TUXEDO system. When logged off, the session is invalid.
JoltRemoteService Class java.lang.Object | +----bea.jolt.JoltRequestMessage | +----bea.jolt.JoltRemoteService The JoltRemoteService class is a subclass (child class) of the JoltRequestMessage class. It is derived from and inherits the characteristics of its parent class, JoltRequestMessage. The JoltRemoteService object is reusable; therefore, the programmer should invoke the JoltRequestMessage clear method to reset any previous data (such as flags, priority, and parameters) before invoking the object again.
JoltRemoteService Methods Provides the means to call a transaction service for the JoltRemoteService object. call The call method calls the specified service. void call( Transaction t ) throws ApplicationException, TransactionException, ServiceException; Usage The call method calls the service. The t parameter specifies the transaction object. The transaction must belong to the same session as the current service. If a TUXEDO error (not service failure) occurs, the call method throws a ServiceException.
JoltRequestMessage Abstract Class JoltRequestMessage is an abstract class whose main purpose is to serve as a base or parent class for JoltRemoteService. The JoltRemoteService class extends from (or is a subclass of) the JoltRequestMessage. All of the methods provided for the JoltRequestMessage class only work with the JoltRemoteService class. Note All JoltRequestMessage method exceptions are caught by the Java virtual machine by default.
JoltRequestMessage Methods The JoltRequestMessage methods are used in conjunction with the abstract JoltRequestMessage class. These methods are divided into five categories: the clear method, get methods, set methods, add methods, and delete methods. Note The clear() method removes JoltRequestMessage settings. Get Methods The get JoltRequestMessage methods are used to get values from the remote service object.
● setRequestPriority Input Parameter Methods. These methods are used to set the value of a named item that must be one of the input parameters. If the named item does not exist, the value is added. These methods include the following: ● setByte ● setBytes ● setDouble ● setFloat ● setInt ● setShort ● setString ● setByteItem ● setBytesItem ● setDoubleItem ● setFloatItem ● setIntItem ● setShortItem ● setStringItem For all of the set...
● addShort ● addString ● delete ● deleteItem clear Resets all input/output parameters or any information. void clear(); Usage The clear() method handles removal of parameter settings or information set by the JoltRequestMessage class. getApplicationCode Gets the application code returned by the service. int getApplicationCode(); Usage The getApplicationCode() method is equivalent to tpurcode or rcode in tpreturn(). Returns This method returns an integer value (32-bit).
Throws java.lang.NoSuchFieldError. (field name) Attempt to get a field that is not defined for this service. getBytesDef Gets the byte array value of a specified parameter. byte[ ] getBytesDef( String name, byte[] defValue ); Usage This method gets the byte array value of the first item specified in the name parameter or the specified defValue, if the name does not exist. Returns This method returns an array of byte values. Throws java.lang.NoSuchFieldError.
getIntDef Gets the integer value of a specified parameter. int getIntDef( String name, int defValue ); Usage This method gets the integer value of the item specified in the name parameter or the specified defValue, if the name does not exist. Returns This method returns an integer value (32-bit). Throws java.lang.NoSuchFieldError. (field name) Attempt to get a field that is not defined for this service. getShortDef Gets the short integer value of a specified parameter.
Throws java.lang.NoSuchFieldError. (field name) Attempt to get a field that is not defined for this service. getBytesItemDef Gets the byte array item. byte[] getBytesItemDef( String name, int itemNo, byte[] def ); Usage This method gets the byte value of the itemNo of the name parameter. If the item does not exist, the get method uses the default value. Returns This method returns a byte value (8-bit). Throws java.lang.NoSuchFieldError.
getIntItemDef Gets the integer item. int getIntItemDef( String name, int itemNo, int def ); Usage This method gets the integer value of the itemNo of the name parameter. If the item does not exist, the get method returns the default value. Returns This method returns an integer value (32-bit). Throws java.lang.NoSuchFieldError. (field name) Attempt to get a field that is not defined for this service. getShortItemDef Gets the short item.
setByte Sets the value of the specified item. void setByte( String name, byte value ); Usage Sets the value of the item specified in the name parameter to the byte value specified in the value parameter. The value is an 8-bit byte. Throws java.lang.IllegalAccessError. (field name) - Attempt to set a value to an output parameter field. java.lang.NoSuchFieldException. (field name) - Attempt to set a field which is not defined for this service. setBytes Sets the value of the specified item.
Usage Sets the value of the item specified in the name parameter to the floating point (32-bit) value specified in the value parameter. Throws java.lang.IllegalAccessError. (field name) - Attempt to set a value to an output parameter field. java.lang.NoSuchFieldException. (field name) - Attempt to set a field which is not defined for this service. setInt Sets the integer value of the specified item.
java.lang.NoSuchFieldException. (field name) Attempt to set a field which is not defined for this service. setByteItem Sets a named item at a specified index with a byte value. void setByteItem( String name, int itemNo, byte value ); Usage Sets the item specified in the name parameter at the index specified by itemNo with the byte value specified by the value parameter. If the item already exists, the value is overwritten. Throws java.lang.IllegalAccessError.
setFloatItem Sets a named item at a specified index with a floating point value. void setFloatItem( String name, int itemNo, float value); Usage Sets the item specified in the name parameter at the index specified by itemNo with the floating point value specified by the value parameter. If the item already exists, the value is overwritten. Throws java.lang.IllegalAccessError. (field name) Attempt to set a value to an output parameter field. java.lang.NoSuchFieldException.
Usage Sets the item specified in the name parameter at the index specified by itemNo with the string value specified by the value parameter. If the item already exists, the value is overwritten. Throws java.lang.IllegalAccessError. (field name) Attempt to set a value to an output parameter field. java.lang.NoSuchFieldException. (field name) Attempt to set a field which is not defined for this service. addByte Adds the byte input parameters.
(field name) Attempt to add or delete a field that is not defined for this service. addFloat Adds the floating point input parameter. void addFloat( String name, float val ); Usage The addFloat() method adds the floating point value (32-bit) of the item specified in the name parameter. Throws java.lang.IllegalAccessError. (field name) Attempt to add a value to an input parameter field, or delete a value from an input parameter field. java.lang.NoSuchFieldError.
Throws java.lang.IllegalAccessError. (field name) Attempt to add a value to an input parameter field, or delete a value from an input parameter field. java.lang.NoSuchFieldError. (field name) Attempt to add or delete a field that is not defined for this service. delete Deletes a first occurrence of the named item or any existing item. void delete( String name ); Usage This method deletes the first named item. The named item must be one of the input parameters. Throws java.lang.IllegalAccessError.
public class JoltTransaction { public JoltTransaction( int timeout, JoltSession s) throws TransactionException; public void commit() throws TransactionException; public void rollback() throws TransactionException; } JoltTransaction Constructor The JoltTransaction class provides a constructor to create the JoltTransaction object. JoltTransaction Creates an instance of the JoltTransaction object with the specified parameters.
commit Performs the transaction commit. void commit() Usage After commit() is called, the object is obsolete.
invokes a service. For additional information, refer also to the JoltSession class. public class JoltEvent unsubscribe() unsubscribeAll(Session) JoltEvent Methods The following methods are used with the JoltEvent class. unsubscribe Deletes the subscription to an event. public int unsubscribe() Usage This method is used to stop subscribing to the event specified in the constructor. Once it is unsubscribed, this object becomes obsoleted.
+----bea.jolt.JoltUserEvent The JoltUserEvent class extends JoltEvent. JoltUserEvent implements a subscription to an asynchronous (async) notification event. An async notification is either an unsolicited event notification or event notification from the TUXEDO Event Broker. Unsolicited notifications are produced in response to a TUXEDO tpnotify() call or a TUXEDO tpbroadcast() call. Event notifications are produced as a result of a TUXEDO tppost() call. The JoltUserEvent class is used in Jolt 1.
bound to a single session. Usage This constructor subscribes the specific asynchronous notification. An asynchronous notification may be an unsolicited notification or event notification. If the expr is JoltUserEvent.UNSOLMSG, the filter must be null. Otherwise, the filter can be either null or a Boolean expression (see Fboolco() in the TUXEDO System Reference Manual).
//These methods are duplicates of the JoltRequestMessage class //They are inherited from that class.
Usage Get the first item based on its name. If it does not exist, the default value will be returned. name specifies the name of the item. def specifies the default short value. Returns A short value. Throws NoSuchFieldError. It is an invalid name. IllegalAccessError. Cannot delete an input item. getIntDef Gets the first item based on its name. int getIntDef(String name, int def) Usage Get the first item based on its name. If it does not exist, the default value will be returned.
Throws NoSuchFieldError. It is an invalid name. getStringDef Gets the first item based on its name. String getStringDef(String name,String def) Usage Gets the first item based on its name. If it does not exist, the default value will be returned. name specifies the name of the item. def specifies the default string value. Returns A string value. Throws NoSuchFieldError. It is an invalid name. getBytesDef Gets the first item based on its name.
getShortItemDef Gets an occurrence of a named item of short data type. short getShortItemDef(String name, int itemNo, short def) Usage The occurrence starts from 0. If it does not exist, the default value will be returned. name specifies the name of the item. itemNo specifies the occurrence number of the item. def specifies the default value. Returns A short value. Throws NoSuchFieldError. It is an invalid name. getIntItemDef Gets an occurrence of a named item of int data type.
Throws NoSuchFieldError. It is an invalid name. getBytesItemDef Gets an occurrence of a named item of byte-array data type. byte[] getBytesItemDef(String name, int itemNo, byte def[]) Usage The occurrence starts from 0. If it does not exist, the default value will be returned. name specifies the name of the item. itemNo specifies the occurrence number of the item. def specifies the default value. Returns A byte-array object. Throws NoSuchFieldError. It is an invalid name.
A. Jolt Class Library Errors and Exceptions This appendix describes the Jolt Class Library errors and exceptions. The Jolt Class Library returns both Jolt and TUXEDO errors and exceptions.
Is one of the TUXEDO errors (e.g., TPENOENT) Is the text message from tpstrerror(). TPEJOLT Provides useful information about what error has occurred and its location. You can use a getErrno to get the error number and a getMessage to obtain the error message for the exception object. The Jolt Class Library uses exceptions to report run-time problems. All Jolt exceptions extend from Java's RuntimeException and Error classes.
ApplicationException is thrown only when the service calls a tpreturn (TPFAIL, tpurcode, ...). public class ApplicationException extends java.lang.RuntimeException ApplicationException Methods The following methods are used with the ApplicationException class. getMessage The getMessage method gets the error message. public String getMessage(); Usage This method is taken from the Java RuntimeException class. getApplicationCode The getApplicationCode method gets the application code (tpurcode).
public public public public public public public public public public public public public public public public public public public public public public public public public public final final final final final final final final final final final final final final final final final final final final final final final final final final static static static static static static static static static static static static static static static static static static static static static static static static stat
getObject The getObject method gets the object that throws this exception. public Object getObject(); Usage In some situations, this method returns a "null" object. EventException Class java.lang.Object | +----java.lang.Throwable | +----java.lang.Exception | +----java.lang.RuntimeException | +----bea.jolt.JoltException | +----bea.jolt.EventException This exception is thrown when the user encounters any error during the event subscription.
+----java.lang.Exception | +----java.lang.RuntimeException | +----bea.jolt.JoltException | +----bea.jolt.ServiceException The ServiceException class extends JoltException. The ServiceException class is used by the JoltRemoteService class and its methods. public class ServiceException extends JoltException SessionException Class java.lang.Object | +----java.lang.Throwable | +----java.lang.Exception | +----java.lang.RuntimeException | +----bea.jolt.JoltException | +----bea.jolt.
TUXEDO Errors Expanded references to TUXEDO will be available in a future release of the Jolt product documentation. If you require an immediate, expanded reference for TUXEDO related errors, see the TUXEDO System Reference Manual. Table A-2. TUXEDO Errors Error Description TPEABORT A transaction could not commit because the work performed by the initiator, or by one or more of its participants, could not commit.
TPERMERR A resource manager failed to open or close correctly. TPESVCERR A service routine encountered an error either in tpreturn(3) or tpforward(3). For example, bad arguments were passed. TPESVCFAIL The service routine sending the caller's reply called. TPESYSTEM A System/T error occurred. TPETIME A time-out occurred. TPETRAN The caller cannot be placed in transaction mode. TPGOTSIG A signal was received and TPSIGRSTRT was not specified.
B. System Messages Jolt system messages and code references will be available in a future release of the Jolt product documentation. If you require an immediate, expanded reference, refer to the TUXEDO System Message Manual.
1510 ERROR: Received network message with unknown context. Description Jolt protocol failure. Received a corrupted or an improper message. Action Restart Jolt client. 1511 ERROR: _tprandkey() failed tperrno = %d, could not generate random encryption key. Description TUXEDO internal failure. Action Restart Jolt servers. 1512 ERROR: Sending of reply to challenge call to client failed. Description JSH was unable to reply to Jolt client due to network error. Action Restart client.
1517 ERROR: Commit handle and clientid have no matching requests. Description Received a copy from TUXEDO that has no corresponding client. Action No action required. 1518 ERROR: Call handle and clientid have no matching requests. Description Received a reply from TUXEDO that has no corresponding client. Action No action required. 1519 ERROR: Application password does not match. Description Authentication error. Action Check the application password. 1521 ERROR: Unrecognized message magic %ld.
1525 ERROR: Tried to process unexpected message opcode 0x%1x. Description Received a message with invalid opcode. Action Check the client. 1526 ERROR: Jolt license has expired. Description License for Jolt use has expired. Action Contact Technical Support. 1527 ERROR: Expected argument to -c option. Description Option -c needs an argument. Action Provide a valid argument. 1528 ERROR: Request for inappropriate session type. Description Received a message without valid session information.
1532 ERROR: Received J_CLOSE message with invalid context. Description Timeout in connection. Action If a request is sent after a timeout that is longer than the session timeout of the JSL, the JSH cannot validate the session ID. 1533 ERROR: Sending of reply of close protocol failed. Description Jolt protocol failure. Action Check the client. 1534 ERROR: Sending of reply of reconnect protocol failed. Description Jolt protocol failed. Action Check the client.
1539 ERROR: Failed to decrypt reconnect information. Description Jolt protocol failure. Action Restart the client. 1540 ERROR: Failed to encrypt reconnect information. Description Jolt protocol failure. Action Restart the client. 1541 ERROR: Received RECONNECT request for nonTRANSIENT client. Description Improper request from client. Action Restart the client. 1542 ERROR: Unlicensed Jolt server. Description The JSL is not licensed.
Action Install TUXEDO 6.1 or 6.2 or check to ensure that your TUXEDO release is 6.1 or 6.2. 1546 WARN: The version of this TUXEDO is not available; is assumed. Description The MIB is supported with this version of TUXEDO, but the release number is unavailable. The TUXEDO version might not be a master binary. It might also be an internal version of TUXEDO. Action No action is required. 1547 ERROR: Memory allocation failure in JOLT_SUBSCRIBE.
Action Information message only; no action required. 1553 WARN: Dropping broadcast message for Transient client %d. Description Notification arrived when a transient client is not connected. Action Information message only; no action required. 1554 ERROR: Expected numeric argument for -Z option. Description -Z option expects 0, 40, or 128 as the argument. Action Check the configuration file and specify a valid numeric argument for JSL. 1555 ERROR: %d - Illegal argument for -Z option.
Action Specify the correct option. 1560 ERROR: Cannot initialize the code conversion for local %s. Description Cannot find function to do the code conversion for internationalization. Action Check the shared library. 1561 ERROR: TUXDIR is not set. Description TUXDIR environment variable is not set. Action Set the variable to TUXEDO directory and restart TUXEDO. 1562 ERROR: Error reading license file. Description Jolt is not able to open TUXEDO license file in $TUXDIR/udataobj/lic.txt.
ERROR: Not enough disk space for "" Description Ran out of disk space while adding or deleting Repository entries, or during garbage collection. Action Configure additional disk space. ERROR: Cannot modify read-only repository "" Description Denies attempt to add or delete an entry from a read-only repository. Action Check the file permission and ensure that the file is writable. ERROR: "" is not a valid repository file.
Description An invalid argument (other than an invalid field buffer, field identifier, or field type) was passed to an FML function. This can be a parameter where a non-NULL parameter was expected (for example, it can be an invalid buffer size, etc.). Action See the manual page associated with the error for the correct parameter values. ERROR: Unknown field number or type.
unable to advertise the address and the request fails. The address used in the -n command line option to the JSL is already in use by another process. For TCP/IP, this can be verified by using the netstat command. The system has run out of network addresses for the JSH. The JSH requests a new address from the system. If there are no addresses available, the request is rejected. A previously used address has not completed the close sequence.
1101 ERROR: Bad hex number provided for listening address: %s. Description The JSL process was invoked with a -n option that specified a hexadecimal value as an option-argument. However, the value specified was not a valid hexadecimal constant. Action Change the network address specified for the JSL so that it contains an even number of hexadecimal digits, and make certain that each digit is '0' through '9', 'A' through 'F', or 'a' through 'f'.
1500 ERROR: Needs both -l -c options with arguments. Description Needed options are without arguments. Action Check and correct configuration file for JRAD entry. 1501 ERROR: Malloc failed. Description JRAD is not able to allocate dynamic memory. Action Increase the system resources and restart the JRAD. 1502 ERROR: Memory allocation failed. Description JRAD is not able to allocate dynamic memory. Action Increase the system resources and restart the JRAD. 1503 ERROR: Memory allocation failed.
1507 ERROR: Sending message to JSL failed. Description JSL is not running or network connection is down. Action Restart the JRAD/JSL. 1508 INFO: Sending message to JSH failed. Description Network is down. Connection to the JSH failed. Action Check the network and restart the JSL. 1509 ERROR: Sending CONNECT reply to JRLY. Description Unable to reach JRLY. Probably problem in the network. Action Restart the JRLY and JRAD after check the network addresses. 1510 ERROR: Sending SHUTDOWN reply to JRLY.
Action None. If this message appears repeatedly and can be reproduced consistently notify Technical Support. ERROR: Invalid file descriptor %ld Description An internal error occurred. The relay will continue to run, but a client process may have been disconnected. Action None. If this message appears repeatedly and can be reproduced consistently notify Technical Support. ERROR: Could not open configuration file %s Description The specified configuration file does not exist or is not readable.
used (-f parameter). ERROR: Could not determine IP address of listener host Description The relay could not look up the IP address of the host machine. Action If the host was specified as a host name replace it with the IP address and restart the relay. If it already was given as IP address make sure that the IP address is correct and that you're trying to start the relay on this host. Note that the address specified must be the address of the host on which the relay is running.
Action Input the correct keyword value. ERROR: Error on line %d: Invalid number: %s Description The numeric number is malformed. Action Input the correct value. ERROR: Error on line %d: Invalid value: %s Description The value of the parameter is out of range. Action Input the correct value. ERROR: Error on line %d: Invalid value: %s Description The data type of the parameter is invalid. Action Input the correct value.
Index A Add methods overview 154 addByte method 169 addBytes method 170 addDouble method 170 addFloat method 171 addInt method 171 addShort method 172 addString method 172 example of 131 APPADDRESS constant 143 Applets deploying 126/128 localizing 128 overview of Jolt support for 27 relationship to applications 90 ApplicationException class definition and overview 193 methods used with 193 Applications, design Java, relationship to applets 90 Jolt, enabling for 28 Applications, programming deployment and lo
Browsers using to start Jolt repository editor 60 Buffers notification data 118 types used with Jolt 98/111 Bulk loader See jbld application BULKPKG file 52 C call method 149 CARRAY buffer type tryOnCARRAY.
Constants See individual constants Constructors JoltRemoteService class 149 JoltSession class 145 JoltSessionAttributes class 133 JoltTransaction class 175 D Data files sample for Jolt bulk loader 55 syntax for Jolt bulk loader 52/55 delete method example of 130 JoltRequestMessage class 173 Delete methods overview 154 deleteItem method example of 130 JoltRequestMessage class 173 DES encryption 21 Distributed processing using Jolt 27 E ECHO service, defining 101 Edit Parameters window, Jolt repository edit
connection modes supported 118 data buffers for 118 enabling unsolicited 118 example code for receiving 120 handle for 117 types supported 117 using with TUXEDO 119 Event subscription configuring Jolt for 43 Jolt description 42, 117/121 TUXEDO and Jolt support comparison 119 EventException class 196 Exceptions, JoltException class hierarchy 192 Exiting See Stopping Exporting services to Jolt clients 81 extendSample.
JoltMessage class 183 JoltRequestMessage class 155 JoltSessionAttributes class 135 getByteItemDef method JoltMessage class 186 JoltRequestMessage class 159 getBytesDef method JoltMessage class 186 JoltRequestMessage class 156 JoltSessionAttributes class 136 getBytesItemDef method JoltMessage class 189 JoltRequestMessage class 159 getDoubleDef method JoltMessage class 185 JoltRequestMessage class 156 JoltSessionAttributes class 136 getDoubleItemDef method JoltMessage class 188 JoltRequestMessage class 160 ge
ApplicationException class 193 JoltException class 195 JoltReply class 181 getName method example of 131 JoltRequestMessage class 154 getObject method ApplicationException class 193 JoltException class 195 getOccurrenceCount method JoltMessage class 182 JoltRequestMessage class 155 getShortDef method JoltMessage class 183 JoltRequestMessage class 158 JoltSessionAttributes class 138 getShortItemDef method JoltMessage class 187 JoltRequestMessage class 161 getStringDef method JoltMessage class 185 JoltRequest
Help Jolt repository editor 87 troubleshooting jbld application 55 troubleshooting Jolt configuration 48 I IDLETIMEOUT constant 143 Information messages 212 Installing Jolt 31 Internet and Intranet services 20 isAlive method JoltSession class 147 J Java applets, deploying 126/128 applets, localizing 128 applications vs. applets 90 RuntimeException 192 support for See Jolt JavaSoft appletviewer starting repository editor 60 java.lang.IllegalAccessError, description of 133 java.lang.
syntax of data files 52/55 system messages 221 troubleshooting 55 Jolt See also jbld application applets, support for 27 architecture 23 bulk loadingTUXEDO services 51/56 client/server communication between 26 client/server interaction 92 client/server relationship 91/92 configuring 33/50 connection manager 91 definition of 19, 20 event subscription, configuring 43 event subscription, description of 42, 117/121 installing 31 overview 19/29 repository editor, using 57/88 sample application, SimXfer.
logon/logoff functions 94 object hierarchy 93 objects, reusing 123/126 object/class reusability 121 overview 24/25, 89/92 parameters, clearing example 121/123 synchronous service calling 94 transaction begin, commit, rollback 94 Jolt internet relay components of 44 configuring network addresses 47 description of 20 Jolt repository editor description of 58 example window 59 exiting 62 introduction 58 logging on 61/62 overview 27 package organizer 76/77 packages, adding 69 packages, deleting 80 packages, desc
starting 60 troubleshooting 87 Jolt server components of 24, 33 overview of functions 26 shutting down 39 JoltEvent class definition and overview 177 methods used with 178 JoltException class class hierarchy 192 definition and overview 194 methods used with 195 JoltMessage class definition and overview 182 definition of 117 example asychronous notification 120 methods used with 182/189 JoltRemoteService class creating an instance of 149 definition and overview 148 example reusing parameter values 121 exampl
definition of 117 description of 91 example asychronous notification 120 methods used with 146/148 JoltSessionAttributes class creating an instance of 133 definition and overview 132 example using 95 methods used with 133/143 predefined attribute names for get and set methods 143 steps in beginning a transaction 92 JoltTransaction class creating an instance of 175 definition and overview 174 description of 91 methods used with 176/177 JoltUserEvent class definition and overview 179 definition of 117 example
initializing 42 jrepository file 41 system messages 209/211 JRLY (Jolt relay) process component of Jolt internet relay 20 configuring 46 configuring network addresses 47 description of 44/45 description of functions 27 relationship to JSL and JSH 33 starting 45 system messages 218/221 JSH (Jolt server handler) component of Jolt server 24 configuring minimum/maximum per JSL 37 relationship to Jolt server 33 JSL (Jolt server listener) component of Jolt server 24 configuring 34/39 configuring network addresses
information 212 jbld application (bulk loader) 221 Jolt system 199/209 JRAD 212/217 JREPSVR 209/211 JRLY 218/221 Methods See also individual methods changing items, for 130 errors and exceptions, for 193/198 overview for Jolt class library 130 Multiplexing, configuring for JSH 39 Multithreaded applications 112/116 N Networks configuring addresses for Jolt 47 JRAD addresses 47 JSL address 37 JSL external address for Jolt clients 37 Non-preemptive threads 112/113 Notification event handler 117 O Objects ext
See Jolt respository editor PASSFML service, defining 105 Port numbers for JSL and JSH 35 Preemptive threads 112/113 R RC4 encryption 21 RECVTIMEOUT constant 143 Repository editor See Jolt repository editor reuseSample.
Jolt repository editor See Jolt respository editor Services window, Jolt repository editor 66 SessionException class 197 SESSIONTIMEOUT constant 143 Set methods, overview of 153 setByte method JoltRequestMessage class 162 JoltSessionAttributes class 139 setByteItem method 166 setBytes method JoltRequestMessage class 163 JoltSessionAttributes class 139 setBytesItem method 166 setDouble method JoltRequestMessage class 163 JoltSessionAttributes class 140 setDoubleItem method 167 setFloat method JoltRequestMess
setStringItem method 169 SIMPAPP sample application PASSFML service, defining 105 TOUPPER service, defining 99 simpview.c sample application code for 110 VIEW service, defining 109 simpview.java sample application code for 108 VIEW service, defining 109 SimXfer.java sample application 96 Starting Jolt repository editor 60 JRAD (Jolt relay adapter) process 46 JRLY (Jolt relay) 45 JSL (Jolt server listener) 34 Stopping Jolt repository editor 62 JSL (Jolt server listener) 39 STRING buffer type ToUpper.
Threads, multithreaded applications in 112/116 Thread.yield method 113 Timeouts configuring JSH 38 configuring JSL 37 TMUSREVT server, configuring for Jolt 43 TOUPPER service 98 ToUpper.
Transactions begin, commit, rollback support by Jolt 94 Troubleshooting jbld application 55 Jolt configuration 48 Jolt repository editor 87 tryOnCARRAY.java sample client 102 tryOnFml.c sample server 106 tryOnFml.
simpview.
About This Guide This guide describes the JoltBeans component of Jolt for NonStop TUXEDO and gives instructions for using this component for creating applications. Who Should Read This Guide This document is intended for developers who are interested in building applications using JavaBeans and Jolt. It assumes a familiarity with Jolt for NonStop TUXEDO, NonStop TUXEDO, Integrated Development Environments (IDEs), JavaBeans, and Java programming. Organization of This Guide This guide contains 5 sections.
your name, company name, address, and phone number in your message. If your comments are specific to a particular manual, also include the document version (part number or publication date) and title of the manual. Many of the improvements you see in manuals are a result of suggestions from our customers. Please take this opportunity to help us improve future manuals.
1. Introducing the JoltBeans Toolkit The JoltBeans toolkit provides a JavaBeans compliant interface to Jolt for NonStop TUXEDO. The JoltBeans toolkit contains beans which wrap the existing Jolt class library into reusable bean components, such as the JoltSessionBean or the JoltServiceBean. These beans can be customized easily by giving application specific values to properties and connecting them with other bean components.
both. Jolt aware beans are a subset of Custom GUI elements that follow beans guidelines. Jolt aware AWT beans. JoltList, JoltCheckBox, JoltTextField, JoltLabel, and JoltChoice. JoltBeans toolkit. A JavaBeans compliant interface to Jolt for NonStop TUXEDO, which includes the JoltServiceBean, JoltSessionBean, and JoltUserEventBean. wiring. Indicates that a bean is registered as a listener of events from another bean.
2. Installing JoltBeans This chapter includes JoltBeans Installation Requirements information. For information about the Jolt 1.1 installation, refer to the Jolt for NonStop TUXEDO User Guide. Note The following instructions are taken from the JoltBean.txt "Read Me" file on the product CD. Installation Requirements The following components are required before installing JoltBeans: ● Jolt for NonStop TUXEDO Version 1.1 Certified Integrated Development Environment (IDE): ● Symantec Visual Café: 2.
Installation Instructions There are 3 basic steps: 1. Unzip or Un-tar the downloaded file to a directory of your choice. 2. Add the full path of Jolt Java class files that come with Jolt for NonStop TUXEDO 1.1 to the CLASSPATH: a. Edit sc.ini in the bin directory of your Visual Café installation. b. Add the directory where Jolt Java class files are installed to CLASSPATH. c. Restart Visual Café. 3. Insert the JoltBeanDev.jar and JoltBeanDevAwt.jar (in this order) into the Component Library.
3. Using JoltBeans JoltBeans is a collection of beans that you can use to build your own Jolt client applications or applets. During development, take the beans from the JoltBeans toolkit in the component palette of a development tool and position them on the Java form (or forms) of a Jolt client application or applet. Populate the properties of the beans and establish event source-listener relationships between various beans of the application or applet.
JoltSessionBean The JoltSessionBean represents the TUXEDO session. It encapsulates the functionality of the JoltSession, JoltSessionAttributes, and JoltTransaction classes. The JoltSessionBean offers properties to set session and security attributes, such as send timeout or TUXEDO user name, as well as methods to open and to close a TUXEDO session. The JoltSessionBean sends a PropertyChange event when the TUXEDO session is established or closed. PropertyChange is a standard bean event defined in the java.
JoltUserEventBean The JoltUserEventBean provides access to TUXEDO events. The TUXEDO event to subscribe to or unsubscribe from is defined by setting the appropriate properties of this bean (event name and event filter). The actual event notification is delivered in the form of a JoltOutputEvent from the JoltSessionBean. Table 3-3 shows the JoltUserEventBean properties and descriptions. Table 3-3.
JoltCheckbox The JoltCheckbox is a Jolt aware extension of java.awt.Checkbox, that is linked to a specific field in the Jolt input buffer by its JoltFieldName property. If the field occurs multiple times, the occurrence this checkbox is linked to is specified by the occurrenceIndex property of this bean. It can be connected with JoltServiceBeans to contain parts of the input for a service. A JoltServiceBean may listen to events raised by a JoltCheckbox.
The Custom Property Editors of JoltBeans read cached information. Initially, there is no cached information available, so when the Property Editor is used for the first time, the dialog box is empty. Log on to the Jolt repository and load the property editor cache from the repository. Details of the logon and an example of using the Property List and Property Editor are shown in the Using the JoltBeans Repository and Setting the Property Values.
JoltTextField Gets input from the user (in this case, ACCOUNT_ID). JoltTextField Displays the result (in this case, SBALANCE). JoltServiceBean Accesses a TUXEDO service. (In this case, INQUIRY from BANKAPP). Button Initiates an action. Label Describes the field on the applet. Building the Sample Form The following example is created using the Visual Café 2.5 development environment. Follow the steps to build a sample form. 1.
Figure 3-5 shows how the JoltBeans appear in a development environment when the placement of the beans is completed. 1. To modify or customize the buttons, labels or fields, use the Property List. Some JoltBeans use a Custom Property Editor. The example in Figure 3-6 shows how selecting the JoltFieldName of the button property list displays the Custom Property Editor. Set the properties of the beans (e.g., set the JoltFieldName property of the JoltTextField to ACCOUNT_ID. Refer to Figure 3-6).
1. To change the value of the JoltFieldName property, click on the ellipsis button of the JoltFieldName in the Property List. The Custom Property Editor displays. Select or type the new field name (in this example, "ACCOUNT_ID"). Select OK. Figure 3-7.
The change is reflected in the Property List shown in Figure 3-7 and on the button shown in Figure 3-8. Figure 3-8. Example of Applet Form Designer with Property Changes Figure 3-8 is an example of how the text on the Button changes after the label text is added to the Property List fields for these beans. 1.
Wiring the JoltBeans Together After all of the beans are positioned on your form and the properties are set, wire the events together. Save, compile, and run the applet. Figure 3-9 gives an example of the flow to help you determine the order when you are ready to wire the beans. Wiring the beans allows you to establish event source-listener relationships between various beans of the form.
1. Choose ComponentShown as event and select "Logon to the TUXEDO system" as method. Select Finish. 2. Wire JoltSessionBean to JoltServiceBean via propertyChange The results of completing these three steps will enable the JoltSessionBean to send a propertyChange event when logon() completes. The JoltServiceBean listens to this event and associates its service with this session. 1. Select the Interaction Wizard button. Click on the JoltSessionBean and drag a line to the JoltServiceBean.
1. Select "A variable or parameter" method. In this example, event is the default and the correct value. Select Finish. 3. Wire the accountID JoltTextField as input to the JoltServiceBean using JoltInputEvent The results of completing these three steps will enable you to type the account number in the first text field. The JoltFieldName property of this JoltTextField is set to "ACCOUNT_ID". Whenever the text inside this text box changes, it sends a JoltInputEvent to the JoltServiceBean.
2. Choose serviceReturned as the event. Select "serviceReturned..." as the method. Press Next. The Interaction Wizard "How it should happen" similar to the example shown in Figure 3-11 displays. 3. Select "A variable or parameter." Select Finish. 6. Wire the JoltSessionBean logoff The results of completing these two steps will enable the logoff() method of the JoltSessionBean to be triggered by an applet (e.g., componentHidden) that is sent when the applet gets hidden. 1.
Figure 3-12. JoltServiceBean Property Editor 1. Select the service name by clicking on the ellipsis in the ServiceName field shown in Figure 3-12. 2. The Custom Property Editor for ServiceName shown in Figure 3-13 displays. Figure 3-13. Custom Property Editor for serviceName Note If you cannot or do not want to connect to the Repository database, simply type the service name in the text box and proceed to Step 7. 1. If you are not logged on, select Logon.
Figure 3-15. Property Editor with Selected Service 1. Select the appropriate service name in the list box shown in Figure 3-15. Enter the property value (service or field name) directly. A text box is provided. Select OK on the property editor dialog in Figure 3-15. The bean property gets set with the contents of the textbox. 2. Select OK on the Custom Property Editor dialog shown in Figure 3-15.
data which is input for the TUXEDO service represented by the JoltServiceBean. In Example 3, the GUI element implements the required methods (addJoltInputListener and removeJoltInputListener) to act as an event source for JoltInputEvents. The JoltServiceBean acts as an event listener for these events. The control sends a JoltInputEvent once its own state changes to keep the JoltServiceBean updated with the input information.
4. JoltBeans Toolkit Class Library Reference The JoltBeans Toolkit class library provides a JavaBeans compliant interface to Jolt for NonStop TUXEDO. JoltBeans wrap the existing Jolt class library into reusable bean components, such as the JoltSessionBean or the JoltServiceBean. JoltBeans components are not specific to any given application.
Double). JoltInputEvent -- single data element This constructor is used when the input is a single data element and it is represented in a native data format. JoltInputEvent(Object source, String fieldName, Object value) source Event source fieldName Name of the input field (Jolt name) value Value of the field in a native data type, such as Integer or Float Usage This constructor is used when the input is a single data element and it is represented in a native data format.
JoltInputEvent -- data element with multiple occurrences This constructor is used when the input is a data element with multiple occurrences and it is represented in a native data format.
JoltInputEvent(Object source, String fieldName, String textValue, int pos) source Event source fieldName Name of the input field (Jolt name) textValue Value of the field as a String pos The position of the data element Usage This constructor is used when the input is a data element with multiple occurrences, but only one occurrence is to be set, and it is represented as a String. The JoltInputEvent object performs the necessary data conversion.
● getValue ● getOccurrenceCount ● getValues ● getSingleOccurrence ● getTextValue ● isText ● getTextValues ● isVector ● getFieldName getValue The getValue() method gets the value of the field in its native representation. Object getValue() Returns Value of the field. Usage Get the value in its native representation. getValues The getValues() method gets the occurring values of the field in its native representation. Object[] getValues() Returns The occurrences of the field.
Usage Get the occurring values as String. getFieldName The getFieldName() method gets the name of the field. String getFieldName() Returns The name of the field Usage Get the name of the field. getOccurrenceCount The getOccurrenceCount() method gets the number of occurrences of a named item. int getOccurrenceCount() Returns The number of occurrences. Usage Get the number of occurrences of the field. getSingleOccurrence The getSingleOccurrence() method gets the position of the field.
isVector The isVector() method retuns true if the field has multiple occurrences, otherwise it returns false. boolean isVector() Returns True if the field has multiple occurrences, otherwise it returns false. JoltOutputEvent Class java.lang.Object | +----java.util.EventObject | +----bea.jolt.beans.JoltOutputEvent JoltOutputEvent is the event class for event objects sent from JoltServiceBeans to GUI elements when the reply from the TUXEDO service is received.
Returns True if this is a TUXEDO user event or false if this is a service reply. Usage Gets the flag indicating the origin of the event. getValue -- value of a field The getValue() method gets the value of a field in the output buffer. Object getValue(String fieldName) fieldName Name of the field (Jolt field name). Returns Value of the field in native data format. Usage Gets the value of a field in the output buffer.
getTextValue -- value of a field The getTextValue() method gets the value of a field in the output buffer as String. String getTextValue(String fieldName) fieldName Name of the field (Jolt field name) Returns Value of the field as String. Usage Get the value of a field in the output buffer. getTextValue -- value of one occurrence of a field The getTextValue() method gets the value of one occurrence of a field in the output buffer.
+----bea.jolt.beans.JoltServiceBean The JoltServiceBean represents a remote TUXEDO service. It listens to JoltInputEvents from other beans to populate its input buffer. JoltServiceBean offers the callService() method to invoke the service. JoltServiceBean is an event source for JoltOutputEvents that carry information about output of the service. After a successful callService() listener beans are notified via a JoltOutputEvent that carries the output buffer.
● ● ● ● getOutputValue -- value of one occurrence of field getOutputValues getOutputTextValue -- value of field ● clear ● callService ● addJoltOutputListener ● removeJoltOutputListener getOutputTextValue -- value of one occurrence of field propertyChange The propertyChange() method is the event handler for PropertyChange events. void propertyChange(PropertyChangeEvent evt) evt The event object. Usage Event handler for PropertyChange events.
Service name Usage Sets the name of the remote service that this bean represents. getServiceName The getServiceName() method gets the name of the remote service that this bean represents. String getServiceName() Returns The name of the TUXEDO service. Usage Gets the name of the remote service that this bean represents. isTransactional The isTransactional() method returns true if the bean is in transactional mode, otherwise it returns false. boolean isTransactional() Returns True or false.
The JoltSessionBean that is used by this service bean Usage Sets the JoltSessionBean associated with this JoltServiceBean. getSession The getSession() method gets the JoltSessionBean used by this JoltServiceBean. JoltSessionBean getSession() Returns JoltSessionBean Usage Gets the JoltSessionBean used by this JoltServiceBean. getOutputValue -- value of field The getOutputValue() method gets the value of a field in the output buffer using the field's native type.
getOutputValues The getOutputValues() method gets all of the occurrences of a field in the output buffer using field's native type. Object[] getOutputValues(String fieldName) fieldName The name of the field. Returns The occurrences of the field. Usage Gets all of the occurrences of a field in the output buffer using field's native type. Throws NoSuchFieldError getOutputTextValue -- value of field The getOutputTextValue() method gets the value of a field in the output buffer as a String.
Throws NoSuchFieldError getOutputTextValues The getOutputTextValues() method gets all the occurrences of a field in the output buffer as String. String[] getOutputTextValues(String fieldName) fieldName The name of the field. Returns The occurrences of the field as a String. Usage Gets all the occurrences of a field in the output buffer as String. Throws NoSuchFieldError setInputValue -- value of field The setInputValue() method sets the value of a field in the input buffer using the field's native type.
value Value to be set. Usage Sets the value of one occurrence of a field in the input buffer using the field's native type. Throws NoSuchFieldError, ClassCastException setInputValues The setInputValues() method sets all the occurrences of a field in the input buffer using the field's native type. void setInputValues(String fieldName, Object values[]) fieldName The name of the field. values The value to set. Usage Sets all the occurrences of a field in the input buffer using the field's native type.
void setInputTextValue(String fieldName, int index, String textValue) fieldName The name of the field. index Index of the field. textValue The value to set. Usage Sets the value of one occurrence of a field in the input buffer as a String. Throws NoSuchFieldError, NumberFormatException setInputTextValues The setInputTextValues() method sets all the occurrences of a field in the input buffer as String. void setInputTextValues(String fieldName, String textValues[]) fieldName The name of the field.
Throws NoSuchFieldError clear void clear() Usage This method clears the underlying input and output buffers. callService The callService() method invokes the remote service. void callService() Usage Invokes the remote service. Throws ServiceException, TransactionException, ApplicationException addJoltOutputListener The addJoltOutputListener() method adds a JoltOutputEvent listener. synchronized void addJoltOutputListener( JoltOutputListener listener) listener The event listener to be added.
JoltSessionBean Class java.lang.Object | +----bea.jolt.beans.JoltSessionBean The JoltSessionBean represents the TUXEDO session. It includes the functionality of JoltSession, JoltSessionAttributes, and JoltTransaction classes. The JoltSessionBean offers properties to set session attributes and methods that open and close a TUXEDO session. It also sends a propertyChange event for the LoggedOn property when the TUXEDO session is established.
● rollbackTransaction ● setUserPassword ● isInTransaction ● getUserPassword ● getAppAddress ● setAppPassword ● setAppAddress ● getAppPassword ● getIdleTimeOut addJoltOutputListener The addJoltOutputListener() method adds a JoltOutputEvent listener. synchronized void addJoltOutputListener( JoltOutputListener listener) listener Event listener to be added. Usage Adds a JoltOutputEvent listener. removeJoltOutputListener The removeJoltOutputListener() method removes a JoltOutputEvent listener.
addPropertyChangeListener The specified PropertyChangeListener's propertyChange() method is called each time the value of the LoggedOn property changes. void addPropertyChangeListener(PropertyChangeListener l) l The PropertyChangeListener. Usage The specified PropertyChangeListener's propertyChange() method is called each time the value of the loggedOn property changes. removePropertyChangeListener The removePropertyChangeListener() method removes the PropertyChangeListener from the internal list.
clear The clear() method resets all session attributes. void clear() Usage Resets all session attributes. Throws SessionException beginTransaction The beginTransaction() method starts the transaction. void beginTransaction(int timeout) timeout Transaction timeout Usage Starts a transaction. If this method is called twice without commitTransaction or abortTransaction, a TransactionException is raised. Throws TransactionException commitTransaction The commitTransaction() method commits the transaction.
isInTransaction The isInTransaction() method returns true or false depending on whether there is a started transaction. boolean isInTransaction() Returns True if in a transaction, that is a transaction has started and not committed or aborted, and false otherwise. getAppAddress The getAppAddress() method gets the IP address (host name and port number) of the JSL or the Jolt Relay. String getAppAddress() Returns The APPADDRESS.
setIdleTimeOut The setIdleTimeOut() method sets the IDLETIMEOUT attribute. void setIdleTimeOut(int value) value The new IDLETIMEOUT value. Usage Sets the IDLETIMEOUT attribute. setReceiveTimeOut The setReceiveTimeOut() method sets the RECVTIMEOUT attribute. void setReceiveTimeOut(int value) value The new RECVTIMEOUT value. Usage Sets the RECVTIMEOUT attribute. getReceiveTimeOut The getReceiveTimeOut() method gets the RECVTIMEOUT attribute. int getReceiveTimeOut() Returns Receive timeout value.
getSendTimeOut The getSendTimeOut() method gets the SENDTIMEOUT attribute. int getSendTimeOut() Returns Send timeout value. Usage Gets the SENDTIMEOUT attribute. getSessionTimeOut The getSessionTimeOut() method gets the SESSIONTIMEOUT attribute. String getSessionTimeOut() Returns Session timeout value. Usage Gets the SESSIONTIMEOUT attribute. setUserName The setUserName() method sets the TUXEDO user name to be used at logon. void setUserName(String value) value TUXEDO user name.
value TUXEDO user role. Usage Sets the TUXEDO user role to be used at logon. getUserRole The getUserRole() method gets the TUXEDO user role to be used at logon. String getUserRole() Returns TUXEDO user role. Usage Gets the TUXEDO user role to be used at logon. setUserPassword The setUserPassword() method sets the TUXEDO user password to be used at logon. void setUserPassword(String value) value TUXEDO user password. Usage Sets the TUXEDO user password to be used at logon.
getAppPassword The getAppPassword() method gets the TUXEDO application password to be used at logon. String getAppPassword() Returns TUXEDO application password. Usage Gets the TUXEDO application password to be used at logon. JoltUserEventBean Class java.lang.Object | +----bea.jolt.beans.JoltUserEventBean The JoltUserEventBean provides access to TUXEDO events. The TUXEDO event to be subscribed to is defined by setting the appropriate parameters of this bean.
propertyChange The propertyChange() method is the event handler for PropertyChange events. void propertyChange(PropertyChangeEvent evt) evt The event object. Usage Event handler for PropertyChange events. The JoltSessionBean notifies the JoltUserEventBean when it logs on and off by raising a PropertyChangeEvent about its LoggedOn property. The logoff of a session, other than the current session, does not affect the JoltUserEventBean. This method should not be called directly.
getFilter The getFilter() method gets the event filter. String getFilter() Returns Regular expression Usage Gets the event filter. setSession The setSession() method is used when the JoltUserEventBean is created after the logon event. void setSession(JoltSessionBean value) value JoltSessionBean Usage This method is used in cases when the JoltUserEventBean is created after the logon event. Otherwise, the JoltUserEventBean can get access to a TUXEDO client session by listening to propertyChangeEvents.
subscribe The subscribe() method activates the subscription to an event. void subscribe() Usage Activates the subscription to an event.
5. Jolt Aware AWT Beans Class Library Reference The Jolt aware AWT Beans Class Library provides a Jolt enabled versions of standard AWT components, such as TextField, Label, and List. Using the Jolt aware AWT Beans, you can develop Jolt GUIs with minimal coding. For information about the JoltBeans toolkit, refer to Section 4, JoltBeans Toolkit Class Library Reference The bea.jolt.beans.
JoltCheckbox Constructor JoltCheckbox() JoltCheckbox Methods The following methods are used in conjunction with the JoltCheckbox class: ● addJoltInputListener ● setJoltFieldName ● removeJoltInputListener ● getTrueValue ● setOccurrenceIndex ● setTrueValue ● getOccurrenceIndex ● getFalseValue ● getJoltFieldName ● setFalseValue addJoltInputListener The addJoltInputListener() method registers JoltInput listeners.
setOccurrenceIndex The setOccurrenceIndex() method sets the occurrence index of the field represented by this JoltCheckbox. void setOccurrenceIndex(int occurrence) occurrence The occurrence number. Usage Sets the occurrence index of the field represented by this JoltCheckbox. getOccurrenceIndex The getOccurrenceIndex() method gets the occurrence index of the field represented by this JoltCheckbox. int getOccurrenceIndex() Usage Get the occurrence index of the field represented by this JoltCheckbox.
String getTrueValue() Returns The true value. Usage Gets the field value represented by this JoltCheckbox if the box is checked. setTrueValue The setTrueValue() method sets the String value that is represented by this JoltCheckbox if the box is checked. void setTrueValue(String value) value The true value. Usage Sets the field value that is represented by this JoltCheckbox if the box is checked.
+----java.awt.Component | +----java.awt.Choice | +----bea.jolt.beans.awt.JoltChoice The JoltChoice class provides a Jolt aware extension of java.awt.Choice that is linked to a specific field in the input buffer by its JoltFieldName property. If the field occurs multiple times, the occurrence this choice is linked to is specified by the occurrenceIndex property of this bean. It can be connected with JoltServiceBeans to contain parts of the input for a service.
removeJoltInputListener The removeJoltInputListener() method unregisters JoltInput listeners. synchronized void removeJoltInputListener( JoltInputListener listener) listener The listener to be removed. Usage Unregisters JoltInput listeners. setOccurrenceIndex The setOccurrenceIndex() method sets the occurrence index of the field represented by this JoltChoice. void setOccurrenceIndex(int occurrence) occurrence The occurrence number.
setJoltFieldName The setJoltFieldName() method sets the field name (Jolt field name) corresponding to this Choice. void setJoltFieldName(String name) name The Jolt field name. Usage Sets the Jolt field name corresponding to the field represented by this JoltChoice. getItems The getItems() method gets the selected items corresponding to the field represented by this JoltChoice. String[] getItems() Returns The array of selected items. Usage Gets the selected items corresponding to this choice.
its JoltFieldName property. If the field occurs multiple times, the occurrence this label is linked to is specified by the occurrenceIndex property of this bean. JoltLabel can be connected with JoltServiceBeans to display output from a service. A JoltLabel listens to JoltOutputEvents from JoltServiceBeans and updates its contents according to the occurrences of the field to which it is linked.
The occurrence number. Usage Sets the occurrence index of this field. getOccurrenceIndex The getOccurrenceIndex() method gets the occurrence index of the field represented by this JoltLabel. int getOccurrenceIndex() Usage Gets the occurrence index of this field. getJoltFieldName The getJoltFieldName() method gets the Jolt field name corresponding to this Label. String getJoltFieldName() Returns The Jolt field name. Usage Gets the Jolt field name corresponding to this JoltLabel.
this textfield is linked to is specified by the occurrenceIndex property of this bean. JoltTextField can be connected with JoltServiceBeans in two ways: ● JoltTextField contains parts of the input for a service. A JoltServiceBean may listen to events raised by a JoltTextField. JoltTextField sends JoltInputEvents to its listeners (typically JoltServiceBeans) when its contents changes. ● JoltTextField displays output from a service.
removeJoltInputListener The removeJoltInputListener() method unregisters JoltInput listeners. synchronized void removeJoltInputListener( JoltInputListener l) l The listener to be removed Usage Unregisters JoltInput listeners. getJoltFieldName The getJoltFieldName() method gets the Jolt field name corresponding to this JoltList. String getJoltFieldName() Returns The Jolt field name. Usage Gets the Jolt field name corresponding to this JoltList.
getOccurrenceIndex The getOccurrenceIndex() method gets the occurrence index of the field represented by this JoltList. int getOccurrenceIndex() Usage Gets the occurrence index of this field. JoltTextField Class java.lang.Object | +----java.awt.Component | +----java.awt.TextComponent | +----java.awt.TextField | +----bea.jolt.beans.awt.JoltTextField A Jolt aware extension of java.awt.TextField that is linked to a specific field in the Jolt buffer by its JoltFieldName property.
● addJoltInputListener ● getJoltFieldName ● addJoltInputListener ● setJoltFieldName ● removeJoltInputListener ● setOccurrenceIndex ● serviceReturned ● getOccurrenceIndex addJoltInputListener The addJoltInputListener() method registers JoltInput listeners. synchronized void addJoltInputListener(JoltInputListener l) l The listener to be added Usage Registers JoltInput listeners. removeJoltInputListener The removeJoltInputListener() method unregisters JoltInput listeners.
getJoltFieldName The getJoltFieldName() method gets the field name corresponding to this JoltTextField. String getJoltFieldName() Returns The Jolt field name. Usage Gets the Jolt field name corresponding to this JoltTextField. setJoltFieldName The setJoltFieldName() method sets the field name corresponding to this JoltTextField. void setJoltFieldName(String name) name The Jolt field name. Usage Sets the Jolt field name corresponding to this JoltTextField.
Index A addJoltInputListener method JoltCheckbox class 83 JoltChoice class 86 JoltList class 91 JoltTextField class 94 addJoltOutputListener method JoltServiceBean class 67 JoltSessionBean class 69 addPropertyChangeListener method 70 Applications, programming JoltBeans, using custom GUI elements 43 JoltBeans, using TUXEDO event subscription and notification 45 JoltBeans, using with transactions 43 B Beans See JoltBeans and JavaBeans beginTransaction method 71 Building a Java form, example of 28 C callServ
JoltSessionBean class 68 JoltTextField class 93 JoltUserEventBean class 77 Custom Property Editor accessing 26 example of 41 D dataChanged method 59 E Event notifications TUXEDO and JoltBeans support 45 Event subscription TUXEDO and JoltBeans support 45 Events JoltBeans events overview 16 using JavaBeans events 17 G getAppAddress method 72 getEventName method 78 getFalseValue method 85 getFieldName method 52 getFilter method 78 getIdleTimeOut method 73 getItems method 87 getJoltFieldName method JoltCheck
JoltServiceBean class 67 getOccurrenceIndex method JoltCheckbox class 83 JoltChoice class 87 JoltLabel class 89 JoltList class 92 JoltTextField class 95 getOutputTextValue method JoltServiceBean class, one occurrence of a field 63 JoltServiceBean class, value of a field 62 getOutputTextValues method 63 getOutputValue method JoltServiceBean class, value of a field 61 JoltServiceBean class, value of one occurrence of a field 61 getOutputValues method 62 getReceiveTimeOut method 74 getServiceName method 59 get
I Installing JoltBeans 19/20 isEventMessage method 54 isInTransaction method 72 isLoggedOn method 70 isText method 53 isTransactional method 59 isVector method 53 J Java bean, definition of 16 Developer's Kit, support for 20 JavaBeans See also JoltBeans events relationship to JoltBeans events 16 product, definition of 16 Jolt See also JoltBeans aware AWT beans, definition of 16 aware beans, definition of 16 Jolt aware AWT Beans class library, definition of 81 Jolt aware AWT beans description of 24 JoltBean
overview 21 overview of toolkit 15 properties, modifying 26 transactions, using with 43 TUXEDO event subscription and notification, using 45 using JavaBeans events 17 JoltBeans class library aware AWT Beans, definition of 81 how to use, walk-through 27/39 Java form example applet for BANKAPP 27/39 Toolkit, definition of 47 JoltBeans repository logon example 41 using 39/42 JoltBeans toolkit components of 22 definition of 16 overview 15 JoltCheckbox aware AWT bean description of 25 Property List required inpu
constructors, single data element 48 constructors, single element string 50 creating an instance of 48/51 definition and overview 48 methods used with 51/53 JoltLabel aware AWT bean description of 25 Property List required input 40 JoltLabel class creating an instance of 88 definition and overview 88 methods used with 88/90 JoltList aware AWT bean description of 25 Property List required input 40 JoltList class definition and overview 90 methods used with 90/92 JoltOutputEvent class definition and overview
methods used with 69/76 JoltTextField aware AWT bean description of 24 Property List required input 40 property list, example of 32 JoltTextField class creating an instance of 93 definition and overview 93 methods used with 93/95 JoltUserEventBean bean description of 24 properties of 24 Property List required input 40 JoltUserEventBean class creating an instance of 77 definition and overview 77 methods used with 77/79 L logoff method 71 logon method 71 P Properties modifying JoltBeans properties 26 settin
R removeJoltInputListener method JoltCheckbox class 83 JoltChoice class 86 JoltList class 91 JoltTextField class 94 removeJoltOutputListener method JoltServiceBean class 68 JoltSessionBean class 70 removePropertyChangeListener method 70 rollbackTransaction method 72 S serviceReturned method JoltLabel class 89 JoltList class 91 JoltTextField class 94 setAppAddress method 73 setEventName method 78 setFalseValue method 85 setFilter method 78 setIdleTimeOut method 73 setInputTextValue method JoltServiceBean cl
JoltList class 92 JoltTextField class 95 setOccurrenceIndex method JoltCheckbox class 83 JoltChoice class 86 JoltLabel class 89 JoltList class 92 JoltTextField class 95 setReceiveTimeOut method 73 setSendTimeOut method 74 setServiceName method 59 setSession method JoltServiceBean class 60 JoltUserEventBean class 79 setTransactional method 60 setTrueValue method 84 subscribe method 79 T TUXEDO events relationship to JoltBeans events 16 U unsubscribe method JoltUserEventBean class 79 W Wiring definition of
About This Guide This guide describes the WAS (Web Application Services) component of Jolt for NonStop TUXEDO and gives instructions for using this component for creating applications. Who Should Read This Guide This guide is intended for developers who are interested in building applications using a Web Server scripting language and Jolt for NonStop TUXEDO. It assumes a familiarity with Jolt for NonStop TUXEDO, NonStop TUXEDO, VB Script, and Java programming.
When you send an Internet mail message to us, we immediately acknowledge receipt of your message. A detailed response to your message is sent as soon as possible. Be sure to include your name, company name, address, and phone number in your message. If your comments are specific to a particular manual, also include the document version (part number or publication date) and title of the manual. Many of the improvements you see in manuals are a result of suggestions from our customers.
1. Introducing the Jolt Web Application Services The Jolt Web Application Services Toolkit is an extension to the Jolt 1.1 Java class library. The Toolkit allows the Jolt client class library to be used in a Web Server to provide an interface between HTML clients or browsers, and TUXEDO services. The Jolt Web Application Services provides an ease-of-use interface for processing and generating dynamic HTML pages with the Jolt Web Application Services.
walkthrough. How the Jolt Web Application Services Works The Jolt Web Application Services architecture includes three main components: a session, a session pool, and a session pool manager. A session object represents a connection with the TUXEDO system. A session pool represents many physical connections between the Web server and the TUXEDO system. It also associates a session with an HTTP request.
Refer to the Section 4, Web Application Services Class Library Reference for additional information about the SessionPool Class and SessionPoolManager Class. Refer to Section 3, Using the Web Application Services with Microsoft Active Server Pages for information about the how to use the Jolt Web Application services and complete a sample walkthrough.
2. Installing the Jolt Web Application Services This chapter includes Jolt WAS Installation Requirements information. For information about the Jolt 1.1 installation, refer to the Jolt for NonStop TUXEDO User Guide. Note The following instructions are taken from the JoltWeb.txt "Read Me" file on the product CD. Installation Requirements ● Windows NT Server 4.0 with NT Option Pack ● Microsoft IIS 4.0 ● NonStop TUXEDO Release 6.4 or later ● Jolt for NonStop TUXEDO 1.1 Installation Instructions 1.
3. Install the Web Application Services classes in the Windows NT server java\Trustlib directory. Unzip webiis.zip to create the class files in your java\trustlib directory. Make sure you expand the files using the subdirectory folders in the zip archive. The Web Application Services classes have been created in packages beginning with "bea" so the java VM will expect to find them in the java\Trustlib\bea\... subdirectories. 4. Register the Web Application Service classes as ActiveX components.
3. Using the Web Application Services with Microsoft Active Server Pages The Web Application Services Toolkit is an extension to the Jolt 1.1 Java class library. The Toolkit allows the Jolt client class library to be used in a Web Server to provide an interface between HTML clients or browsers, and a TUXEDO application. A complete listing of all the examples used in this chapter are distributed with the Jolt Web Application Services software.
❍ Returning the Results to the Client Getting Started Checklist Review this checklist before starting the TRANSFER Request Walkthrough. Note This checklist applies to Microsoft Active Server Pages only. 1. Ensure that you have a supported browser installed on your client machine. The client machine must have a network connection to the Web server that is used to connect to the TUXEDO environment. 2. Configure and boot TUXEDO and the TUXEDO bankapp example. a. Make sure the TRANSFER service is available.
/pkg/iis/teller. Note Edit the file, web_start.inc, to specify the correct hostname and port number for the Jolt Session Pool. 7. The code samples shown in TRANSFER Request Walkthrough are available from a sample application delivered with the Jolt Web Application Services software. Table 3-1 lists the files in the sample application. These files are a valuable reference for the walkthrough and are located in /pkg/iis/teller. Table 3-1.
In the final part of this walkthrough, run the necessary HTML pages and server-side VBScript logic to execute a TRANSFER. TRANSFER Request Walkthrough This section explains what happens when you execute a TRANSFER request. Each step is not illustrated here, only those steps that are necessary.
The page, tellerForm.asp contains VBScript procedures required to initialize the Jolt Session Pool Manager. The initialization code is contained in an ASP Script block. This code tells the Web server to execute this block of code on the server, instead of sending it to the client. Example 3-1. tellerForm.
called is web_start(). This procedure (in the file web_start.inc) should have been edited as part of the teller application installation process in Getting Started Checklist. The procedure web_cacheTemplates() reads various HTML template files into a memory cache. This step is not required, but it improves performance. Example 3-2. tellerForm.asp: Allow the user to choose TRANSFER service PAGE 270
The form in Figure 3-2 is generated by the page transferForm.htm. This page presents you with a form that will be used for input. The page consists of three text fields (two account numbers and a dollar amount), and a button that, when pressed, will cause the TRANSFER service to be invoked. The code segment in Example 3-3 shows the key HTML elements for this page. The highlighted elements in Example 3-3 correspond to the elements in Table 3-2. Example 3-3. transferForm.
'// Choose the response template If IsEmpty(Application("templates")) Then Set template = Server.CreateObject("BEAWEB.Template") Else Select Case Request("SVCNAME") Case "INQUIRY" Set template = Application("templates")(INQUIRY) Case "DEPOSIT" Set template = Application("templates")(DEPOSIT) Case "WITHDRAWAL" Set template = Application("templates")(WITHDRAWAL) Case "TRANSFER" Set template = Application("templates")(TRANSFER) End Select End If Next, call the TUXEDO service.
| Account # | Balance |
From: | <%=ACCOUNT_ID[0]%> | <%=SBALANCE[0]%> |
To: | <%=ACCOUNT_ID[1]%> | <%=SBALANCE[1]%> |
To substitute the placeholders in the template with the actual values of the data returned from the service call, use the eval() method of the Template object shown in Example 3-9.s
4. Web Application Services Class Library Reference The Web Application Services Class Library consists of object-oriented Java language classes for creating a TUXEDO session. The Web Application Services Class Library Reference includes the following topics: ● bea.web Package ❍ UserInfo Class ❍ SessionPoolManager Class ❍ SessionPool Class ❍ Connection Class ❍ Transaction Class ❍ Template Class ❍ TemplateData Class ❍ Result Class bea.
UserInfo Class java.lang.Object | +----bea.web.UserInfo This class contains the TUXEDO user authentication information. This information may be needed to create a TUXEDO session. If the user does not want to expose the authentication information on the web server, the user may embed the authentication information within a derived class. UserInfo Constructor The following constructor creates an instance of the UserInfo class. UserInfo() Usage This constructor creates an instance of the UserInfo class.
setUserPassword void setUserPassword(String password) password A valid user password. Usage You must set the TUXEDO user password before creating a session. This is only required if the user authorization level is specified in TUXEDO. setUserRole void setUserRole(String userrole) userrole A valid user role. Usage You must set the TUXEDO user role before creating a session. This is only required if the user authorization level is specified in TUXEDO.
session pool to serve the request. SessionPoolManager Methods The following methods are used in conjunction with the SessionPoolManager class: ● done ● createSessionPool ● stopSessionPool ● getSessionPool ● suspendSessionPool ● removeSessionPool done final void done() Usage Done with this session manager. createSessionPool final int createSessionPool(String addrs[], String saddrs[], int minCons, int maxCons, UserInfo usr, String id) addrs A list of primary server addresses.
Reserved for future use. Must be null. Returns This method returns the number of successful connections. Usage Create a session pool with multiple restartable connections. The caller provides a unique ID to identify the session pool. If a connection in the session pool is terminated unexpectedly, a new connection will be established to keep the session pool alive.
This method is part of the administrative class library. removeSessionPool final void removeSessionPool(String id) Parameters id Reserved for future use. Must be null. Usage Shut down and remove the session pool; all active connections in this session pool are terminated immediately. The ID must match the id in createSessionPool(). This method is part of the administrative class library. SessionPool Class java.lang.Object | +----bea.web.
● isSuspended startTransaction Transaction startTransaction(int timeout) timeout The transaction time-out value in seconds. Returns A transaction object, or null if failure occurs. Usage Start a transaction. The transaction should be committed or aborted before continuing to another page, unless programmatic arrangements to commit or abort the transaction have been made. Otherwise, the connection is locked until the transaction is terminated.
isSuspended boolean isSuspended() Usage Check if this session pool is suspended. A suspended session pool does not accept any new requests. This method is part of the administrative class library. Connection Class java.lang.Object | +----bea.web.Connection This class represents a connection (session) to a Jolt server and provides simple methods for service invocations and transaction demarcation. This class is a part of the administrative class library.
getErrorCount final int getErrorCount() Usage Get the cumulative system error count. getUseCount final int getUseCount() Usage Get the outstanding request count. inTransaction boolean inTransaction() Returns True if the connection is in a transaction; false otherwise. Usage Check if the connection is in a transaction. isAlive boolean isAlive() Returns True if the connection is still alive; false otherwise. Usage Check if the connection is still alive. Transaction Class java.lang.Object | +----bea.web.
● rollback commit int commit() Returns 0 if successful; otherwise, a TUXEDO error number. Usage Commit the transaction. rollback int rollback() Returns 0 if successful; otherwise, a TUXEDO error number. Usage Roll back the transaction. Template Class java.lang.Object | +----bea.web.Template This base class processes a template and replaces tags of the form <%=name%> or indexed tags of the form <%=name[index]%> (where name and index are user-defined constructs) with values.
The path to the template file. Returns 0 if success; -1 if file cannot be opened. Usage Load the template file into memory. The contents are cached until the unload method is called. unload final void unload() Usage Unload the cached template contents. TemplateData Class java.lang.Object | +----java.util.Dictionary | +----java.util.Hashtable | +----bea.web.TemplateData This base class extends from java.util.Hashtable and it provides a fast mechanism to store and retrieve a data element by name and index.
● getCount setValue -- by index void setValue(String name, int index, String value) name The name of the data element. index The index of the data element. value The value of the data element. Usage Set the string value of a data element associated with a name and an index. setValue void setValue(String name, String value) name The name of the data element. value The value of the data element. Usage This method is the same as setValue(name,0,value) for a non-octet value.
Usage Get the string value of a data element associated with a name and an index. Most output data, except carray (octets) data type, are automatically converted to String. If there is a typecast error, the default value will be returned. getValue String getValue(String name, String defaultValue) name The name of the data element. defaultValue The default value if the element does not exist. Returns The value of the data element, or the default value.
The default value if the data element does not exist. Returns The octet value of the data element or the default value. Usage This method is same as getBytesValue(name, 0, defval) method. setBytesValue -- by index void setBytesValue(String name, int index, byte value[]) name The name of the data element. index The index of the data element. value The octet value for the data element. Usage Set the octet value of a data element associated with a name and an index.
Result Class java.lang.Object | +----java.util.Dictionary | +----java.util.Hashtable | +----bea.web.TemplateData | +----bea.web.Result This class represents the result set from the service invocation. Most output data types are converted into String, except carray which remains as byte[]. The caller must use the getBytesValue() methods to get the carray data. The keys to the hash table are the field names in the result set.
getApplicationCode int getApplicationCode() Returns The application code. Usage Get the application code returned by the service. The application code is same as the tpurcode in TUXEDO. getError int getError() Returns The error number. Usage Get the system (non-TPESVCFAIL) error number. The error number is the same as the tperrno in TUXEDO. getErrorDetail int getErrorDetail() Returns The detail system error number, if TUXEDO 6.4; otherwise 0. Usage Get the detail system error number.
noError boolean noError() Returns True if no error occurred; false otherwise. Usage Test whether no error was encountered in the last service invocation. systemError boolean systemError() Returns True if a system error occurred; false otherwise. Usage Test whether a system error occurred in the last service invocation.
5. BEAWEB Components for Microsoft Active Server Pages The BEAWEB components contain the objects specific for Microsoft Active Server Pages (ASP). These objects are: ● SessionPoolManager Object ● SessionPool Object ● Template Object ● TemplateData Object ● Connection Object ● UserInfo Object ● Transaction Object ● Result Object SessionPoolManager Object This object provides a session pool factory for the Microsoft specific SessionPool object. BEAWEB.
● stopSessionPool ● removeSessionPool ● getSessionPool done done() Usage Done with this session manager. Stops all session pools and terminates all active connections immediately. createSessionPool int createSessionPool(String addrs[], String saddrs[], int minCons, int maxCons, UserInfo usr, String id) addrs A list of primary server addresses. saddrs A list of secondary server addresses for failover. minCons The minimum number of connections to start with.
suspendSessionPool suspendSessionPool(String id, boolean action) id Reserved for future use. Must be null. action true to suspend the session pool; false to resume it. Usage Suspend this session pool so it will not accept any new requests. It allows the administrator to shut down the session pool gracefully. The ID must be null for this release. This method is part of the administrative object library. stopSessionPool stopSessionPool(String id) id Reserved for future use. Must be null.
Returns A session pool or nothing if it does not exist. Usage Get the session pool. If the session pool does not exist, this method will return nothing. The ID must be null for this release. SessionPool Object This object provides a SessionPool implementation for the Microsoft Active Server Pages environment. It is created by the createSessionPool method in the SessionPoolManager object.
object are ignored. The tran parameter must be the object returned by the startTransaction() method. startTransaction Transaction startTransaction(int timeout) timeout The transaction time-out value in seconds. Returns A transaction object, or nothing if failure occurs. Usage Start a transaction. The transaction should be committed or aborted before continuing to another page, unless programmatic arrangements to commit or abort the transaction have been made.
isSuspended boolean isSuspended() Usage Check if this session pool is suspended, so it does not accept any new requests. This method is part of the administrative class library. Template Object This object provides the Template implementation for the Microsoft Application Server Pages. The output of the template content is sent to the web server response buffer. BEAWEB.Template Component The following component creates an instance of the Template object. Server.CreateObject ("BEAWEB.
evalFile int evalFile(String path, TemplateData data[]) path A path of the template file data An array of TemplateData or Result objects Returns 0 if success; -1 if the template file cannot be opened or there is an I/O error. Usage Replace the tags in a template file with the values from a list of template data set. The list is an array object. load int load(String path) path A path of the template file Returns 0 if success, -1 if file cannot be opened.
BEAWEB.TemplateData Component The following component creates instances of the TemplateData object. Server.CreateObject ("BEAWEB.TemplateData") TemplateData Methods The following methods are used in conjunction with the TemplateData object: ● setValue ● getValue ● setValueByIndex ● getValueByIndex ● setBytesValue ● getBytesValue ● getBytesValueByIndex ● setBytesValueByIndex ● getCount ● importRequest setValue setValue(String name, String value) name The name of the data element.
getValue String getValue(String name, String defval) name The name of the data element. defval The default string value for the data element, if it does not exist. Returns The string value of the data element or the default value. Usage Get the string value of a data element associated with a name. Most output data, except carray (octets) data type, are automatically converted to String. If there is a type-cast error, the default value will be returned.
Returns The string value of the data element or the default value. Usage Get the string value of a data element associated with a name and an index. Most output data, except carray (octets) data type, are automatically converted to String. If there is a type-cast error, the default value will be returned. setBytesValue setBytesValue(String name, byte value[]) name The name of the data element. value The byte value for the data element.
defval The default value if the data element does not exist. Returns The octet value of the data element or the default value. Usage Get the octet value of a data element associated with a name and an index. If an output field has carray (octets) data type, the data remains as byte[]. The caller must use this method to retrieve the data. If there is a type-cast error, the default value will be returned.
Connection Object This object represents a connection (TUXEDO session) to a Jolt server and provides simple methods for connection status. It is returned from the getConnection method on the SessionPool object. This object is a part of the administrative class library.
getUseCount int getUseCount() Usage Get the outstanding request count. inTransaction boolean inTransaction() Returns True if the connection is in a transaction; false otherwise. Usage Check if the connection is in a transaction. isAlive boolean isAlive() Returns True if the connection is still alive; false otherwise. Usage Check if the connection is still alive. UserInfo Object This object contains the TUXEDO user authentication information. This information may be needed to create a TUXEDO session.
● setUserRole ● setAppPassword setUserName setUserName(String username) username Specifies a valid user name. Usage You must set the TUXEDO user name before creating a session pool. This is only required if the user authorization level is specified in TUXEDO. setUserPassword setUserPassword(String password) password A valid user password. Usage You must set the TUXEDO user password before creating a session. This is only required if the user authorization level is specified in TUXEDO.
Transaction Object This object is a wrapper for the bea.jolt.JoltTransaction object. If an error occurs, the method in this object returns an error code instead of throwing an exception. This object is returned by the startTransaction method or the SessionPool object. Transaction Methods The following methods are used in conjunction with the Transaction object: ● commit ● rollback commit int commit() Returns 0 if successful; otherwise, a TUXEDO error number. Usage Commit the transaction.
Result Methods The following methods are used in conjunction with the Result object: ● applicationError ● systemError ● getError ● getErrorDetail ● getApplicationCode ● getStringError ● getStringErrorDetail ● noError ● setValue ● getValue ● setValueByIndex ● getValueByIndex ● setBytesValue ● getBytesValue ● getBytesValueByIndex ● setBytesValueByIndex ● getCount applicationError boolean applicationError() Returns True if an application error occurs.
systemError boolean systemError() Returns True if a system error occurs. Usage Test if a system error occurred in the corresponding service invocation. getError int getError() Returns The system error number. Usage Get the system (non-TPESVCFAIL) error number. The error number is same as the tperrno in TUXEDO. getErrorDetail int getErrorDetail() Returns The detail system error number or 0. Usage Get the detail system error number. This information is available only to TUXEDO 6.
getStringErrorDetail String getStringErrorDetail() Returns The detail system error message or null. Usage Get the detail system error message. This information is available only to TUXEDO 6.4 and then only if the service call has timed out. noError boolean noError() Returns True if there is no error. Usage Test if no error was encountered in the corresponding service invocation. setValue setValue(String name, String value) name The name of the data element. value The string value for the data element.
setValueByIndex setValueByIndex(String name, int index, String value) name The name of the data element. index The index of the data element, starting from 0. value The string value for the data element. Usage Set the string value of a data element associated with a name and an index. getValueByIndex String getValueByIndex(String name, int index, String defval) name The name of the data element index The index of the data element, starting from 0.
Usage This method is same as setBytesByIndexValue(name,0,value) for the octet value. getBytesValue byte[] getBytesValue(String name, byte defval[]) name The name of the data element defval The default value if the data element does not exist. Returns The octet value of the data element or the default value. Usage Get the octet value of a data element associated with a name. If an output field has carray (octets) data type, the data remains as byte[]. The caller must use this method to retrieve the data.
index The index of the data element. value The byte value for the data element. Usage Set the octet value of a data element associated with a name and an index. The data element should be defined as carray in the TUXEDO application. getCount int getCount(String name) name The name of the data element. Returns The count of occurrences. Usage Get occurrence count of a data element. importRequest void importRequest() Usage Import the values from the Microsoft ASP Request object into this TemplateData object.
Index A applicationError method Result class 43 Result object for Microsoft ASP 63 B bankapp sample application source files, list of 21 TRANSFER request walk-through 20/28 TRANSFER service overview 21 BEAWEB components for Microsoft ASP SessionPoolManager object 48 Template object 53 TemplateData object 55 UserInfo object 60 bea.
SessionPoolManager class 32 SessionPoolManager object for Microsoft ASP 48 D done method SessionPoolManager class 32 SessionPoolManager object for Microsoft ASP 48 E eval method, data set list 53 evalFile method 54 G getAccessTime method Connection class 37 Connection object for Microsoft ASP 59 getAddr method Connection class 37 Connection object for Microsoft ASP 59 getApplicationCode method Result class 44 Result object for Microsoft ASP 64 getBytesValue method Result object for Microsoft ASP 67 Templ
TemplateData class 42 TemplateData object for Microsoft ASP 58 getError method Result class 44 Result object for Microsoft ASP 64 getErrorCount method Connection class 37 Connection object for Microsoft ASP 59 getErrorDetail method Result class 44 Result object for Microsoft ASP 64 getMaxConnections method SessionPool object for Microsoft ASP 52 SessionPoolClass class 35 getSessionPool method SessionPoolManager class 33 SessionPoolManager object for Microsoft ASP 50 getStringError method Result class 44 Res
I importRequest method Result object for Microsoft ASP 68 TemplateData object for Microsoft ASP 59 Installing Jolt WAS 17/18 inTransaction method Connection class 37 Connection object for Microsoft ASP 60 isAlive method Connection class 37 Connection object for Microsoft ASP 60 isSuspended method SessionPool object for Microsoft ASP 53 SessionPoolClass class 36 J Jolt See also Jolt WAS (Web Application Services) Jolt WAS (Web Application Services) architecture 14 how to use, walk-through 19/28 installing 1
N noError method Result class 45 Result object for Microsoft ASP 65 R removeSessionPool method SessionPoolManager class 34 SessionPoolManager object for Microsoft ASP 50 Result class definition and overview 43 methods used with 43/45 Result object definition and overview 63 methods used with 63/68 rollback method Transaction class 38 Transaction object for Microsoft ASP 62 S SessionPool object definition and overview 51 methods used with 51/53 SessionPoolClass class definition and overview 34 methods used
setBytesValue method Result object for Microsoft ASP 66 TemplateData class 42 TemplateData class, by index 42 TemplateData object for Microsoft ASP 57 setBytesValueByIndex method Result object for Microsoft ASP 68 TemplateData object for Microsoft ASP 58 setMaxConnections method SessionPool object for Microsoft ASP 52 SessionPoolClass class 36 setUserName method UserInfo class 31 UserInfo object for Microsoft ASP 61 setUserPassword method UserInfo class 31 UserInfo object for Microsoft ASP 61 setUserRole me
SessionPoolManager class 34 SessionPoolManager object for Microsoft ASP 49 systemError method Result class 45 Result object for Microsoft ASP 64 T tellerForm.asp example 22 Template class definition and overview 38 methods used with 38 Template object creating an instance of 53 definition and overview 53 methods used with 53/54 TemplateData class definition and overview 39 methods used with 39/43 TemplateData object creating an instance of 55 definition and overview 55 methods used with 55/59 tlr.
Template object for Microsoft ASP 54 UserInfo class creating an instance of 30 definition and overview 30 methods used with 30/31 UserInfo object creating an instance of 60 definition and overview 60 methods used with 60 W wasreg.