beautypg.com

Isalive, Onreply, Finalize – HP NonStop G-Series User Manual

Page 107

background image

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.

Throws The endSession() method throws the following exceptions:

SessionException

TPEJOLT: Invalid Session
TPEJOLT: Connection send error

The endSession() method generates a Jolt exception upon receipt of one of the following TUXEDO errors:

tpterm():

TPEPROTO, TPESYSTEM, TPEOS

Refer to

TUXEDO Errors

or tperrno in the TUXEDO System Reference Manual for explanations of these error

messages.

isAlive

Checks if the session is still alive.

boolean isAlive() throws SessionException

Usage The isAlive method will return a Boolean (true/false) value indicating whether the client session is valid or not.
The validity of the client session is checked at the Jolt Session Handler (JSH). If a client which is operating in
connection-less mode calls isAlive() while its network connection is closed, this method will cause the network
connection to be re-opened and closed.

Returns True if this session is still alive; false otherwise.

Throws The isAlive() method throws a SessionException.

onReply

Is the default event handler for all events.

void onReply( JoltReply reply )

Usage This method is the default event handler for all events. reply specifies an object containing the data message. This
method is invoked by Jolt applications and it should be overridden by the user. Client application developers need to
provide an implementation of the onReply() method to invoke when any notification is received. The JoltReply object that
is passed to the onReply() method contains any data that is included with the notification. The application can use the
methods in JoltReply and JoltMessage to retrieve this data.

Since Jolt is a multithreaded environment, the onReply() method executes on a separate thread simultaneously with other
application threads. You must, therefore, write a thread-safe handler. Separate threads could be executing the onReply()
method concurrently, so the method must be written to accommodate this possibility. Alternately, you can declare the
onReply() method as synchronized--this will cause all its invocations to be serialized.

Overrides The onReply method overrides another onReply() method.

finalize

Calls the endSession() method if an endSession() has never been called.

protected void finalize( )

Usage This method is automatically called by the Java garbage collector.

Overrides The finalize method overrides java.lang.Object.finalize().