import org.omg.CORBA.*; import org.omg.CosNaming.*; import org.omg.CosNaming.NamingContextPackage.*; public class SimpleHelloWorldServer { public static void main(String[] args) { try { // Initialize the ORB. org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null); // Initialize the BOA. //org.omg.CORBA.BOA boa = // ((com.visigenic.vbroker.orb.ORB)orb).BOA_init(); //create a GoodDay obj ExampleGoodDayImpl impl = new ExampleGoodDayImpl(); //export the obj reference //boa.obj_is_ready(impl); orb.connect(impl); System.out.println(orb.object_to_string(impl)); //add naming service. org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService"); NamingContext ncRef = NamingContextHelper.narrow(objRef); //bind the object Reference in Naming NameComponent nc = new NameComponent("GoodDay", ""); NameComponent path[] = {nc}; ncRef.rebind(path, impl); //wait for request java.lang.Object sync = new java.lang.Object(); synchronized (sync) { sync.wait(); } } catch (Exception ex) { System.err.println(ex); } } }