bea.jolt.beans
Class JoltSessionBean

java.lang.Object
  extended bybea.jolt.beans.JoltSessionBean
All Implemented Interfaces:
java.io.Serializable

public class JoltSessionBean
extends java.lang.Object
implements java.io.Serializable

The JoltSessionBean represents the Tuxedo session. It encapsulates the functionality of JoltSession, JoltSessionAttributes and JoltTransaction. The JoltSessionBean offers properties to set session attributes and methods to open and to close a Tuxedo session. It also sends a PropertyChange event for its "LoggedOn" property once the Tuxedo session is established. In addition, the JoltSessionBean provides methods to control transactions. The JoltSessionBean is an event source for JoltOutputEvents as well. These events are sent if an unsolicited message or Tuxedo user event notification arrives.

See Also:
Serialized Form

Constructor Summary
JoltSessionBean()
           
 
Method Summary
 void addJoltOutputListener(JoltOutputListener listener)
          Add a JoltOutputEvent listener.
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          The specified PropertyChangeListener's propertyChange method is called each time the value of the loggedOn property is changed.
 void beginTransaction(int timeout)
          Start a transaction.
 void clear()
          This method clears all session attributes.
 void commitTransaction()
          Commits the transaction.
 java.lang.String getAppAddress()
          Gets the IP address (host name) and port number of the JSL or the Jolt Relay.
 java.lang.String getAppPassword()
          Gets the Tuxedo application password to be used at logon.
 int getIdleTimeOut()
          Gets the IDLETIMEOUT attribute.
 java.beans.PropertyChangeEvent getPropertyChangeEvent()
          Constructor
 int getReceiveTimeOut()
          Gets the RECVTIMEOUT attribute.
 int getSendTimeOut()
          Gets the SENDTIMEOUT attribute.
 java.lang.String getSessionTimeOut()
          Gets the SESSIONTIMEOUT attribute.
 java.lang.String getUserName()
          Gets the Tuxedo user name to be used at logon.
 java.lang.String getUserPassword()
          Gets the Tuxedo user password to be used at logon.
 java.lang.String getUserRole()
          Gets the Tuxedo user role to be used at logon.
 boolean isInTransaction()
          Returns true or false depending on whether there is a started transaction.
 boolean isLoggedOn()
          Does the session exist?
 void logoff()
          This method closes the session to Tuxedo.
 void logon()
          This method opens a new session to Tuxedo.
 void removeJoltOutputListener(JoltOutputListener listener)
          Remove a JoltOutputEvent listener.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove this PropertyChangeListener from the internal list.
 void rollbackTransaction()
          Aborts the transaction.
 void setAppAddress(java.lang.String value)
          Sets the IP address (host name) and port number of the JSL or the Jolt Relay.
 void setAppPassword(java.lang.String value)
          Sets the Tuxedo application password to be used at logon.
 void setIdleTimeOut(int value)
          Sets the IDLETIMEOUT attribute.
 void setReceiveTimeOut(int value)
          Sets the RECVTIMEOUT attribute.
 void setSendTimeOut(int value)
          Sets the SENDTIMEOUT attribute.
 void setUserName(java.lang.String value)
          Sets the Tuxedo user name to be used at logon.
 void setUserPassword(java.lang.String value)
          Sets the Tuxedo user password to be used at logon.
 void setUserRole(java.lang.String value)
          Sets the Tuxedo user role to be used at logon.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JoltSessionBean

public JoltSessionBean()
Method Detail

getPropertyChangeEvent

public java.beans.PropertyChangeEvent getPropertyChangeEvent()
Constructor


addJoltOutputListener

public void addJoltOutputListener(JoltOutputListener listener)
Add a JoltOutputEvent listener.

Parameters:
listener - Event listener to be added.

removeJoltOutputListener

public void removeJoltOutputListener(JoltOutputListener listener)
Remove a JoltOutputEvent listener.

Parameters:
listener - Event listener to be removed.

isLoggedOn

public boolean isLoggedOn()
Does the session exist?

