The entry point to the application server.
It takes three arguments:
- The data store URL
- The user ID used to connect to the data store
- The password used to connect to the data store
It then makes an instance of the AppServer class available to
all connecting clients via the RMI URL:
rmi://host/AppServer
if( args.length != 3 ) {
System.out.println("Syntax: [java AppServer URL UID PASSWORD]");
return;
}
System.out.println("Installing the security manager...");
System.setSecurityManager(new RMISecurityManager());
try {
AppServer server;
Properties props = new Properties();
String url = args[0];
props.put("user", args[1]);
props.put("password", args[2]);
System.out.println("Starting the application server...");
Naming.rebind("AppServer", new AppServer(url, props));
System.out.println("AppServer bound with url: " + url + "...");
}
catch( Exception e ) {
e.printStackTrace();
}