1 package test.memoryusage; 2 3 import org.omg.CORBA.*; 4 import org.omg.PortableServer.*; 5 import org.omg.CosNaming.*; 6 7 public class Server 8 { 9 public static void main(String [] args) 10 { 11 try 12 { 13 ORB orb = ORB.init( args, null ); 15 16 POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); 18 rootPOA.the_POAManager().activate(); 19 POAManager poaManager = rootPOA.the_POAManager(); 20 21 SessionFactoryServant sessionFactoryServant = 23 new SessionFactoryServant(orb, rootPOA); 24 25 org.omg.CORBA.Object sessionFactory = 27 rootPOA.servant_to_reference( sessionFactoryServant ); 28 29 NamingContextExt nc = 31 NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService")); 32 33 nc.bind(nc.to_name("SessionFactory"), sessionFactory); 34 35 System.out.println("CORBA Server ready"); 37 orb.run(); 38 } 39 catch(Exception e) 40 { 41 System.out.println(e); 42 } 43 } 44 } 45 | Popular Tags |