本文整理汇总了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);
}
示例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));
}
示例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));
}
示例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);
}
示例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()));
}