1 package test.interceptor.client_flow; 2 3 import java.io.*; 4 5 import org.omg.CORBA.*; 6 import org.omg.PortableServer.*; 7 8 class TestObjectImpl 9 extends TestObjectPOA 10 { 11 12 public void foo() 13 { 14 System.out.println("Server recv foo"); 15 } 16 } 17 18 public class Server 19 { 20 public static ORB orb = null; 21 22 public static void main(String [] args) 23 { 24 if( args.length != 1 ) 25 { 26 System.out.println( 27 "Usage: jaco test.interceptor.ctx_passing.Server <ior_file>"); 28 System.exit( 1 ); 29 } 30 31 try 32 { 33 orb = ORB.init( args, null ); 37 38 POA poa = 40 POAHelper.narrow( orb.resolve_initial_references( "RootPOA" )); 41 42 poa.the_POAManager().activate(); 43 44 org.omg.CORBA.Object obj = 46 poa.servant_to_reference( new TestObjectImpl() ); 47 48 PrintWriter pw = 49 new PrintWriter( new FileWriter( args[ 0 ] )); 50 51 pw.println( orb.object_to_string( obj )); 53 54 pw.flush(); 55 pw.close(); 56 57 orb.run(); 59 } 60 catch( Exception e ) 61 { 62 System.out.println( e ); 63 } 64 } 65 } 66 | Popular Tags |