当前位置: 首页>>代码示例>>Java>>正文


Java SystemConfiguration类代码示例

本文整理汇总了Java中org.apache.commons.configuration2.SystemConfiguration的典型用法代码示例。如果您正苦于以下问题:Java SystemConfiguration类的具体用法?Java SystemConfiguration怎么用?Java SystemConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SystemConfiguration类属于org.apache.commons.configuration2包,在下文中一共展示了SystemConfiguration类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AliceRecognition

import org.apache.commons.configuration2.SystemConfiguration; //导入依赖的package包/类
private AliceRecognition()
{
	try
	{
		CombinedConfiguration config = new CombinedConfiguration(new MergeCombiner());
		config.addConfiguration(new SystemConfiguration());
		config.addConfiguration(new FileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)
			    					  .configure(new Parameters().properties().setFileName(ALICE_PROPERTIES)).getConfiguration());
			
		this.enabled = config.getBoolean(ALICE_ENABLED, false);
		String url = config.getString(ALICE_SERVICE_URL, null); 
		String accessToken = config.getString(ALICE_ACCESS_TOKEN, null); 
		String command = config.getString(ALICE_COMMAND, null); 
	
		if(enabled && !StringUtils.isEmpty(url) && !StringUtils.isEmpty(accessToken))
		{
			this.client = new AliceClient(url, command);
			this.client.setAuthToken(accessToken);
			this.enabled = this.client.isAvailable();
		}
	}
	catch (Exception e) 
	{
		LOGGER.error("Unable to initialize Alice: " + e.getMessage());
	}
}
 
开发者ID:qaprosoft,项目名称:carina,代码行数:27,代码来源:AliceRecognition.java

示例2: ConfigurationProvider

import org.apache.commons.configuration2.SystemConfiguration; //导入依赖的package包/类
public ConfigurationProvider() {
  SystemConfiguration sysConfig = new SystemConfiguration();
  propertyFilePath = sysConfig.getString(Constants.CONFIG_PROP_FILE_PATH, Constants.CONFIG_PROP_FILE_PATH_DEFAULT);
}
 
开发者ID:email2liyang,项目名称:grpc-mate,代码行数:5,代码来源:ConfigurationProvider.java

示例3: createSystem

import org.apache.commons.configuration2.SystemConfiguration; //导入依赖的package包/类
private Optional<Configuration> createSystem() {
    return Optional.of(new SystemConfiguration());
}
 
开发者ID:after-the-sunrise,项目名称:cryptotrader,代码行数:4,代码来源:ConfigurationProviderImpl.java

示例4: ApacheCommonsConfigFile

import org.apache.commons.configuration2.SystemConfiguration; //导入依赖的package包/类
/**
 * This ctor supports 4 levels of configuration.
 * Levels higher in the list override levels lower in the list.
 * <ol>
 * 		<li>heapSpank properties passed in as java -D parameters, aka "Java System Properties" </li>
 * 		<li>heapSpank.properties file in the current folder</li>
 * 		<li>heapSpank.properties file in the current user's 'home' folder.</li>
 * 		<li>com.github.eostermueller.heapspank.leakyspank.console.DefaultConfig</li>
 * @throws ConfigurationException
 */
public ApacheCommonsConfigFile() throws ConfigurationException {
	this.compositeConfiguration.addConfiguration( new SystemConfiguration() );
	this.compositeConfiguration.addConfiguration( getCurrentFolderConfiguration() );
	this.compositeConfiguration.addConfiguration( getHomeFolderConfiguration() );
	this.compositeConfiguration.addConfiguration( getHeapSpankJarConfiguration() );
}
 
开发者ID:eostermueller,项目名称:heapSpank,代码行数:17,代码来源:ApacheCommonsConfigFile.java


注:本文中的org.apache.commons.configuration2.SystemConfiguration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。