configure custom proxy properties from connectionPropertiesMap
512094
public static void configureCustomProxyProperties(
      Map<SFSessionProperty, Object> connectionPropertiesMap)
  {
    if (connectionPropertiesMap.containsKey(SFSessionProperty.USE_PROXY))
    {
      useProxy = (boolean) connectionPropertiesMap.get(
          SFSessionProperty.USE_PROXY);
    }

    if (useProxy)
    {
      proxyHost =
          (String) connectionPropertiesMap.get(SFSessionProperty.PROXY_HOST);
      proxyPort =
          Integer.parseInt(
              connectionPropertiesMap.get(SFSessionProperty.PROXY_PORT).toString());
      proxyUser =
          (String) connectionPropertiesMap.get(SFSessionProperty.PROXY_USER);
      proxyPassword =
          (String) connectionPropertiesMap.get(SFSessionProperty.PROXY_PASSWORD);
      nonProxyHosts =
          (String) connectionPropertiesMap.get(SFSessionProperty.NON_PROXY_HOSTS);
    }
  }
1297695
function ProxyGuest ( options ) {
	// prepare
	var name;

	// connection with server
	this.active = false;

	/**
	 * proxy instance configuration
	 * @namespace
	 */
	this.config = {
		// node.js server address
		host: '127.0.0.1',

		// http server port
		port: 8800,

		// session name
		name: 'anonymous',

		// cached url for posting requests
		urlPost: '',

		// cached url for info collecting
		urlInfo: ''
	};

	// single ajax object for performance
	this.xhr = new XMLHttpRequest();

	// validate and iterate input
	if ( options && typeof options === 'object' ) {
		for ( name in options ) {
			// rewrite defaults
			if ( options.hasOwnProperty(name) ) {
				this.config[name] = options[name];
			}
		}
	}

	// there may be some special chars
	name = encodeURIComponent(this.config.name);

	// cache final request urls
	this.config.urlPost = 'http://' + this.config.host + ':' + this.config.port + '/' + name;
	this.config.urlInfo = 'http://' + this.config.host + ':' + this.config.port + '/info/' + name;

	// check initial connection status
	this.active = this.info().active;

	console.log('%c[core]\t%c%s\t%c0\t%cconnection to the host %c(%s:%s): %c%s',
		'color:grey',
		'color:purple', this.config.name,
		'color:grey',
		'color:black',
		'color:grey', this.config.host, this.config.port,
		'color:' + (this.active ? 'green' : 'red'), this.active ? 'available' : 'not available'
	);
}
590925
private void addConfigProviderToMap(Map<String, String> propertiesMap, Configuration config) {
        ConfigurationPropertiesProvider provider = new ConfigurationPropertiesProvider(config);
        propertiesMap.putAll(provider.getProperties());
    }
47354
function proxyProperty(name) {
    self.__defineGetter__(name, function(){
      return self._native[name];
    });
    self.__defineSetter__(name, function(val){
      self._native[name] = val;
    });
  }
214269
function proxyConfig(path) {
  const config = {}

  const {endpointsExtension} = tryGetGraphQLProjectConfig()
  if (endpointsExtension) {
    const graphqlEndpoint = endpointsExtension.getEndpoint()

    const {url: target, headers} = graphqlEndpoint
    const changeOrigin = true

    const pathRewrite = {}
    pathRewrite[`^${path}`] = ''

    config[path] = {changeOrigin, headers, pathRewrite, target}
  }

  return config
}
1293360
private void resolveProperties() {
        if (arePropertiesResolved) {
            return;
        }

        Class<?> cl = forClass();
        isProxy = Proxy.isProxyClass(cl);
        isEnum = Enum.class.isAssignableFrom(cl);
        isSerializable = isSerializable(cl);
        isExternalizable = isExternalizable(cl);

        arePropertiesResolved = true;
    }
746311
public Map<Class<?>, ThreadLocalProxy<?>> getConstructorProxies() {
        if (constructorProxiesAvailable) {
            return getConstructorProxyMap(false).get(serviceClass);
        }
        return null;
    }
834685
private static void loadClientProperties(String propertiesPath, String clazzName,
            Map<?, Map<String, String>> clientProperties, Map<String, Map<String, String>> entityConfigurations)
    {

        InputStream inputStream = PropertyReader.class.getClassLoader().getResourceAsStream(propertiesPath);
        clientProperties = JsonUtil.readJson(inputStream, Map.class);

        if (clientProperties != null)
        {
            if (clientProperties.get("all") != null)
            {
                entityConfigurations.put(clazzName, clientProperties.get("all"));
            }
            else
            {

                Iterator iter = clientProperties.keySet().iterator();

                while (iter.hasNext())
                {
                    Object key = iter.next();
                    if (((String) key).indexOf(',') > 0)
                    {
                        StringTokenizer tokenizer = new StringTokenizer((String) key, ",");
                        while (tokenizer.hasMoreElements())
                        {
                            String token = tokenizer.nextToken();
                            entityConfigurations.put(token, clientProperties.get(key));
                        }
                    }
                    else
                    {
                        entityConfigurations.put((String) key, clientProperties.get(key));
                    }
                }
            }
        }

    }
