package hello; import org.omg.CORBA.*; import java.io.*; public class Server { public static void main(String args[]) { try { // // Create ORB and BOA // ORB orb = ORB.init(args, new java.util.Properties()); BOA boa = orb.BOA_init(args, new java.util.Properties()); // // Create implementation object // Hello_impl p = new Hello_impl(); // // Save reference // try { String ref = orb.object_to_string(p); String refFile = "Hello.ref"; FileOutputStream file = new FileOutputStream(refFile); PrintStream out = new PrintStream(file); out.println(ref); out.flush(); file.close(); } catch(IOException ex) { System.err.println("Can't write to `" + ex.getMessage() + "'"); System.exit(1); } // // Run implementation // boa.impl_is_ready(null); System.exit(0); } catch(SystemException ex) { System.err.println(ex.getMessage()); ex.printStackTrace(); System.exit(1); } } }