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


Java ConfigUtil.joinPath方法代码示例

本文整理汇总了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;
}
 
开发者ID:brownsys,项目名称:tracing-framework,代码行数:26,代码来源:RetroSchedulers.java

示例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;
}
 
开发者ID:brownsys,项目名称:tracing-framework,代码行数:26,代码来源:LocalThrottlingPoints.java

示例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;
}
 
开发者ID:brownsys,项目名称:tracing-framework,代码行数:26,代码来源:LocalThrottlingPoints.java

示例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;
}
 
开发者ID:runrightfast,项目名称:runrightfast-vertx,代码行数:8,代码来源:ConfigUtils.java


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