// AppletServer.java // This is CORBA object running in a Java Applet import java.awt.*; import java.lang.*; import java.net.*; import java.io.*; import java.applet.*; public class AppletServer extends Applet { public void init() { // Initializes the CORBA ORB org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); // We must set the security of our applet so it will be able to receive // connection from outside netscape.security.PrivilegeManager.enablePrivilege("UniversalAccept"); netscape.security.PrivilegeManager.enablePrivilege("UniversalConnect"); // Creates CROBA BOA org.omg.CORBA.BOA boa = orb.BOA_init(); // Creates the Proxy StreetRouterImpl proxy = new StreetRouterImpl("StreetRouter"); // Object is ready boa.obj_is_ready(proxy); // For security reasons,it is not possible to connect to other web // server rather than the initial one from you get the applet. In this example // the IOR (the server handler) is published using netscape naming service. // If you want to use the InfoBus naming service // you want to make sure both, the InfoBus naming service and your applet, // are under the same web server space. netscape_naming.Publish((org.omg.CORBA.Object) proxy,"StreetRouter",orb); System.out.println("Created" + proxy); // Ready to serve requests boa.impl_is_ready(); } }