iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CNCtx.java
private String initUsingIiopUrl(ORB defOrb, String url, Hashtable env)
            throws NamingException {
        try {
            IiopUrl parsedUrl = new IiopUrl(url);

            Vector addrs = parsedUrl.getAddresses();
            IiopUrl.Address addr;
            NamingException savedException = null;

            for (int i = 0; i < addrs.size(); i++) {
                addr = (IiopUrl.Address) addrs.elementAt(i);

                try {
                    if (defOrb != null) {
                        try {
                            String tmpUrl = "corbaloc:iiop:" + addr.host + ":" + addr.port + "/NameService";
                            org.omg.CORBA.Object rootCtx = defOrb.string_to_object(tmpUrl);
                            setOrbAndRootContext(defOrb, rootCtx);
                            return parsedUrl.getStringName();
                        } catch (Exception e) {
                        } // keep going
                    }

                    // Get ORB
                    ORB orb = CorbaUtils.getOrb(addr.host, addr.port, env);

                    // Assign to fields
                    setOrbAndRootContext(orb, (String) null);
                    return parsedUrl.getStringName();

                } catch (NamingException ne) {
                    savedException = ne;
                }
            }
            if (savedException != null) {
                throw savedException;
            } else {
                throw IIOPLogger.ROOT_LOGGER.invalidURLOrIOR(url);
            }
        } catch (MalformedURLException e) {
            throw new ConfigurationException(e.getMessage());
        }
    }
private String initUsingIiopUrl(ORB defOrb, String url, Hashtable env)
            throws NamingException {
        try {
            IiopUrl parsedUrl = new IiopUrl(url);

            Vector addrs = parsedUrl.getAddresses();
            IiopUrl.Address addr;
            NamingException savedException = null;

            for (int i = 0; i < addrs.size(); i++) {
                addr = (IiopUrl.Address) addrs.elementAt(i);

                try {
                    if (defOrb != null) {
                        try {
                            String tmpUrl = "corbaloc:iiop:" + addr.host + ":" + addr.port + "/NameService";
                            org.omg.CORBA.Object rootCtx = defOrb.string_to_object(tmpUrl);
                            setOrbAndRootContext(defOrb, rootCtx);
                            return parsedUrl.getStringName();
                        } catch (Exception e) {
                        } // keep going
                    }

                    // Get ORB
                    ORB orb = CorbaUtils.getOrb(addr.host, addr.port, env);

                    // Assign to fields
                    setOrbAndRootContext(orb, (String) null);
                    return parsedUrl.getStringName();

                } catch (NamingException ne) {
                    savedException = ne;
                }
            }
            if (savedException != null) {
                throw savedException;
            } else {
                throw IIOPLogger.ROOT_LOGGER.invalidURLOrIOR(url);
            }
        } catch (MalformedURLException e) {
            throw new ConfigurationException(e.getMessage());
        }
    }
private String initUsingIiopUrl ( ORB defOrb , String url , Hashtable env ) throws NamingException { try { IiopUrl parsedUrl = new IiopUrl ( url ) ; Vector addrs = parsedUrl . getAddresses ( ) ; IiopUrl . Address addr ; NamingException savedException = null ; for ( int i = 0 ; i < addrs . size ( ) ; i ++ ) { addr = ( IiopUrl . Address ) addrs . elementAt ( i ) ; try { if ( defOrb != null ) { try { String tmpUrl = "corbaloc:iiop:" + addr . host + ":" + addr . port + "/NameService" ; org . omg . CORBA . Object rootCtx = defOrb . string_to_object ( tmpUrl ) ; setOrbAndRootContext ( defOrb , rootCtx ) ; return parsedUrl . getStringName ( ) ; } catch ( Exception e ) { } // keep going } // Get ORB ORB orb = CorbaUtils . getOrb ( addr . host , addr . port , env ) ; // Assign to fields setOrbAndRootContext ( orb , ( String ) null ) ; return parsedUrl . getStringName ( ) ; } catch ( NamingException ne ) { savedException = ne ; } } if ( savedException != null ) { throw savedException ; } else { throw IIOPLogger . ROOT_LOGGER . invalidURLOrIOR ( url ) ; } } catch ( MalformedURLException e ) { throw new ConfigurationException ( e . getMessage ( ) ) ; } }
Handles "iiop" and "iiopname" URLs (INS 98-10-11)
Handles iiop and iiopname URLs ( INS 98 - 10 - 11 )