try {
System.setSecurityManager(new RMISecurityManager());
// Make an Account with a given name
AccountImpl acct = new AccountImpl("JimF");
// Register it with the local naming registry
Naming.rebind("JimF", acct);
System.out.println("Registered account as JimF.");
// Keep the server process alive indefinitely
Object dummy = new Object();
synchronized (dummy) {
try {
dummy.wait();
}
catch (InterruptedException ie) {}
}
}
catch (RemoteException re) {
System.err.println("Remote exception while creating/registering: "
+ re.getMessage());
}
catch (MalformedURLException mue) {
System.err.println("Bad name given when binding server object: "
+ mue.getMessage());
}