1276318
public static void setAwsClientConfigProperties(ClientConfiguration config,
													Properties configProps) {

		Map<String, Object> awsConfigProperties = new HashMap<>();
		for (Map.Entry<Object, Object> entry : configProps.entrySet()) {
			String key = (String) entry.getKey();
			if (key.startsWith(AWS_CLIENT_CONFIG_PREFIX)) {
				awsConfigProperties.put(key.substring(AWS_CLIENT_CONFIG_PREFIX.length()), entry.getValue());
			}
		}
		// Jackson does not like the following properties
		String[] ignorableProperties = {"secureRandom"};
		BeanDeserializerModifier modifier = new BeanDeserializerModifierForIgnorables(
			ClientConfiguration.class, ignorableProperties);
		DeserializerFactory factory = BeanDeserializerFactory.instance.withDeserializerModifier(
			modifier);
		ObjectMapper mapper = new ObjectMapper(null, null,
			new DefaultDeserializationContext.Impl(factory));

		JsonNode propTree = mapper.convertValue(awsConfigProperties, JsonNode.class);
		try {
			mapper.readerForUpdating(config).readValue(propTree);
		} catch (IOException ex) {
			throw new RuntimeException(ex);
		}
	}
560046
public static void injectContextProxiesAndApplication(AbstractResourceInfo cri,
                                                          Object instance,
                                                          Application app,
                                                          ProviderFactory factory) {

        /** inject proxy for singleton only */
        if (!cri.isSingleton())
            return;

        /** application inject has been done earlier. @see LibertyJaxRsServerFactoryBean.injectContextApplication() */
        if (cri instanceof ApplicationInfo)
            return;

        JaxRsFactoryBeanCustomizer beanCustomizer = InjectionRuntimeContextHelper.findBeanCustomizer(instance.getClass(), cri.getBus());
        Boolean isManagedBean = beanCustomizer == null ? false : true;

        InjectionRuntimeContext irc = InjectionRuntimeContextHelper.getRuntimeContext();
        synchronized (instance) {
            for (Map.Entry<Class<?>, Method> entry : cri.getContextMethods().entrySet()) {
                Method method = entry.getValue();
                Object value = null;
                Class<?> cls = method.getParameterTypes()[0];
                if (cls == Application.class) {
                  value = app;
                } else if (VALUE_CONTEXTS.contains(cls.getName()) && factory != null) {
                    ContextProvider<?> p = factory.createContextProvider(cls, null);
                    if (p != null) {
                        value = p.createContext(null);
                    }
                } else {
                    value = cri.getContextSetterProxy(method);
                }

                if (isManagedBean)
                    irc.setRuntimeCtxObject(entry.getKey().getName(), value);
                else
                    InjectionUtils.injectThroughMethod(instance, method, value);
            }

            for (Field f : cri.getContextFields()) {
                Object value = null;
                Class<?> cls = f.getType();
                if (cls == Application.class) {
                    value = app;
                } else if (VALUE_CONTEXTS.contains(cls.getName()) && factory != null) {
                    ContextProvider<?> p = factory.createContextProvider(cls, null);
                    if (p != null) {
                        value = p.createContext(null);
                    }
                } else {
                    value = cri.getContextFieldProxy(f);
                }

                if (isManagedBean)
                    irc.setRuntimeCtxObject(f.getType().getName(), value);
                else
                    InjectionUtils.injectFieldValue(f, instance, value);
            }
        }

        Object o = null;
        //replace singleton resource after context injection is done.
        if (isManagedBean && (cri instanceof ClassResourceInfo)) {
            o = beanCustomizer.onSingletonServiceInit(instance,
                                                      InjectionRuntimeContextHelper.getBeanCustomizerContext(beanCustomizer, cri.getBus()));

            SingletonResourceProvider sp = new SingletonResourceProvider(o);
            ((ClassResourceInfo) cri).setResourceProvider(sp);
            instance = o;
        }

        if (!isManagedBean && (cri instanceof ClassResourceInfo))
        {
            //call postConstruct method for singleton resource which are non-CDI/EJB
            Method postConstructMethod = ResourceUtils.findPostConstructMethod(instance.getClass());
            InjectionUtils.invokeLifeCycleMethod(instance, postConstructMethod);
        }

    }
