Returns a new instance of {@code AspectranDaemonService}.

@param aspectranConfig the parameters for aspectran configuration
@return the instance of {@code AspectranDaemonService}
513337
public static AspectranDaemonService create(AspectranConfig aspectranConfig) {
        ContextConfig contextConfig = aspectranConfig.touchContextConfig();
        String rootFile = contextConfig.getRootFile();
        if (!StringUtils.hasText(rootFile)) {
            if (!contextConfig.hasAspectranParameters()) {
                contextConfig.setRootFile(DEFAULT_APP_CONFIG_ROOT_FILE);
            }
        }

        AspectranDaemonService service = new AspectranDaemonService();
        service.prepare(aspectranConfig);
        DaemonConfig daemonConfig = aspectranConfig.getDaemonConfig();
        if (daemonConfig != null) {
            applyDaemonConfig(service, daemonConfig);
        }
        setServiceStateListener(service);
        return service;
    }
954988
public Future<T> doConfigurationUpdate(final ConfigurationRequest<T> configurationRequest) {
        Util.notNull(configurationRequest, "ConfigurationRequest passed to ConfigurationHandler");
        return executorService.submit(new Callable<T>() {
            public T call() throws Exception {
                try {
                    T conf = configurationRequest.invoke();
                    updateListenersWithNewConfiguration(conf);
                    return conf;
                } catch (Exception e) {
                    updateListenersWithFailure(e);
                    throw e;
                }
            }
        });
    }
1191158
@SuppressWarnings("static-method")
	@Provides
	@Singleton
	public SarlConfig getSarlcConfig(ConfigurationFactory configFactory, Injector injector) {
		final SarlConfig config = SarlConfig.getConfiguration(configFactory);
		injector.injectMembers(config);
		return config;
	}
144843
public static QueryableStateConfiguration fromConfiguration(Configuration config) {
		if (!config.getBoolean(QueryableStateOptions.ENABLE_QUERYABLE_STATE_PROXY_SERVER)) {
			return null;
		}

		final Iterator<Integer> proxyPorts = NetUtils.getPortRangeFromString(
			config.getString(QueryableStateOptions.PROXY_PORT_RANGE));
		final Iterator<Integer> serverPorts = NetUtils.getPortRangeFromString(
			config.getString(QueryableStateOptions.SERVER_PORT_RANGE));

		final int numProxyServerNetworkThreads = config.getInteger(QueryableStateOptions.PROXY_NETWORK_THREADS);
		final int numProxyServerQueryThreads = config.getInteger(QueryableStateOptions.PROXY_ASYNC_QUERY_THREADS);

		final int numStateServerNetworkThreads = config.getInteger(QueryableStateOptions.SERVER_NETWORK_THREADS);
		final int numStateServerQueryThreads = config.getInteger(QueryableStateOptions.SERVER_ASYNC_QUERY_THREADS);

		return new QueryableStateConfiguration(
			proxyPorts,
			serverPorts,
			numProxyServerNetworkThreads,
			numProxyServerQueryThreads,
			numStateServerNetworkThreads,
			numStateServerQueryThreads);
	}
1195223
@SuppressWarnings("deprecation")
	OperationalConfig buildOperationalConfig() {
		return new OperationalConfigImpl(isAsync(), getProperties(), getSessionTimeout(), getThreadPoolSize(), isTransportModeLoggingOnly(), isDebugLogging(),
				getSslHostsToTrust(), isTrustAllSSLHost());
	}
395908
static DefaultEmbeddedAspectran create(AspectranConfig aspectranConfig) {
        ContextConfig contextConfig = aspectranConfig.touchContextConfig();
        String rootFile = contextConfig.getRootFile();
        if (!StringUtils.hasText(rootFile) && !contextConfig.hasAspectranParameters()) {
            contextConfig.setRootFile(DEFAULT_APP_CONFIG_ROOT_FILE);
        }

        DefaultEmbeddedAspectran aspectran = new DefaultEmbeddedAspectran();
        aspectran.prepare(aspectranConfig);
        setServiceStateListener(aspectran);
        return aspectran;
    }
1152132
@RequestMapping(value = "configurations/{name}", method = RequestMethod.GET)
    public JIRAConfiguration getConfiguration(@PathVariable String name) {
        return jiraConfigurationService.getConfiguration(name);
    }
1179928
public Configuration create(InputStream stream) {
        try {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setValidating(false);
            factory.setIgnoringElementContentWhitespace(true);
            factory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = factory.newDocumentBuilder();
            Document document = documentBuilder.parse(stream);
            return domConfigurationFactory.create(document);
        } catch (ParserConfigurationException e) {
            throw new TextProcessorFactoryException(e);
        } catch (IOException e) {
            throw new TextProcessorFactoryException(e);
        } catch (SAXException e) {
            throw new TextProcessorFactoryException(e);
        }
    }
84029
public static HazelcastInstance newHazelcastInstance(Config config) {
        if (config == null) {
            XmlConfigLocator xmlConfigLocator = new XmlConfigLocator();
            YamlConfigLocator yamlConfigLocator = new YamlConfigLocator();

            if (xmlConfigLocator.locateFromSystemProperty()) {
                // 1. Try loading XML config if provided in system property
                config = new XmlConfigBuilder(xmlConfigLocator).build();

            } else if (yamlConfigLocator.locateFromSystemProperty()) {
                // 2. Try loading YAML config if provided in system property
                config = new YamlConfigBuilder(yamlConfigLocator).build();

            } else if (xmlConfigLocator.locateInWorkDirOrOnClasspath()) {
                // 3. Try loading XML config from the working directory or from the classpath
                config = new XmlConfigBuilder(xmlConfigLocator).build();

            } else if (yamlConfigLocator.locateInWorkDirOrOnClasspath()) {
                // 4. Try loading YAML config from the working directory or from the classpath
                config = new YamlConfigBuilder(yamlConfigLocator).build();

            } else {
                // 5. Loading the default XML configuration file
                xmlConfigLocator.locateDefault();
                config = new XmlConfigBuilder(xmlConfigLocator).build();
            }
        }

        return newHazelcastInstance(
                config,
                config.getInstanceName(),
                new DefaultNodeContext()
        );
    }
