1 package test.imr; 2 3 import java.io.*; 4 import org.omg.CORBA.*; 5 6 import org.jacorb.util.*; 7 8 public class Client 9 { 10 public static void main( String args[] ) 11 { 12 if( args.length != 1 ) 13 { 14 System.out.println( "Usage: jaco test.imr.Client <ior_file>" ); 15 System.exit( 1 ); 16 } 17 18 try 19 { 20 File f = new File( args[ 0 ] ); 21 22 if( ! f.exists() ) 24 { 25 System.out.println("File " + args[0] + 26 " does not exist."); 27 28 System.exit( -1 ); 29 } 30 31 if( f.isDirectory() ) 33 { 34 System.out.println("File " + args[0] + 35 " is a directory."); 36 37 System.exit( -1 ); 38 } 39 40 ORB orb = ORB.init( args, null ); 42 43 BufferedReader br = 44 new BufferedReader( new FileReader( f )); 45 46 org.omg.CORBA.Object obj = 48 orb.string_to_object( br.readLine() ); 49 50 br.close(); 51 52 TestIf test = TestIfHelper.narrow( obj ); 54 55 test.op(); 57 } 58 catch( Exception ex ) 59 { 60 System.err.println( ex ); 61 } 62 } 63 } 64 65 | Popular Tags |