本文整理汇总了Java中com.typesafe.config.ConfigUtil.joinPath方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigUtil.joinPath方法的具体用法?Java ConfigUtil.joinPath怎么用?Java ConfigUtil.joinPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.typesafe.config.ConfigUtil
的用法示例。
在下文中一共展示了ConfigUtil.joinPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPoint
import com.typesafe.config.ConfigUtil; //导入方法依赖的package包/类
/**
* This method is used to create all actual scheduler implementations.
* Change the behavior here to change whatever type of scheduler is actually
* used.
*/
private static Scheduler createPoint(String schedulerName) {
Config config = ConfigFactory.load();
// The default scheduler type to use
String schedulerType = config.getString(DEFAULT_SCHEDULER_KEY);
// Check to see whether this named throttling point is individually
// configured
String customConfigPath = ConfigUtil.joinPath(schedulerName);
if (config.getConfig(CUSTOM_SCHEDULERS_KEY).hasPath(customConfigPath)) {
schedulerType = config.getConfig(CUSTOM_SCHEDULERS_KEY).getString(customConfigPath);
}
// Get the instance and throw an exception if incorrectly configured
Scheduler instance = getSchedulerInstance(schedulerType, schedulerName);
if (instance == null) {
throw new IllegalArgumentException("Invalid throttling point type for " + schedulerName + ": " + schedulerType);
}
return instance;
}
示例2: createPoint
import com.typesafe.config.ConfigUtil; //导入方法依赖的package包/类
/**
* This method is used to create all actual throttling point
* implementations. Change the behavior here to change whatever type of
* throttling point is actually used.
*/
private static ThrottlingPoint createPoint(String throttlingPointName) {
Config config = ConfigFactory.load();
// The default throttling point type to use
String throttlingPointType = config.getString(DEFAULT_THROTTLINGPOINT_PROPERTY_KEY);
// Check to see whether this named throttling point is individually
// configured
String customConfigPath = ConfigUtil.joinPath(throttlingPointName);
if (config.getConfig(CUSTOM_THROTTLINGPOINT_KEY_PREFIX).hasPath(customConfigPath)) {
throttlingPointType = config.getConfig(CUSTOM_THROTTLINGPOINT_KEY_PREFIX).getString(customConfigPath);
}
// Get the instance and throw an exception if incorrectly configured
ThrottlingPoint instance = getThrottlingPointInstance(throttlingPointType, throttlingPointName);
if (instance == null) {
throw new IllegalArgumentException("Invalid throttling point type for " + throttlingPointName + ": " + throttlingPointType);
}
return instance;
}
示例3: createQueue
import com.typesafe.config.ConfigUtil; //导入方法依赖的package包/类
/**
* This method is used to create all actual throttling point
* implementations. Change the behavior here to change whatever type of
* throttling point is actually used.
*/
private static <T> ThrottlingQueue<T> createQueue(String throttlingQueueName) {
Config config = ConfigFactory.load();
// The default throttling point type to use
String throttlingQueueType = config.getString(DEFAULT_THROTTLINGQUEUE_PROPERTY_KEY);
// Check to see whether this named throttling point is individually
// configured
String customConfigPath = ConfigUtil.joinPath(throttlingQueueName);
if (config.getConfig(CUSTOM_THROTTLINGQUEUE_KEY_PREFIX).hasPath(customConfigPath)) {
throttlingQueueType = config.getConfig(CUSTOM_THROTTLINGQUEUE_KEY_PREFIX).getString(customConfigPath);
}
// Get the instance and throw an exception if incorrectly configured
ThrottlingQueue<T> instance = getThrottlingQueueInstance(throttlingQueueType, throttlingQueueName);
if (instance == null) {
throw new IllegalArgumentException("Invalid throttling queue type for " + throttlingQueueName + ": " + throttlingQueueType);
}
return instance;
}
示例4: configPath
import com.typesafe.config.ConfigUtil; //导入方法依赖的package包/类
static String configPath(final String name, final String... names) {
checkArgument(StringUtils.isNotBlank(name));
if (ArrayUtils.isNotEmpty(names)) {
return ConfigUtil.joinPath(ImmutableList.<String>builder().add(name).add(names).build());
}
return name;
}