1 2 5 14 package org.jacorb.trading.client.dynprop; 15 16 import java.io.*; 17 import java.util.*; 18 19 import org.omg.CORBA.*; 20 import org.omg.PortableServer.*; 21 22 public class DynPropDemo 23 { 24 public static void main(String [] args) 25 { 26 if( args.length != 1 ) 27 { 28 usage(); 29 } 30 31 String iorfile = args[0]; 32 33 ORB orb = org.omg.CORBA.ORB.init(args, null); 35 36 try 37 { 38 POA poa = 39 POAHelper.narrow(orb.resolve_initial_references("RootPOA")); 40 41 poa.the_POAManager().activate(); 42 } 43 catch(Exception e) 44 { 45 e.printStackTrace(); 46 } 47 48 DynamicPropEvalImpl impl = new DynamicPropEvalImpl(); 50 impl._this_object( orb ); 51 52 try { 54 FileOutputStream out = new FileOutputStream(iorfile); 55 PrintWriter pw = new PrintWriter(out); 56 pw.println(orb.object_to_string(impl._this())); 57 pw.flush(); 58 out.close(); 59 } 60 catch (IOException e) { 61 System.err.println("Unable to write IOR to file " + iorfile); 62 System.exit(1); 63 } 64 65 66 orb.run(); 68 69 System.exit(0); 70 } 71 72 73 protected static void usage() 74 { 75 System.err.println("Usage: org.jacorb.trading.client.dynprop.DynPropDemo <iorfile>"); 76 System.exit(1); 77 } 78 } 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | Popular Tags |