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