1 /*
2  * @(#) $Id: BankClientShell.java,v 1.2 2003/07/08 08:13:53 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 org.jstk.example.bank.client;
11
12import java.io.InputStreamReader;
13import java.io.BufferedReader;
14import org.jstk.example.bank.server.*;
15import org.jstk.example.bank.*;
16
17public class BankClientShell {
18    public static void main(String[] args) throws Exception {
19        BankClient bc = new BankClient();
20        DefaultBankPersistenceManager bpm =
21            new DefaultBankPersistenceManager(System.getProperties());
22        BankIntf bank = bpm.load();
23        bc.init(bank);
24        while (true){
25            System.out.print("bcsh>");
26            System.out.flush();
27            String cmdline = new BufferedReader(new InputStreamReader(System.in)).readLine();
28            String[] cmdargs = cmdline.split("\\s");
29
30            String result = bc.execCommand(cmdargs);
31            System.out.println(result);
32        }
33    }
34}