本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例6: getConfiguredValue
import org.apache.deltaspike.core.api.config.ConfigResolver; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected String getConfiguredValue(String key)
{
return ConfigResolver.getProjectStageAwarePropertyValue(key);
}