Returns:
true or false.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
The specified PropertyChangeListener's propertyChange method is called each time the value of the loggedOn property is changed. The PropertyListener object is addded to a list of PropertyChangeListeners managed by this bean, it can be removed with removePropertyChangeListener. Note: the JavaBeans specification does not require PropertyChangeListeners to run in any particular order.

Parameters:
l - The PropertyChangeListener.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove this PropertyChangeListener from the internal list. If the PropertyChangeListener is not on the list, do nothing.

Parameters:
l - The PropertyChangeListener.

logon

public void logon()
           throws SessionException
This method opens a new session to Tuxedo. If a session is already open it throws a SessionException. Upon successful logon the LoggedOn property is changed to true.

Throws:
SessionException

logoff

public void logoff()
            throws SessionException
This method closes the session to Tuxedo. Session attributes are not cleared after logoff. The LoggedOn property is changed to false.

Throws:
SessionException

clear

public void clear()
           throws SessionException
This method clears all session attributes.

Throws:
SessionException

beginTransaction

public void beginTransaction(int timeout)
                      throws TransactionException
Start a transaction. If this method is called twice without a commitTransaction or abortTransaction in between, a TransactionException is raised.

Parameters:
timeout - Transaction timeout.
Throws:
TransactionException

commitTransaction

public void commitTransaction()
                       throws TransactionException
Commits the transaction.

Throws:
TransactionException

rollbackTransaction

public void rollbackTransaction()
                         throws TransactionException
Aborts the transaction.

Throws:
TransactionException

isInTransaction

public boolean isInTransaction()
Returns true or false depending on whether there is a started transaction.

Returns:
True if in transaction, false otherwise.

getAppAddress

public java.lang.String getAppAddress()
Gets the IP address (host name) and port number of the JSL or the Jolt Relay.

Returns:
The APPADDRESS.

setAppAddress

public void setAppAddress(java.lang.String value)
Sets the IP address (host name) and port number of the JSL or the Jolt Relay.

Parameters:
value - The address of the application (APPADDRESS) attribute.

getIdleTimeOut

public int getIdleTimeOut()
Gets the IDLETIMEOUT attribute.

Returns:
Timeout value.

setIdleTimeOut

public void setIdleTimeOut(int value)
Sets the IDLETIMEOUT attribute.

Parameters:
value - The new IDLETIMEOUT attribute value.

setReceiveTimeOut

public void setReceiveTimeOut(int value)
Sets the RECVTIMEOUT attribute.

Parameters:
value - The new RECVTIMEOUT attribute value.

getReceiveTimeOut

public int getReceiveTimeOut()
Gets the RECVTIMEOUT attribute.

Returns:
Receive timeout value.

setSendTimeOut

public void setSendTimeOut(int value)
Sets the SENDTIMEOUT attribute.

Parameters:
value - The new SENDTIMEOUT attribute value.

getSendTimeOut

public int getSendTimeOut()
Gets the SENDTIMEOUT attribute.

Returns:
Send timeout value.

getSessionTimeOut

public java.lang.String getSessionTimeOut()
Gets the SESSIONTIMEOUT attribute.

Returns:
Session timeout value.

setUserName

public void setUserName(java.lang.String value)
Sets the Tuxedo user name to be used at logon.

Parameters:
value - Tuxedo user name.

getUserName

public java.lang.String getUserName()
Gets the Tuxedo user name to be used at logon.

Returns:
Tuxedo user name.

setUserRole

public void setUserRole(java.lang.String value)
Sets the Tuxedo user role to be used at logon.

Parameters:
value - Tuxedo user role.

getUserRole

public java.lang.String getUserRole()
Gets the Tuxedo user role to be used at logon.

Returns:
Tuxedo user role.

setUserPassword

public void setUserPassword(java.lang.String value)
Sets the Tuxedo user password to be used at logon.

Parameters:
value - Tuxedo user password.

getUserPassword

public java.lang.String getUserPassword()
Gets the Tuxedo user password to be used at logon.

Returns:
Tuxedo user password.

setAppPassword

public void setAppPassword(java.lang.String value)
Sets the Tuxedo application password to be used at logon.

Parameters:
value - Tuxedo application password.

getAppPassword

public java.lang.String getAppPassword()
Gets the Tuxedo application password to be used at logon.

Returns:
Tuxedo application password.