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


Java ConfigurationConverter.getMap方法代码示例

本文整理汇总了Java中org.apache.commons.configuration.ConfigurationConverter.getMap方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationConverter.getMap方法的具体用法?Java ConfigurationConverter.getMap怎么用?Java ConfigurationConverter.getMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.configuration.ConfigurationConverter的用法示例。


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

示例1: Neo4jGraph

import org.apache.commons.configuration.ConfigurationConverter; //导入方法依赖的package包/类
protected Neo4jGraph(final Configuration configuration) {
    this.configuration.copy(configuration);
    final String directory = this.configuration.getString(CONFIG_DIRECTORY);
    final Map neo4jSpecificConfig = ConfigurationConverter.getMap(this.configuration.subset(CONFIG_CONF));
    this.baseGraph = Neo4jFactory.Builder.open(directory, neo4jSpecificConfig);
    this.initialize(this.baseGraph, configuration);
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:8,代码来源:Neo4jGraph.java

示例2: configToContext

import org.apache.commons.configuration.ConfigurationConverter; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
protected static final Context configToContext(Configuration configuration) {
  if (configuration == null) {
    return new Context();
  }
  return new Context(ConfigurationConverter.getMap(configuration));
}
 
开发者ID:Comcast,项目名称:flume2storm,代码行数:8,代码来源:IntegrationTest.java

示例3: StormSinkConfiguration

import org.apache.commons.configuration.ConfigurationConverter; //导入方法依赖的package包/类
/**
 * Copy constructor
 * 
 * @param other
 *          the configuration to copy
 */
public StormSinkConfiguration(final StormSinkConfiguration other) {
  batchSize = other.batchSize;
  locationServiceFactoryClassName = other.locationServiceFactoryClassName;
  serviceProviderSerializationClassName = other.serviceProviderSerializationClassName;
  connectionParametersFactoryClassName = other.connectionParametersFactoryClassName;
  eventSenderFactoryClassName = other.eventSenderFactoryClassName;
  configuration = new MapConfiguration(ConfigurationConverter.getMap(other.configuration));
}
 
开发者ID:Comcast,项目名称:flume2storm,代码行数:15,代码来源:StormSinkConfiguration.java

示例4: Server

import org.apache.commons.configuration.ConfigurationConverter; //导入方法依赖的package包/类
public Server(PropertiesConfiguration properties) throws IOException {
	m_properties = properties;
	m_httpServer = new HttpServer();
	
	int port = properties.getInt(PROPERTY_PORT, DEFAULT_PORT);
	String host = properties.getString(PROPERTY_HOST, DEFAULT_HOST);
	final NetworkListener networkListener = new NetworkListener(
			NET_LISTENER_NAME,
			host,
			port);

	// Enable SSL on the listener
	networkListener.setSecure(true);
	networkListener.setSSLEngineConfig(makeSSLConfig(m_properties));

	CompressionConfig compressionConfig =
	        networkListener.getCompressionConfig();
	compressionConfig.setCompressionMode(CompressionConfig.CompressionMode.ON); // the mode
	compressionConfig.setCompressionMinSize(100); // the min amount of bytes to compress
	compressionConfig.setCompressableMimeTypes("text/plain", "text/html", "application/x-protobuf", "application/pdf"); // the mime types to compress
	
	m_httpServer.addListener(networkListener);
	

	// Create a concurrent, nonblocking, asynchronous, batching JPA-based store for persistence
	// of request data. Async is OK, as persistence failures do not need to be handled by the client.
	m_store = new JPABatchStore(ConfigurationConverter.getMap(m_properties));
	m_batchPersister = new AsyncConcurrentBatchingProcessor<PersistEntityEvent>(
			m_store,
			PersistEntityEvent::new,
			PersistEntityEvent::translate
			);

	final ServerConfiguration config = m_httpServer.getServerConfiguration();

	config.setMaxPostSize(MAX_POST_SIZE);
	AsyncPostHandler.ErrorHandler errorHandler = 
			(ByteBuffer postBytes, Response resp, Throwable t) -> {
				LogManager.getLogger(this).warn("Invalid submission.", t);
				resp.sendError(300);
				resp.finish();
			};

	AsyncPostHandler certHandler = 
			new AsyncPostHandler(new CertificateHandler(m_batchPersister, CERT_TEMPLATE_PATH, errorHandler),
					errorHandler);
	
	
	AsyncPostHandler versionHandler =
			new AsyncPostHandler(new VersionCheckHandler(m_batchPersister, properties), errorHandler);
	config.addHttpHandler(certHandler, PATH_SUBMIT);
	config.addHttpHandler(versionHandler, PATH_VERSION_CHECK);
	
}
 
开发者ID:davruet,项目名称:shenanigans.io,代码行数:55,代码来源:Server.java

示例5: getPoolConfiguration

import org.apache.commons.configuration.ConfigurationConverter; //导入方法依赖的package包/类
/**
 * Returns the pool configuration of the scorer.
 *
 * @return a map from configuration key to configuration value
 */
@NotNull
public Map<Object, Object> getPoolConfiguration() {
    return ConfigurationConverter.getMap(configuration.subset(GenericObjectPoolConfig.class.getName()));
}
 
开发者ID:feedzai,项目名称:fos-weka,代码行数:10,代码来源:WekaModelConfig.java


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