1 package org.jacorb.demo.sas; 2 3 import java.io.BufferedReader ; 4 import java.io.File ; 5 import java.io.FileReader ; 6 7 import org.omg.CORBA.ORB ; 8 9 17 18 public class SslClient 19 { 20 public static void main( String args[] ) 21 { 22 if( args.length != 1 ) 23 { 24 System.out.println( "Usage: java demo.sas.SslClient <ior_file>" ); 25 System.exit( 1 ); 26 } 27 28 try 29 { 30 File f = new File ( args[ 0 ] ); 31 32 if( ! f.exists() ) 34 { 35 System.out.println("File " + args[0] + " does not exist."); 36 37 System.exit( -1 ); 38 } 39 40 if( f.isDirectory() ) 42 { 43 System.out.println("File " + args[0] + " is a directory."); 44 45 System.exit( -1 ); 46 } 47 48 ORB orb = ORB.init( args, null ); 50 51 BufferedReader br = new BufferedReader ( new FileReader ( f )); 52 53 org.omg.CORBA.Object obj = orb.string_to_object( br.readLine() ); 55 br.close(); 56 57 SASDemo demo = SASDemoHelper.narrow( obj ); 59 60 demo.printSAS(); 62 demo.printSAS(); 63 demo.printSAS(); 64 65 System.out.println( "Call to server succeeded" ); 66 } 67 catch( Exception ex ) 68 { 69 ex.printStackTrace(); 70 } 71 } 72 } 73 | Popular Tags |