1 package test.interop.bug360; 2 3 import java.io.*; 4 import org.omg.CosNaming.*; 5 6 public class Server 7 { 8 public static void main( String [] args ) 9 { 10 org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null); 11 try 12 { 13 org.omg.PortableServer.POA poa = 14 org.omg.PortableServer.POAHelper.narrow( orb.resolve_initial_references("RootPOA")); 15 16 poa.the_POAManager().activate(); 17 18 org.omg.CORBA.Object o = 19 poa.servant_to_reference(new onewayPushConsumerImpl()); 20 21 if( args.length == 1 ) 22 { 23 25 PrintWriter ps = new PrintWriter(new FileOutputStream(new File( args[0] ))); 26 ps.println( orb.object_to_string( o ) ); 27 ps.close(); 28 } 29 else 30 { 31 NamingContextExt nc = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService")); 33 nc.bind( nc.to_name("bug360.service"), o); 34 } 35 } 36 catch ( Exception e ) 37 { 38 e.printStackTrace(); 39 } 40 orb.run(); 41 } 42 } 43 44 45 | Popular Tags |