String codebaseURL = argv[0];
String serverName = argv[1];
try {
MarshalledObject activationArg = new MarshalledObject(serverName);
System.out.println("Making server...");
ActivationGroupDesc gdesc = new ActivationGroupDesc(null, null);
ActivationGroupID gid =
ActivationGroup.getSystem().registerGroup(gdesc);
ActivationGroup.createGroup(gid, gdesc, 0);
// ThisOrThatServer serverRef =
// new StillActivatableServerImpl(serverName, codebaseURL, 0);
ActivationDesc desc =
new ActivationDesc(gid, "jen.rmi.StillActivatableServerImpl",
codebaseURL, activationArg);
System.out.println("Registering with activation server...");
ThisOrThatServer serverRef =
(ThisOrThatServer)Activatable.register(desc);
System.out.println("Registering with naming server...");
LocateRegistry.getRegistry(1098).rebind(serverName, serverRef);
System.out.println("Server registered with naming and activation");
}
catch (Exception e) {
e.printStackTrace();
System.out.println("Failed to register server.");
}
return;