Jolt class functionality, Logon/logoff, Synchronous service calling – HP NonStop G-Series User Manual
Page 68
As objects, the Jolt classes interact in various relationships with each other. In
, 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. An object can use another object without containing it. For example, a JoltSession can use the JoltSessionAttributes
object to obtain the host and port information.
Jolt Class Functionality
Jolt classes are used to perform the basic functions of transaction processing: log on/log off, synchronous service calling, transaction
begin, commit, rollback and subscribe to events or unsolicited messages. The following sections describe how the Jolt classes are used to
perform these functions.
Logon/Logoff
The client application must log on to the TUXEDO environment prior to initiating any transaction activity. The Jolt Class Library provides
the JoltSessionAttributes class and JoltSession class to establish a connection to a TUXEDO System.
The JoltSessionAttributes class is used to contain the connection properties to a Jolt/TUXEDO system and contains various properties
about the Jolt/TUXEDO System. To establish a connection, the client application must create an instance of the JoltSession class. This
instance is the JoltSession object. By instantiating a JoltSession object, users log on to Jolt/TUXEDO or log off by calling the endSession
method.
Synchronous Service Calling
Transaction activities such as requests and replies are handled through the use of a JoltRemoteService object (an instance of the
JoltRemoteService class). Each JoltRemoteService object refers to an exported TUXEDO request/reply service. The programmer must
provide a service name and a JoltSession object to instantiate a JoltRemoteService object before it can be used.
To use a JoltRemoteService object, the programmer simply:
Sets the input parameters
●
Invokes the service
●
Examines the output parameters
●
For efficiency, Jolt does not make a copy of any input parameter object; only the references to the object (e.g., string and byte array) are
saved. Since JoltRemoteService object is a stateful object, its input parameters and the request attributes are retained throughout the life of
the object. You can use the clear() method to reset the attributes and input parameters, before reusing the JoltRemoteService object.
Since Jolt is designed for a multithreaded environment, multiple JoltRemoteService objects can be invoked simultaneously by using Java's
multithreading capability. Refer to
in this chapter for more information.