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