/* * * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. * * This software is the proprietary information of Sun Microsystems, Inc. * Use is subject to license terms. * */ package com.sun.ebank.web; import com.sun.ebank.web.Currency; import com.sun.ebank.web.BeanManager; import com.sun.ebank.util.*; import com.sun.ebank.ejb.tx.TxController; import com.sun.ebank.ejb.exception.*; import java.util.*; import java.rmi.RemoteException; public class TransferBean { private BeanManager beanManager; private double transferAmount; private String fromAccountId, toAccountId; public TransferBean () { beanManager = null; transferAmount = 0.0; fromAccountId = ""; toAccountId = ""; } public void populate() { TxController txCtl = beanManager.getTxController(); try { txCtl.transferFunds(transferAmount, "Transfer", fromAccountId, toAccountId); } catch (RemoteException e) { } catch (IllegalArgumentException e) { } catch (AccountNotFoundException e) { } catch (InsufficientFundsException e) { } catch (InsufficientCreditException e) { } } public double getTransferAmount() { return transferAmount; } public String getFromAccountId() { return fromAccountId; } public String getToAccountId() { return toAccountId; } public void setBeanManager(BeanManager beanManager) { this.beanManager = beanManager; } public void setTransferAmount(double transferAmount) { this.transferAmount = transferAmount; Debug.print("Setting transfer amount to: " + transferAmount); } public void setFromAccountId(String fromAccountId) { this.fromAccountId = fromAccountId; Debug.print("Setting from account id to: " + fromAccountId); } public void setToAccountId(String toAccountId) { this.toAccountId = toAccountId; Debug.print("Setting to account id to: " + toAccountId); } }