126683
@SuppressWarnings("unchecked")
    public void raVerifyConfiguration(ConfigProperties properties) throws InvalidConfigurationException {
        String httpClientFactoryClassName = (String) properties.getProperty(CFG_PROPERTY_HTTP_CLIENT_FACTORY)
                .getValue();
        if (httpClientFactoryClassName.isEmpty()) {
            try {
                Integer i = (Integer) properties.getProperty(CFG_PROPERTY_MAX_CONNECTIONS_TOTAL).getValue();
                if (i < 1) {
                    throw new InvalidConfigurationException(CFG_PROPERTY_MAX_CONNECTIONS_TOTAL + " must be > 0");
                }
            } catch (InvalidConfigurationException e) {
                throw e;
            } catch (Exception e) {
                tracer.severe("failure in config validation", e);
                throw new InvalidConfigurationException(e.getMessage());
            }

            try {
                Integer i = (Integer) properties.getProperty(CFG_PROPERTY_DEFAULT_MAX_FOR_ROUTE).getValue();
                if (i < 1) {
                    throw new InvalidConfigurationException(CFG_PROPERTY_DEFAULT_MAX_FOR_ROUTE + " must be > 0");
                }
            } catch (InvalidConfigurationException e) {
                throw e;
            } catch (Exception e) {
                tracer.severe("failure in config validation", e);
                throw new InvalidConfigurationException(e.getMessage());
            }

            try {
                String maxForRoutesString = (String) properties.getProperty(CFG_PROPERTY_MAX_CONNECTIONS_FOR_ROUTES)
                        .getValue();

                String[] maxForRoutesStrings = maxForRoutesString.split(",");
                for (String maxForRoute : maxForRoutesStrings) {
                    if (maxForRoute.isEmpty()) {
                        continue;
                    }
                    String[] maxForRouteParts = maxForRoute.split(":");

                    if (maxForRouteParts.length != MAX_CONNECTIONS_FOR_ROUTES_TOKEN_LENGTH) {
                        throw new InvalidConfigurationException(CFG_PROPERTY_MAX_CONNECTIONS_FOR_ROUTES
                                + " format is scheme:host:port:maxForRoute separated by comma");
                    }

                    String scheme = maxForRouteParts[HTTP_SCHEME_INDEX];
                    if (scheme == null || scheme.equals("")) {
                        scheme = HttpHost.DEFAULT_SCHEME_NAME;
                    }

                    String host = maxForRouteParts[HTTP_HOST_INDEX];
                    if (host == null || host.equals("")) {
                        throw new InvalidConfigurationException(
                                CFG_PROPERTY_MAX_CONNECTIONS_FOR_ROUTES
                                        + " format is scheme:host:port:maxForRoute separated by comma. Passing host is mandatory");
                    }

                    String portStr = maxForRouteParts[HTTP_PORT_INDEX];
                    if (portStr == null || portStr.equals("")) {
                        portStr = "80";
                    }

                    int port = Integer.parseInt(portStr);

                    String maxForRoutePartsStr = maxForRouteParts[HTTP_MAXFORROUTE_INDEX];

                    Integer max = Integer.valueOf(maxForRoutePartsStr);
                    if (max < 1) {
                        throw new InvalidConfigurationException(
                                CFG_PROPERTY_MAX_CONNECTIONS_FOR_ROUTES
                                        + " format is scheme:host:port:maxForRoute separated by comma. Passing maxForRoute is mandatory and must be greater than 0");
                    }

                    new HttpRoute(new HttpHost(host, port, scheme));

                }
            } catch (InvalidConfigurationException e) {
                throw e;
            } catch (Exception e) {
                tracer.severe("failure in config validation", e);
                throw new InvalidConfigurationException(e.getMessage());
            }
        } else {
            try {
                Class<? extends HttpClientFactory> c = (Class<? extends HttpClientFactory>) Class
                        .forName(httpClientFactoryClassName);
                c.newInstance();
            } catch (Exception e) {
                tracer.severe("failed to load http client factory class", e);
                throw new InvalidConfigurationException("failed to load http client factory class", e);
            }
        }

    }
401533
private void initConfigPropertyResolver(ServletContext context) {
		String configPropertyResolverClass = getInitParameter("configPropertyResolverClass");
		// Load a custom class to set configPropertyResolver
		configPropResolver = null;
		if (null != configPropertyResolverClass) {
			configPropResolver = (ConfigPropertyResolver) ClassLoaderResourceUtils
					.buildObjectInstance(configPropertyResolverClass);
			if (configPropResolver instanceof ServletContextAware) {
				((ServletContextAware) configPropResolver).setServletContext(context);
			}
		}
	}
55115
public Object setConnectionProperty(String name, String value) {
        return connProperties.setProperty(name, value);
    }
