public static ORB getOrb ( String server , int port , Hashtable env ) { // See if we can get info from environment Properties orbProp ; // Extract any org.omg.CORBA properties from environment if ( env != null ) { // Get all String properties orbProp = new Properties ( ) ; final Enumeration envProp = env . keys ( ) ; while ( envProp . hasMoreElements ( ) ) { String key = ( String ) envProp . nextElement ( ) ; Object val = env . get ( key ) ; if ( val instanceof String ) { orbProp . put ( key , val ) ; } } final Enumeration mainProps = orbProperties . keys ( ) ; while ( mainProps . hasMoreElements ( ) ) { String key = ( String ) mainProps . nextElement ( ) ; Object val = orbProperties . get ( key ) ; if ( val instanceof String ) { orbProp . put ( key , val ) ; } } } else { orbProp = orbProperties ; } if ( server != null ) { orbProp . put ( "org.omg.CORBA.ORBInitialHost" , server ) ; } if ( port >= 0 ) { orbProp . put ( "org.omg.CORBA.ORBInitialPort" , "" + port ) ; } // Get Applet from environment if ( env != null ) { Object applet = env . get ( Context . APPLET ) ; if ( applet != null ) { // Create ORBs for an applet return initAppletORB ( applet , orbProp ) ; } } // Create ORBs using orbProp for a standalone application return ORB . init ( new String [ 0 ] , orbProp ) ; }
Get ORB using given server and port number and properties from environment .