Package io.airlift.configuration

Examples of io.airlift.configuration.ConfigurationLoader


    public static <T> T loadConfig(Class<T> clazz, Optional<String> path)
            throws IOException
    {
        ImmutableMap.Builder<String, String> map = ImmutableMap.builder();
        ConfigurationLoader loader = new ConfigurationLoader();
        if (path.isPresent()) {
            map.putAll(loader.loadPropertiesFrom(path.get()));
        }
        map.putAll(loader.getSystemProperties());
        return new ConfigurationFactory(map.build()).build(clazz);
    }
View Full Code Here


        Map<String, String> requiredProperties;
        ConfigurationFactory configurationFactory;
        if (requiredConfigurationProperties == null) {
            // initialize configuration
            log.info("Loading configuration");
            ConfigurationLoader loader = new ConfigurationLoader();

            requiredProperties = Collections.emptyMap();
            String configFile = System.getProperty("config");
            if (configFile != null) {
                requiredProperties = loader.loadPropertiesFrom(configFile);
            }
        }
        else {
            requiredProperties = requiredConfigurationProperties;
        }
View Full Code Here

import java.util.concurrent.Executors;

public class NiftyLoadTester {

    public static void main(String[] args) throws Exception {
    ConfigurationFactory cf = new ConfigurationFactory(new ConfigurationLoader().loadProperties());
    AbstractModule exampleModule = new AbstractModule() {
      @Override
      public void configure() {
        ConfigurationModule.bindConfig(binder()).to(LoadTesterConfig.class);
        binder().bind(NiftyBootstrap.class).in(Singleton.class);
View Full Code Here

    public static void main(String[] args) throws Exception
    {
        // Configure netty logs to go to SLF4J
        InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());

        ConfigurationFactory cf = new ConfigurationFactory(new ConfigurationLoader().loadProperties());
        AbstractModule exampleModule = new AbstractModule()
        {
            @Override
            public void configure()
            {
View Full Code Here

TOP

Related Classes of io.airlift.configuration.ConfigurationLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.