Load, Parse & Resolve configurations from a resource, with default parse & resolve options.

@param classLoader
@param configResource
@param useSystemEnvironment
{@code true} to resolve substitutions falling back to environment
variables
@return
327847
public static Config loadConfig(ClassLoader classLoader, String configResource,
            boolean useSystemEnvironment) {
        return loadConfig(ConfigParseOptions.defaults(),
                ConfigResolveOptions.defaults().setUseSystemEnvironment(useSystemEnvironment),
                classLoader, configResource);
    }
713254
public ResourceTransformerEntry resolveResourceTransformer(final PathAddress address, final PlaceholderResolver placeholderResolver) {
        return resolveResourceTransformer(address.iterator(), null, placeholderResolver);
    }
446829
@Override
  protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
    Class<?> clazz = findLoadedClass(name);
    if (clazz == null) {
      if (inExceptedPackage(name)) {
        clazz = super.loadClass(name, false);
      } else {
        try {
          clazz = findClass(name);          
        } catch (ClassNotFoundException e) {
          clazz = super.loadClass(name, false);
          if (!clazz.isAnnotation()) { // Annotations are always safe to load
            logger.log(Type.WARN, String.format(
                "Class %s is used in Gin, but not available in GWT client code.", name));
          }
        }
      }
    }

    if (resolve) {
      resolveClass(clazz);
    }

    return clazz;
  }
961569
public static Config loadConfig(
      String cluster,
      String role,
      String environ,
      String topologyBinaryFile,
      String topologyDefnFile,
      Boolean verbose,
      TopologyAPI.Topology topology) {

    return Config.toClusterMode(
        Config.newBuilder()
            .putAll(ConfigLoader.loadClusterConfig())
            .putAll(commandLineConfigs(cluster, role, environ, verbose))
            .putAll(topologyConfigs(topologyBinaryFile, topologyDefnFile, topology))
            .build());
  }
1255961
@Override
    protected Class<?> loadClass(String name, boolean resolve)
            throws ClassNotFoundException {
        synchronized (LaunchedURLClassLoader.LOCK_PROVIDER.getLock(this, name)) {
            Class<?> loadedClass = findLoadedClass(name);
            if (loadedClass == null) {
                Handler.setUseFastConnectionExceptions(true);
                try {
                    loadedClass = doLoadClass(name);
                } finally {
                    Handler.setUseFastConnectionExceptions(false);
                }
            }
            if (resolve) {
                resolveClass(loadedClass);
            }
            return loadedClass;
        }
    }
405663
public BaseConfigurationPropertiesLoader getLoader(final Resource resource,
                                                       final String name) {
        val filename = StringUtils.defaultString(resource.getFilename()).toLowerCase();

        if (filename.endsWith(".properties")) {
            return new SimpleConfigurationPropertiesLoader(this.configurationCipherExecutor, name, resource);
        }
        if (filename.endsWith(".groovy")) {
            return new GroovyConfigurationPropertiesLoader(this.configurationCipherExecutor, name,
                getApplicationProfiles(environment), resource);
        }
        if (filename.endsWith(".yaml") || filename.endsWith(".yml")) {
            return new YamlConfigurationPropertiesLoader(this.configurationCipherExecutor, name, resource);
        }
        throw new IllegalArgumentException("Unable to determine configuration loader for " + resource);
    }
390950
function Repository(loader, environment) {

    /**
     * The loader implementation.
     *
     * @var {FileLoader}
     * @protected
     */
    this.__loader = loader;

    /**
     * The current environment.
     *
     * @var {string}
     * @protected
     */
    this.__environment = environment;

    /**
     * All of the configuration items.
     *
     * @var {Array}
     * @protected
     */
    this.__items = [];

    /**
     * The after load callbacks for namespaces.
     *
     * @var {Array}
     * @protected
     */
    this.__afterLoad = [];

    // call super class constructor
    Repository.super_.call(this);

}
1251108
public static Serializable loadConfig (InputStream source)
        throws IOException
    {
        try {
            ObjectInputStream oin = new ObjectInputStream(source);
            return (Serializable)oin.readObject();
        } catch (ClassNotFoundException cnfe) {
            String errmsg = "Unknown config class";
            throw (IOException) new IOException(errmsg).initCause(cnfe);
        }
    }
