1 /*
2  * @(#) $Id: RemoteBankServer.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.Naming;
13import org.jstk.example.bank.BankIntf;
14import org.jstk.example.bank.server.DefaultBankPersistenceManager;
15
16public class RemoteBankServer {
17    public static void main(String args[]) {
18        // Create and install the security manager
19        // System.setSecurityManager(new RMISecurityManager());
20
21        try {
22            DefaultBankPersistenceManager bpm =
23                new DefaultBankPersistenceManager(System.getProperties());
24            BankIntf bank = bpm.load();
25            RemoteBankImpl rbi = new RemoteBankImpl(bank);
26            Naming.rebind("MyRemoteBank", rbi);
27            System.out.println("RemoteBank Server ready.");
28        } catch (Exception e) {
29            System.out.println("Exception: " + e.getMessage());
30            e.printStackTrace();
31        }
32    }
33}
34