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


Java ConfigResolver.getProjectStageAwarePropertyValue方法代码示例

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


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

示例1: evaluateExpression

import org.apache.deltaspike.core.api.config.ConfigResolver; //导入方法依赖的package包/类
private String evaluateExpression(Scheduled scheduled)
{
    String expression = scheduled.cronExpression();

    if (expression.startsWith("{") && expression.endsWith("}"))
    {
        String configKey = expression.substring(1, expression.length() - 1);
        expression = ConfigResolver.getProjectStageAwarePropertyValue(configKey, null);

        if (expression == null)
        {
            throw new IllegalStateException("No config-value found for config-key: " + configKey);
        }
    }
    return expression;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:17,代码来源:AbstractQuartzScheduler.java

示例2: getPropertyValue

import org.apache.deltaspike.core.api.config.ConfigResolver; //导入方法依赖的package包/类
/**
 * @param propertyName the name of the property key
 * @param defaultValue the default value to return if no configured property is found or
 *                     {@link ConfigProperty#NULL} if no default value should be returned.
 * @return the configured value or the defaultValue according to the NULL logic.
 */
protected String getPropertyValue(String propertyName, String defaultValue)
{
    String configuredValue;
    if (ConfigProperty.NULL.equals(defaultValue))
    {
        // no special defaultValue has been configured
        configuredValue = ConfigResolver.getProjectStageAwarePropertyValue(propertyName);
    }
    else
    {
        configuredValue = ConfigResolver.getProjectStageAwarePropertyValue(propertyName, defaultValue);
    }
    return configuredValue;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:21,代码来源:BaseConfigPropertyProducer.java

示例3: testProjectStageAwarePropertyValueReference_1

import org.apache.deltaspike.core.api.config.ConfigResolver; //导入方法依赖的package包/类
@Test
public void testProjectStageAwarePropertyValueReference_1() {
    final String expectedFooUrl =
            "http://bar-dev/services";

    final String actualFooUrl =
            ConfigResolver.getProjectStageAwarePropertyValue(
            "foo.url");

    Assert.assertEquals(expectedFooUrl, actualFooUrl);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:12,代码来源:ConfigResolverTest.java

示例4: testProjectStageAwarePropertyValueReference_2

import org.apache.deltaspike.core.api.config.ConfigResolver; //导入方法依赖的package包/类
@Test
public void testProjectStageAwarePropertyValueReference_2() {
    final String expected =
            "projectStageAware-exampleEntry-1-is-tomato-UnitTest";

    final String projectStageAwareExampleEntry1 =
            ConfigResolver.getProjectStageAwarePropertyValue(
            "deltaspike.test.exampleEntry-2", 
            "");

    Assert.assertEquals(expected, projectStageAwareExampleEntry1);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:13,代码来源:ConfigResolverTest.java

示例5: getTestContainerConfig

import org.apache.deltaspike.core.api.config.ConfigResolver; //导入方法依赖的package包/类
public static Properties getTestContainerConfig()
{
    String cdiTestRunnerConfig = ConfigResolver.getProjectStageAwarePropertyValue(
        CUSTOM_TEST_CONTAINER_CONFIG_FILE_KEY, DEFAULT_TEST_CONTAINER_CONFIG_FILE_NAME);
    return PropertyLoader.getProperties(cdiTestRunnerConfig);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:7,代码来源:CdiTestSuiteRunner.java

示例6: getConfiguredValue

import org.apache.deltaspike.core.api.config.ConfigResolver; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected String getConfiguredValue(String key)
{
    return ConfigResolver.getProjectStageAwarePropertyValue(key);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:9,代码来源:PropertyExpressionInterpreter.java


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