1 package org.jacorb.ir; 2 3 22 23 import java.io.*; 24 25 public class QueryIR 26 { 27 public static void main( String [] args ) 28 { 29 if( args.length != 1 ) 30 { 31 System.err.println("Usage: qir <RepositoryID>"); 32 System.exit(1); 33 } 34 35 try 36 { 37 org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init( args, null ); 38 org.omg.CORBA.Repository ir = 39 org.omg.CORBA.RepositoryHelper.narrow( orb.resolve_initial_references( "InterfaceRepository")); 40 41 if( ir == null ) 42 { 43 System.out.println( "Could not find IR."); 44 System.exit(1); 45 } 46 47 org.omg.CORBA.Contained c = ir.lookup_id( args[0] ); 48 49 if( c != null ) 50 { 51 IdlWriter idlw = new IdlWriter(System.out); 52 idlw.printContained( c, 2 ); 53 } 54 else 55 System.out.println( args[0] + " not found in IR."); 56 } 57 catch ( Exception e) 58 { 59 e.printStackTrace(); 60 } 61 } 62 } 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | Popular Tags |