774320
public static ThorntailConfigurationBuilder create(Configuration config)
    {
        ThorntailConfigurationBuilder builder = new ThorntailConfigurationBuilder();

        ConfigurationElement propertiesElem = null;
        try
        {
            propertiesElem = config.getConfigurationElement("properties");
        }
        catch (RuntimeException e)
        {
            // Do nothing
        }
        if (propertiesElem != null)
        {
            Map<String, String> properties = new TreeMap<>();
            propertiesElem.getChildren().stream()
                        .filter(ConfigurationElement.class::isInstance)
                        .map(ConfigurationElement.class::cast)
                        .forEach(elem -> properties.put(elem.getName(), elem.getText()));
            builder.properties(properties);
        }
        return builder;
    }
509566
public static ResourceManagerRuntimeServicesConfiguration fromConfiguration(Configuration configuration) throws ConfigurationException {

		final String strJobTimeout = configuration.getString(ResourceManagerOptions.JOB_TIMEOUT);
		final Time jobTimeout;

		try {
			jobTimeout = Time.milliseconds(Duration.apply(strJobTimeout).toMillis());
		} catch (NumberFormatException e) {
			throw new ConfigurationException("Could not parse the resource manager's job timeout " +
				"value " + ResourceManagerOptions.JOB_TIMEOUT + '.', e);
		}

		final SlotManagerConfiguration slotManagerConfiguration = SlotManagerConfiguration.fromConfiguration(configuration);

		return new ResourceManagerRuntimeServicesConfiguration(jobTimeout, slotManagerConfiguration);
	}
1311250
public static AliasedDiscoveryConfig newAliasedDiscoveryConfig(String name) {
        if ("aws".equals(name)) {
            return new ClientAwsConfig();
        } else {
            return AliasedDiscoveryConfigUtils.newConfigFor(name);
        }
    }
793872
@SuppressWarnings("unchecked")
    public <T> T getFinallyAdviceResult(String aspectId) {
        return (aspectAdviceResult != null ? (T)aspectAdviceResult.getFinallyAdviceResult(aspectId) : null);
    }
106530
public static <T> Retryer<T> newInstance(Config config) {
    config = config.withFallback(DEFAULTS);
    RetryType type = RetryType.valueOf(config.getString(RETRY_TYPE).toUpperCase());

    switch (type) {
      case EXPONENTIAL:
        return newExponentialRetryer(config);
      case FIXED:
        return newFixedRetryer(config);
      default:
        throw new IllegalArgumentException(type + " is not supported");
    }
  }
96026
public OperationFuture<LoadBalancer> create(LoadBalancerConfig config) {
        String dataCenterId = dataCenterService.findByRef(config.getDataCenter()).getId();

        LoadBalancerMetadata loadBalancer = loadBalancerClient.create(
            dataCenterId,
            new LoadBalancerRequest()
                .name(config.getName())
                .description(config.getDescription())
                .status(config.getStatus())
        );

        LoadBalancer loadBalancerRef = LoadBalancer.refById(loadBalancer.getId(), DataCenter.refById(dataCenterId));

        return new OperationFuture<>(
            loadBalancerRef,
            new SequentialJobsFuture(
                () -> new CreateLoadBalancerJobFuture(this, loadBalancerRef),
                () -> addLoadBalancerPools(config, loadBalancerRef)
            )
        );
    }
121618
public void doRuntimeConfiguration(RuntimeSpringConfiguration springConfig) {
        ApplicationContext context = springConfig.getUnrefreshedApplicationContext();
        AutowireCapableBeanFactory autowireCapableBeanFactory = context.getAutowireCapableBeanFactory();
        if(autowireCapableBeanFactory instanceof ConfigurableListableBeanFactory) {
            ConfigurableListableBeanFactory beanFactory = (ConfigurableListableBeanFactory)autowireCapableBeanFactory;
            ConversionService existingConversionService = beanFactory.getConversionService();
            ConverterRegistry converterRegistry;
            if(existingConversionService == null) {
                GenericConversionService conversionService = new GenericConversionService();
                converterRegistry = conversionService;
                beanFactory.setConversionService(conversionService);
            }
            else {
                converterRegistry = (ConverterRegistry)existingConversionService;
            }

            converterRegistry.addConverter(new Converter<NavigableMap.NullSafeNavigator, Object>() {
                @Override
                public Object convert(NavigableMap.NullSafeNavigator source) {
                    return null;
                }
            });
        }
        checkInitialised();
        for (GrailsPlugin plugin : pluginList) {
            if (plugin.supportsCurrentScopeAndEnvironment() && plugin.isEnabled(context.getEnvironment().getActiveProfiles())) {
                plugin.doWithRuntimeConfiguration(springConfig);
            }
        }
    }
1317109
public ILoadBalancer buildLoadBalancerFromConfigWithReflection() {
        String loadBalancerClassName = config.get(CommonClientConfigKey.NFLoadBalancerClassName);
        if (loadBalancerClassName == null) {
            throw new IllegalArgumentException("NFLoadBalancerClassName is not specified in the IClientConfig");
        }
        ILoadBalancer lb;
        try {
            lb = (ILoadBalancer) factory.create(loadBalancerClassName, config);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return lb;
    }