1 /*
2  * @(#) $Id: RemoteAccountImpl.java,v 1.2 2003/07/08 08:13:52 pankaj Exp $
3  *
4  * Copyright (c) 2002-03 by Pankaj Kumar (http://www.pankaj-k.net). 
5  * All rights reserved.
6  *
7  * The license governing the use of this file can be found in the 
8  * root directory of the containing software.
9  */
10package server;
11
12import java.rmi.Remote;
13import java.rmi.RemoteException;
14import java.rmi.server.UnicastRemoteObject;
15import java.math.BigDecimal;
16import org.jstk.example.bank.Exceptions;
17import org.jstk.example.bank.AccountIntf;
18
19public class RemoteAccountImpl extends UnicastRemoteObject implements common.RemoteAccount {
20    private AccountIntf acct = null;
21
22    public RemoteAccountImpl(AccountIntf acct) throws RemoteException {
23        this.acct = acct;
24    }
25    public void deposit(BigDecimal amt) throws Exceptions.AccountClosed, RemoteException {
26        acct.deposit(amt);
27    }
28    public void withdraw(BigDecimal amt) throws Exceptions.AccountClosed,
29            Exceptions.InsufficientAmount, RemoteException {
30        acct.withdraw(amt);
31    }
32    public void close() throws Exceptions.AccountClosed, RemoteException {
33        acct.close();
34    }
35    public BigDecimal getBalance() throws Exceptions.AccountClosed, RemoteException {
36        return acct.getBalance();
37    }
38    public String getAcctNo() throws RemoteException {
39        return acct.getAcctNo();
40    }
41    public String getStatement() throws RemoteException {
42        return acct.getStatement();
43    }
44}
45