1 package demo.benchmark; 2 3 import org.omg.CosNaming.*; 4 5 public class OctetServer 6 { 7 public static void main( String [] args ) 8 { 9 10 11 try 12 { 13 org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null); 14 org.omg.PortableServer.POA poa = 15 org.omg.PortableServer.POAHelper.narrow(orb.resolve_initial_references("RootPOA")); 16 17 poa.the_POAManager().activate(); 18 19 org.omg.CORBA.Object o = poa.servant_to_reference(new octetBenchImpl()); 20 21 NamingContextExt nc = 22 NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService")); 23 nc.bind(nc.to_name("octet_benchmark"), o); 24 25 26 orb.run(); 27 } 28 catch (Exception e ) 29 { 30 e.printStackTrace(); 31 } 32 } 33 } 34 35 36 37 38 | Popular Tags |