Package com.foundationdb.server.service.servicemanager.configuration

Examples of com.foundationdb.server.service.servicemanager.configuration.DefaultServiceConfigurationHandler


    public GuicedServiceManager() {
        this(standardUrls());
    }

    public GuicedServiceManager(BindingsConfigurationProvider bindingsConfigurationProvider) {
        DefaultServiceConfigurationHandler configurationHandler = new DefaultServiceConfigurationHandler();

        // Install the default, no-op JMX registry; this is a special case, since we want to use it
        // as we start each service.
        configurationHandler.bind(JmxRegistryService.class.getName(), NoOpJmxRegistry.class.getName(), null);

        // Next, load each element in the provider...
        for (BindingsConfigurationLoader loader : bindingsConfigurationProvider.loaders()) {
            loader.loadInto(configurationHandler);
        }

        // ... followed by the configured or default file, if either exists
        URL configFile = findServiceConfigFile();
        if (configFile != null) {
            new YamlBindingsUrl(configFile).loadInto(configurationHandler);
        }

        // ... followed by any command-line overrides.
        new PropertyBindings(System.getProperties()).loadInto(configurationHandler);

        Collection<ServiceBinding> bindings = configurationHandler.serviceBindings(false);
        BindingsConfigurationLoader pluginsConfigLoader = getPluginsConfigurationLoader(bindings);
        pluginsConfigLoader.loadInto(configurationHandler);

        bindings = configurationHandler.serviceBindings(true);

        try {
            guicer = Guicer.forServices(ServiceManager.class, this,
                                        bindings, configurationHandler.priorities(), configurationHandler.getModules());
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.service.servicemanager.configuration.DefaultServiceConfigurationHandler

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.