try {
// Obtain ORB reference
ORB myORB = ORB.init(argv, null);
// Make a ThisOrThatServer object to register with the ORB
ThisOrThatServer impl = new ThisOrThatServerImpl();
// Register the local object with the ORB
myORB.connect(impl);
// Get a stringified reference to the object
String sor = myORB.object_to_string(impl);
System.out.println("ThisOrThatServer IOR: " + sor);
// Go into a wait state, waiting for clients to connect
java.lang.Object dummy = new String("I wait...");
synchronized (dummy) {
dummy.wait();
}
}
catch (Exception e) {
System.out.println("An error occurred while initializing server object:");
e.printStackTrace();
}