WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.cluster.ejb.teller
Interface Teller

All Superinterfaces:
javax.ejb.EJBObject, java.rmi.Remote

public interface Teller
extends javax.ejb.EJBObject

The methods in this interface are the public face of TellerBean. The signatures of the methods are identical to those of the EJBean, except that these methods throw a java.rmi.RemoteException. Note that the EJBean does not implement this interface. The corresponding code-generated EJBObject, TellerBeanE, implements this interface and delegates to the bean.

Author:
Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.

Method Summary
 TellerResult balance(java.lang.String accountId)
          Returns the balance of the account in a TellerResult object.
 boolean checkTransactionId(java.lang.String transactionId)
          Returns true if the transaction with a given ID was completed (i.e., the transaction ID can be found in the transaction log table).
 TellerResult deposit(java.lang.String accountId, double amount, java.lang.String transactionId)
          Deposits amount in specified account using a specific transaction ID.
 TellerResult transfer(java.lang.String accountFromId, java.lang.String accountToId, double amount, java.lang.String transactionId)
          Transfers amount from accountFrom to accountTo using a specific transaction ID.
 TellerResult withdraw(java.lang.String accountId, double amount, java.lang.String transactionId)
          Withdraws amount from specified account using a specific transaction ID.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

balance

public TellerResult balance(java.lang.String accountId)
                     throws TellerException,
                            java.rmi.RemoteException
Returns the balance of the account in a TellerResult object.
Parameters:
accountId - string account ID
Returns:
TellerResult result of inquiry
Throws:
TellerException - if there is an error while checking the balance
java.rmi.RemoteException - if there is a communications or systems failure

checkTransactionId

public boolean checkTransactionId(java.lang.String transactionId)
                           throws java.rmi.RemoteException
Returns true if the transaction with a given ID was completed (i.e., the transaction ID can be found in the transaction log table).

Note that the code in this method is specific for Oracle databases and will require adjustment for other databases.

Parameters:
transactionID - string transaction ID
Returns:
Boolean
Throws:
java.rmi.RemoteException - if there is a communications or systems failure

deposit

public TellerResult deposit(java.lang.String accountId,
                            double amount,
                            java.lang.String transactionId)
                     throws TellerException,
                            java.rmi.RemoteException
Deposits amount in specified account using a specific transaction ID.
Parameters:
accountId - string account ID
amount - double amount to deposit
transactionId - string transaction ID
Returns:
TellerResult result of inquiry
Throws:
TellerException - if there is an error while making the deposit
java.rmi.RemoteException - if there is a communications or systems failure

transfer

public TellerResult transfer(java.lang.String accountFromId,
                             java.lang.String accountToId,
                             double amount,
                             java.lang.String transactionId)
                      throws TellerException,
                             java.rmi.RemoteException
Transfers amount from accountFrom to accountTo using a specific transaction ID.
Parameters:
accountFrom - string account ID of account taking amount from
accountTo - string account ID of account sending amount to
amount - double amount to transfer
transactionId - string transaction ID
Returns:
TellerResult result of inquiry
Throws:
TellerException - if there is an error while making the transfer
java.rmi.RemoteException - if there is a communications or systems failure

withdraw

public TellerResult withdraw(java.lang.String accountId,
                             double amount,
                             java.lang.String transactionId)
                      throws TellerException,
                             java.rmi.RemoteException
Withdraws amount from specified account using a specific transaction ID.
Parameters:
accountId - string account ID
amount - double amount to withdraw
transactionId - string transaction ID
Returns:
TellerResult result of inquiry
Throws:
TellerException - if there is an error while making the withdrawal
java.rmi.RemoteException - if there is a communications or systems failure

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

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