iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CorbaUtils.java
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);
    }
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.

@param server Possibly null server; if null means use default;
For applet, it is the applet host; for app, it is localhost.
@param port   Port number, -1 means default port
@param env    Possibly null environment. Contains environment properties.
Could contain ORB itself; or applet used for initializing ORB.
Use all String properties from env for initializing ORB
@return A non-null ORB.