View Javadoc

1   /*
2    * Copyright (c) 1998-2005 The Jgroup Team.
3    *
4    * This program is free software; you can redistribute it and/or modify
5    * it under the terms of the GNU Lesser General Public License version 2 as
6    * published by the Free Software Foundation.
7    *
8    * This program is distributed in the hope that it will be useful,
9    * but WITHOUT ANY WARRANTY; without even the implied warranty of
10   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11   * GNU Lesser General Public License for more details.
12   *
13   * You should have received a copy of the GNU Lesser General Public License
14   * along with this program; if not, write to the Free Software
15   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16   *
17   */
18  package jgroup.test.jini.txn;
19  
20  import java.rmi.RemoteException;
21  
22  import jgroup.core.ExternalGMIListener;
23  
24  
25  /**
26   * Remote interface for the bank services.
27   * 
28   * @author Rohnny Moland
29   */
30  public interface Bank 
31    extends ExternalGMIListener
32  {
33    /**
34     * Get balance of an account.
35     * 
36     * @param accNumber Account number
37     * @return the balance of the account
38     * @throws RemoteException
39     */
40    Integer getBalance(long accNumber)
41      throws RemoteException;
42  
43    /**
44     * Do a withdraw operation on given account.
45     * 
46     * @param accountNumber
47     *   The account number to use
48     * @param amount
49     *   The amount to withdraw
50     * @param transactionID
51     *   The transaction id to use
52     * @throws RemoteException
53     */
54    void withdraw(long accountNumber, int amount, long transactionID)
55      throws RemoteException;
56     
57    /**
58     * Do a deposit operation on given account.
59     * 
60     * @param accountNumber
61     *   The account number to use
62     * @param amount
63     *   The amount to deposit
64     * @param txn
65     *   The transaction id to use
66     * @throws RemoteException
67     */
68    void deposit(long accountNumber, int amount, long transactionID)
69      throws RemoteException;
70    
71    /**
72     * Get the name of a bank service.
73     * 
74     * @return Name of bank
75     * @throws RemoteException
76     */
77    public String getName()
78      throws RemoteException;
79  
80  }