bea.jolt
Class JoltSession

java.lang.Object
  bea.jolt.Session
      bea.jolt.JoltSession
All Implemented Interfaces:
bea.jolt.SessionState
Direct Known Subclasses:
JoltAdmSession

public class JoltSession
extends Session
implements bea.jolt.SessionState

The JoltSession class represents the logon session object and is used to access available Tuxedo services. The GUI-based Contract Repository handles the propagation of Tuxedo services to Jolt client applications. (For more information about the Contract Repository, see the BEA Jolt Developer's Guide.) You must instantiate an object for each logon session. The JoltSession object communicates data from, and connects to the Tuxedo System. The session ends with a call using the endSession() method. The JoltSession object is passed, by reference, to the JoltRemoteService and JoltTransaction objects. All Jolt transactions must pass a JoltSession to access the Tuxedo application.

See Also:
JoltSessionAttributes, JoltRemoteService, JoltTransaction, JoltReply, JoltRepository

Constructor Summary
JoltSession(JoltSessionAttributes attr, java.lang.String userName, java.lang.String userRole, java.lang.String userPassword, java.lang.String appPassword)
          The JoltSession constructor creates a JoltSession object with attributes from the JoltSessionAttributes class.
 
Method Summary
 void endSession()
          The endSession method terminates the session and ; forced shutdown was used.
 JoltRepository getRepository()
          Get the client repository that caches service definitions.
 boolean isAlive()
          The isAlive method returns a Boolean (true/false) value indicating whether the client session is valid or not.
 void onDisconnect()
          Default event handler for the loss of network connection.
 void onReply(JoltReply reply)
          The onReply method is the default event handler for all events.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JoltSession

public JoltSession(JoltSessionAttributes attr,
                   java.lang.String userName,
                   java.lang.String userRole,
                   java.lang.String userPassword,
                   java.lang.String appPassword)
            throws SessionException
The JoltSession constructor creates a JoltSession object with attributes from the JoltSessionAttributes class. The JoltSession object is the logon to the target system identified in the APPADDRESS name of the JoltSessionAttributes. In addition, you can specify the IDLETIMEOUT value (in seconds) in JoltSessionAttributes to hint to the system when to drop the network connection while retaining the session. A value of 0 means the network connection should be retained throughout the session. The administrator can override the behavior. You can set all other parameters for this constructor to null, depending upon the authentication level. The JoltSession constructor creates an instance of the JoltSession class with the specified attributes. The constructor extracts specific components to assist in joining an application and terminating a session. The JoltSession constructor allows the user identified by the userName parameter to log on to the Jolt/Tuxedo system. All parameters must be set according to the authentication level. If the logon is not successful, a SessionException is thrown. The object is returned upon completion.

Parameters:
attr - The session attributes.
userName - The user name or null.
userRole - The user role or null.
userPassword - The user password or null.
appPassword - The application password or null.
Throws:
SessionException - An exception thrown if one of the session attributes is invalid or the authentication fails.
Method Detail

endSession

public void endSession()
                throws SessionException
The endSession method terminates the session and ; forced shutdown was used.

Specified by:
endSession in class Session
Throws:
SessionException

isAlive

public boolean isAlive()
The isAlive method returns 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 operating in connectionless mode calls isAlive while its network connection is closed, this method causes the network connection to be reopened and closed.

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

onReply

public void onReply(JoltReply reply)
The onReply method is the default event handler for all events. This method is invoked by Jolt applications and it should be overridden by the user. Client application developers should provide an implementation of the onReply method to invoke when any notification is received. The onReply 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 you must write the method to accommodate this possibility. Alternatively, you can declare the onReply method as synchronized--this causes all its invocations to be serialized.

Specified by:
onReply in class Session
Parameters:
reply - Specifies an object containing the data message.

onDisconnect

public void onDisconnect()
Default event handler for the loss of network connection. This method should be overridden by the user.

Specified by:
onDisconnect in interface bea.jolt.SessionState

getRepository

public JoltRepository getRepository()
Get the client repository that caches service definitions.