// StreetRouterServer.java // Server for the StreetRouter CORBA object. public class StreetRouterServer { public static void main (String[] args) { // Initialize the Visigenic ORB org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null); // Initializa the BOA org.omg.CORBA.BOA boa = orb.BOA_init(); // Creating a Proxy StreetRouterImpl proxy = new StreetRouterImpl("StreetRouter"); // Telling Visigenic that the object has been successfully created boa.obj_is_ready(proxy); // Here we publish this object (or proxy) in InfoBus. This actually // involves a http connection, so it might take a while. If you don't // want your server to be available from InfoBus, comment this line. // The first parameter of this call is the context where InfoBus // will place your server, the second is the name of the service, // and the third is a pointer to your object (or proxy). Please, // contact paepcke@db.stanford.edu to know what contexts and names // are suitable here. naming.Publish("/dl/Services/Search", "StreetRouterSimple",proxy); System.out.println("Created" + proxy); // The server is ready to serve requests boa.impl_is_ready(); // Note: We should Withdraw from the InfoBus naming service this // object before exiting. To do that we would need to run this // in a thread and catch the "exit" exception. In the interest of // simplicity we don't do this here. } }