WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.cluster.ejb
Class Client.Transaction

java.lang.Object
  |
  +--examples.cluster.ejb.Client.Transaction
Direct Known Subclasses:
Client.Balance, Client.Deposit, Client.Transfer, Client.Withdrawal
Enclosing class:
Client

class Client.Transaction
extends java.lang.Object

Inner class that is used to call the transactions with the session beans.

Subclassed to perform specific transaction types.


Field Summary
(package private)  double account1Balance
           
(package private)  java.lang.String account1Id
           
(package private)  java.lang.String account1Message
           
(package private)  java.lang.String account1Server
           
(package private)  double account2Balance
           
(package private)  java.lang.String account2Id
           
(package private)  java.lang.String account2Message
           
(package private)  java.lang.String account2Server
           
(package private)  java.lang.String actionMessage
           
(package private)  double amount
           
(package private)  TellerResult result
           
(package private)  java.lang.String tellerMessage
           
(package private)  java.lang.String tellerServer
           
(package private)  java.lang.String transId
           
 
Constructor Summary
(package private) Client.Transaction()
           
 
Method Summary
(package private)  void buildReport()
          Builds a report of the result of a transaction.
(package private)  java.lang.String getTransactionID()
          Builds a unique identifier for the transaction.
(package private)  void invokeTransaction()
          Calls a TellerBean to perform a transaction.
(package private)  void printReport()
          Prints a report of the result of a transaction.
(package private)  void transaction()
          Loop that attempts to invoke a transaction on a TellerBean.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

account1Balance

double account1Balance

account1Id

java.lang.String account1Id

account1Message

java.lang.String account1Message

account1Server

java.lang.String account1Server

account2Balance

double account2Balance

account2Id

java.lang.String account2Id

account2Message

java.lang.String account2Message

account2Server

java.lang.String account2Server

actionMessage

java.lang.String actionMessage

amount

double amount

result

TellerResult result

tellerMessage

java.lang.String tellerMessage

tellerServer

java.lang.String tellerServer

transId

java.lang.String transId
Constructor Detail

Client.Transaction

Client.Transaction()
Method Detail

buildReport

void buildReport()
Builds a report of the result of a transaction. Subclassed in specific transaction types.

getTransactionID

java.lang.String getTransactionID()
Builds a unique identifier for the transaction.
Returns:
string transaction ID

invokeTransaction

void invokeTransaction()
                 throws TellerException,
                        java.rmi.RemoteException
Calls a TellerBean to perform a transaction. Subclassed in specific transaction types.
Throws:
TellerException - if there is an error in performing the transaction
java.rmi.RemoteException - if there is a communications or systems failure

printReport

void printReport()
Prints a report of the result of a transaction.

transaction

void transaction()
           throws java.lang.Exception,
                  TellerException,
                  java.rmi.RemoteException,
                  javax.ejb.CreateException
Loop that attempts to invoke a transaction on a TellerBean. It will catch any RemoteExceptions from the TellerBean, and after checking if the transaction was committed, will either return, or -- if the MAXATTEMPTS has not been exceeded -- attempt the transaction again.
Throws:
java.lang.Exception - if the transaction is not completed in the MAXATTEMPTS
TellerException - if there is an error in performing the transaction
java.rmi.RemoteException - if there is a communications or systems failure
javax.ejb.CreateException - if there is a problem creating a teller

Documentation is available at
http://e-docs.bea.com/wls/docs60

Copyright © 2000 BEA Systems, Inc. All Rights Reserved.