1133224
public <T> T loadImpl(Class<T> service) {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        if (loader == null) {
            loader = ClassLoader.getSystemClassLoader();
        }
        Enumeration<URL> resources;
        try {
            resources = loader.getResources("mockito-extensions/" + service.getName());
        } catch (IOException e) {
            throw new IllegalStateException("Failed to load " + service, e);
        }

        try {
            String classOrAlias = new PluginFinder(pluginSwitch).findPluginClass(Iterables.toIterable(resources));
            if (classOrAlias != null) {
                if (classOrAlias.equals(alias)) {
                    classOrAlias = plugins.getDefaultPluginClass(alias);
                }
                Class<?> pluginClass = loader.loadClass(classOrAlias);
                Object plugin = pluginClass.newInstance();
                return service.cast(plugin);
            }
            return null;
        } catch (Exception e) {
            throw new IllegalStateException(
                "Failed to load " + service + " implementation declared in " + resources, e);
        }
    }
71336
public static <S> S loadOptionalService(Class<S> serviceInterface)
  {
    S service = null;
    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    if(classLoader != null) {
      service = loadService(serviceInterface, classLoader);
    }
    if(service == null) {
      service = loadService(serviceInterface, Classes.class.getClassLoader());
    }
    return service;
  }
265947
public static ClassLoader resolveClassLoaderForBeanProxy(String contextId, Class<?> proxiedType, TypeInfo typeInfo, ProxyServices proxyServices) {
        Class<?> superClass = typeInfo.getSuperClass();
        if (superClass.getName().startsWith(JAVA)) {
            ClassLoader cl = proxyServices.getClassLoader(proxiedType);
            if (cl == null) {
                cl = Thread.currentThread().getContextClassLoader();
            }
            return cl;
        }
        return Container.instance(contextId).services().get(ProxyServices.class).getClassLoader(superClass);
    }
401501
public static Properties loadProperties(final ClassLoader loader, final String resource) {
        checkNotNull("loader", loader);
        checkNotNull("resource", resource);

        final Properties props = new Properties();
        try (final InputStream inStream = loader.getResourceAsStream(resource)) {
            if (inStream == null) {
                throw new IllegalArgumentException("Resource '" + resource + "' not found!");
            }
            props.load(inStream);
        } catch (final IOException ex) {
            throw new RuntimeException(ex);
        }
        return props;
    }
117301
public <T> T loadResources(Class<T> type, List<String> resources) {
    if (resources == null || resources.isEmpty()) {
      throw new IllegalArgumentException("resources must be defined");
    }
    Config config = null;
    for (String resource : resources) {
      if (config == null) {
        config = ConfigFactory.load(classLoader, resource);
      } else {
        config = config.withFallback(ConfigFactory.load(classLoader, resource));
      }
    }
    return map(checkNotNull(config, "config cannot be null").resolve(), type);
  }
431330
protected void addPropertySources(ConfigurableEnvironment environment,
			ResourceLoader resourceLoader) {
		RandomValuePropertySource.addToEnvironment(environment);
		new Loader(environment, resourceLoader).load();
	}
626712
public static ArrayList<ConfigSource> getDefaultSources(ClassLoader classloader) {
        ArrayList<ConfigSource> sources = new ArrayList<>();

        sources.add(new SystemConfigSource());
        sources.add(new EnvConfigSource());

        sources.addAll(getPropertiesFileConfigSources(classloader));

        return sources;
    }
973932
protected void load(ApplicationContext context, Object[] sources) {
		if (logger.isDebugEnabled()) {
			logger.debug(
					"Loading source " + StringUtils.arrayToCommaDelimitedString(sources));
		}
		BeanDefinitionLoader loader = createBeanDefinitionLoader(
				getBeanDefinitionRegistry(context), sources);
		if (this.beanNameGenerator != null) {
			loader.setBeanNameGenerator(this.beanNameGenerator);
		}
		if (this.resourceLoader != null) {
			loader.setResourceLoader(this.resourceLoader);
		}
		if (this.environment != null) {
			loader.setEnvironment(this.environment);
		}
		loader.load();
	}
550826
@SneakyThrows
   public static void loadConfig(Resource resource) {
      if (resource == null || !resource.exists()) {
         return;
      }
      if (resource.path() != null && getInstance().loaded.contains(resource.path())) {
         return; //Only load once!
      }
      new ConfigParser(resource).parse();
      if (resource.path() != null) {
         getInstance().loaded.add(resource.path());
      }
   }