1 package test.load.simple; 2 3 import java.io.*; 4 5 import org.omg.CORBA.*; 6 import org.omg.PortableServer.*; 7 8 9 public class Server 10 { 11 public static void main(String [] args) 12 { 13 if( args.length != 1 ) 14 { 15 System.out.println( 16 "Usage: jaco test.load.simple.Server <ior_file>"); 17 System.exit( 1 ); 18 } 19 20 try 21 { 22 ORB orb = ORB.init( args, null ); 24 25 POA poa = 27 POAHelper.narrow( orb.resolve_initial_references( "RootPOA" )); 28 29 poa.the_POAManager().activate(); 30 31 GoodDayImpl goodDayImpl = new GoodDayImpl( "" ); 33 34 org.omg.CORBA.Object obj = 36 poa.servant_to_reference( goodDayImpl ); 37 38 PrintWriter pw = 39 new PrintWriter( new FileWriter( args[ 0 ] )); 40 41 pw.println( orb.object_to_string( obj )); 43 44 pw.flush(); 45 pw.close(); 46 47 orb.run(); 49 } 50 catch( Exception e ) 51 { 52 System.out.println( e ); 53 } 54 } 55 } 56 | Popular Tags |