1 package org.jacorb.ir; 2 3 22 23 import java.lang.reflect.*; 24 25 31 32 public class IRServer 33 { 34 protected static char fileSeparator = 35 System.getProperty("file.separator").charAt(0); 36 37 41 42 public static void main( String args[] ) 43 { 44 boolean load = false; 45 46 if( args.length != 2) 47 { 48 System.err.println("Usage: java org.jacorb.ir.IRServer <classpath> <IOR filename>"); 49 System.exit(1); 50 } 51 52 try 53 { 54 java.util.StringTokenizer strtok = 55 new java.util.StringTokenizer ( args[0], java.io.File.pathSeparator ); 56 57 java.net.URL [] urls = new java.net.URL [strtok.countTokens()]; 59 for( int i = 0; strtok.hasMoreTokens(); i++ ) 60 { 61 urls[i] = new java.io.File ( strtok.nextToken() ).toURL(); 62 } 63 64 java.net.URLClassLoader classLoader = 65 new java.net.URLClassLoader ( urls ); 66 67 Class repositoryClass = 68 classLoader.loadClass("org.jacorb.ir.RepositoryImpl"); 69 74 Object repository = 75 repositoryClass.getConstructors()[0].newInstance( 76 new Object []{ args[0] , 77 args[1], 78 classLoader }); 79 80 repositoryClass.getDeclaredMethod("loadContents", (Class []) null ).invoke( repository, (Object []) null ); 81 82 Object lock = new Object (); 83 synchronized( lock ) 84 { 85 lock.wait(); 86 } 87 88 } 89 catch( Exception e ) 90 { 91 e.printStackTrace(); 92 System.exit(1); 93 } 94 } 95 96 } 97 98 99 100 101 102 103 104 105 106 107 | Popular Tags |