protected final void parseNamedOptions(String location,
                                           ResourceOptions options,
                                           Map<String, Object> optionsByName) {

        String nextProtocol = (String) optionsByName.remove(NEXT_PROTOCOL.name());
        if (nextProtocol != null) {
            options.setOption(NEXT_PROTOCOL, nextProtocol);
        }
        
        Object qualifier = optionsByName.remove(QUALIFIER.name());
        if (qualifier != null) {
            options.setOption(QUALIFIER, qualifier);
        }

        String transportURI = (String) optionsByName.remove(TRANSPORT.name());
        if (transportURI == null) {
            ResourceFactory factory = getTransportFactory();
            if (factory != null) {
                transportURI = factory.createURI(location);
            }
        }
        if (transportURI != null) {
            options.setOption(TRANSPORT_URI, transportURI);
        }

        ResourceAddress alternate = (ResourceAddress) optionsByName.remove(ALTERNATE.name());
        if (alternate != null) {
            options.setOption(ALTERNATE, alternate);
        }

        NameResolver resolver = (NameResolver) optionsByName.remove(RESOLVER.name());
        if (resolver != null) {
            options.setOption(RESOLVER, resolver);
        }

        Boolean bindAlternate = (Boolean) optionsByName.remove(BIND_ALTERNATE.name());
        if (bindAlternate != null) {
            options.setOption(BIND_ALTERNATE, bindAlternate);
        }

        URI transportedURI = (URI) optionsByName.remove(TRANSPORTED_URI.name());
        if (transportedURI != null) {
            options.setOption(TRANSPORTED_URI, transportedURI);
        }

        IdentityResolver identityResolver = (IdentityResolver) optionsByName.remove(IDENTITY_RESOLVER.name());
        if (identityResolver != null) {
            options.setOption(IDENTITY_RESOLVER, identityResolver);
        }

        // scheme-specific options
        parseNamedOptions0(location, options, optionsByName);

        // all address options consumed, now create transport address with options by name
        ResourceAddress transport = null;
        if (transportURI != null && addressFactory != null) {
            String protocolName = getProtocolName();
            if (optionsByName == Collections.<String,Object>emptyMap()) {
                optionsByName = new HashMap<>();
            }
            URI locationURI = URI.create(location);
            optionsByName.put(TRANSPORTED_URI.name(), locationURI);
            transport = addressFactory.newResourceAddress(transportURI, optionsByName, protocolName);
        }
        if (transport != null) {
            options.setOption(TRANSPORT, transport);
        }
    }
protected final void parseNamedOptions ( String location , ResourceOptions options , Map < String , Object > optionsByName ) { String nextProtocol = ( String ) optionsByName . remove ( NEXT_PROTOCOL . name ( ) ) ; if ( nextProtocol != null ) { options . setOption ( NEXT_PROTOCOL , nextProtocol ) ; } Object qualifier = optionsByName . remove ( QUALIFIER . name ( ) ) ; if ( qualifier != null ) { options . setOption ( QUALIFIER , qualifier ) ; } String transportURI = ( String ) optionsByName . remove ( TRANSPORT . name ( ) ) ; if ( transportURI == null ) { ResourceFactory factory = getTransportFactory ( ) ; if ( factory != null ) { transportURI = factory . createURI ( location ) ; } } if ( transportURI != null ) { options . setOption ( TRANSPORT_URI , transportURI ) ; } ResourceAddress alternate = ( ResourceAddress ) optionsByName . remove ( ALTERNATE . name ( ) ) ; if ( alternate != null ) { options . setOption ( ALTERNATE , alternate ) ; } NameResolver resolver = ( NameResolver ) optionsByName . remove ( RESOLVER . name ( ) ) ; if ( resolver != null ) { options . setOption ( RESOLVER , resolver ) ; } Boolean bindAlternate = ( Boolean ) optionsByName . remove ( BIND_ALTERNATE . name ( ) ) ; if ( bindAlternate != null ) { options . setOption ( BIND_ALTERNATE , bindAlternate ) ; } URI transportedURI = ( URI ) optionsByName . remove ( TRANSPORTED_URI . name ( ) ) ; if ( transportedURI != null ) { options . setOption ( TRANSPORTED_URI , transportedURI ) ; } IdentityResolver identityResolver = ( IdentityResolver ) optionsByName . remove ( IDENTITY_RESOLVER . name ( ) ) ; if ( identityResolver != null ) { options . setOption ( IDENTITY_RESOLVER , identityResolver ) ; } parseNamedOptions0 ( location , options , optionsByName ) ; ResourceAddress transport = null ; if ( transportURI != null && addressFactory != null ) { String protocolName = getProtocolName ( ) ; if ( optionsByName == Collections . < String , Object > emptyMap ( ) ) { optionsByName = new HashMap < > ( ) ; } URI locationURI = URI . create ( location ) ; optionsByName . put ( TRANSPORTED_URI . name ( ) , locationURI ) ; transport = addressFactory . newResourceAddress ( transportURI , optionsByName , protocolName ) ; } if ( transport != null ) { options . setOption ( TRANSPORT , transport ) ; } }
/*
Create a resource address with options.