387750
public void raVerifyConfiguration(ConfigProperties properties)
			throws InvalidConfigurationException {
		
		try {
			// get port
			Integer port = (Integer) properties.getProperty(SIP_PORT_BIND).getValue();
			// get host
			String stackAddress = (String) properties.getProperty(SIP_BIND_ADDRESS).getValue();
			if (stackAddress.equals("")) {
				stackAddress = this.getJBossAddress();
			}
			
			if(stackAddress!=null) {
			    // try to open socket
			    InetSocketAddress sockAddress = new InetSocketAddress(stackAddress,
					port);
			    try {
	                new DatagramSocket(sockAddress).close();
			    } catch(BindException e) {
			        // in case already bound
			    }
			}
			
			// check transports			
			String transports = (String) properties.getProperty(TRANSPORTS_BIND).getValue();
			String[] transportsArray = transports.split(",");
			boolean validTransports = true;
			if (transportsArray.length > 0) {
				for (String transport : transportsArray) {
					if (!allowedTransports.contains(transport.toLowerCase()))
						validTransports = false;
					break;
				}
			}
			else {
				validTransports = false;
			}
			if (!validTransports) {
				throw new IllegalArgumentException(TRANSPORTS_BIND+" config property with invalid value: "+transports);
			}
			
			// verify existence of sipra.properties file
			if (sipRaPropertiesLocation!=null) {
				File f = new File(sipRaPropertiesLocation);
				if (!f.exists() || f.isDirectory()) {
					throw new IllegalArgumentException(SIPRA_PROPERTIES_LOCATION+" config property points to non existing file: "+sipRaPropertiesLocation);
				}
			}
		}
		catch (Throwable e) {
			throw new InvalidConfigurationException(e.getMessage(),e);
		}
	}
842576
private void setupRequestProperties(HttpURLConnection connection, Map<String, Object> properties) {
		Set<Entry<String, Object>> entries = properties.entrySet();
		for (Entry<String, Object> e : entries) {
			String name = e.getKey();
			Object value = e.getValue();

			if (name != null && value != null) {
				connection.setRequestProperty(name, value.toString());
			}
		}
	}
1278606
private static Properties loadClientProperties(List<ConfigProperty> properties,
      BiFunction<PropertyKey, String, String> logMessage) {
    Properties props = new Properties();
    for (ConfigProperty property : properties) {
      String name = property.getName();
      // TODO(binfan): support propagating unsetting properties from master
      if (PropertyKey.isValid(name) && property.hasValue()) {
        PropertyKey key = PropertyKey.fromString(name);
        if (!GrpcUtils.contains(key.getScope(), Scope.CLIENT)) {
          // Only propagate client properties.
          continue;
        }
        String value = property.getValue();
        props.put(key, value);
        LOG.debug(logMessage.apply(key, value));
      }
    }
    return props;
  }
190106
protected T handleRealize(T proxy)
	{
		T ret = createInstance(proxy);
		PropertyResolverConverter prc = getPropertyResolverConverter();
		for (Map.Entry<String, Object> entry: values.entrySet()) {
			String propertyName = entry.getKey();
			Object value = entry.getValue();
			int mappedIndicatorIndx = propertyName.indexOf(':');
			if(mappedIndicatorIndx<0)
			{
				try
				{
					PropertyResolver.setValue(propertyName, ret, value, prc);
				} catch (WicketRuntimeException e)
				{
					LOG.error("Can't set property"+propertyName, e);
				}
			}
			else
			{
				String propertyExp = propertyName.substring(0, mappedIndicatorIndx);
				String fieldExp = propertyName.substring(mappedIndicatorIndx+1);
				Object object = ret;
				int subObject = propertyExp.lastIndexOf('.');
				if(subObject>=0)
				{
					object = PropertyResolver.getValue(propertyExp.substring(0, subObject), object);
					propertyExp = propertyExp.substring(subObject+1);
				}
				if(object!=null)
				{
					String methodName="set"+propertyExp.substring(0, 1).toUpperCase()+propertyExp.substring(1);
					Method[] methods = object.getClass().getMethods();
					try
					{
						for (Method method : methods)
						{
							if(method.getName().equals(methodName))
							{
								Class<?>[] paramTypes = method.getParameterTypes();
								if(paramTypes.length==2 
										&& paramTypes[0].isAssignableFrom(String.class)
										&& (value==null || paramTypes[1].isInstance(value)))
								{
									method.invoke(object, fieldExp, value);
									break;
								}
							}
						}
					} catch (Exception e)
					{
						LOG.error("Can't set property "+propertyName, e);
					} 
					
				}
			}
		}
		realized = ret;
		if(listener!=null) listener.onRealizePrototype((IPrototype<T>)proxy);
		return ret;
	}