本文整理汇总了Java中org.kuali.rice.core.api.config.property.ConfigContext.isInitialized方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigContext.isInitialized方法的具体用法?Java ConfigContext.isInitialized怎么用?Java ConfigContext.isInitialized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.core.api.config.property.ConfigContext
的用法示例。
在下文中一共展示了ConfigContext.isInitialized方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadFromConfiguration
import org.kuali.rice.core.api.config.property.ConfigContext; //导入方法依赖的package包/类
protected <T> T loadFromConfiguration(Class<T> objectClass, String objectKey, String jndiKey) {
if (!ConfigContext.isInitialized()) {
throw new IllegalStateException("Configuration system has not been initialized, so cannot load JTA "
+ "configuration. Please ensure the Configuration system is initalized first.");
}
T configured = (T)ConfigContext.getCurrentContextConfig().getObject(objectKey);
if (configured == null) {
String jndiName = ConfigContext.getCurrentContextConfig().getProperty(jndiKey);
if (StringUtils.isNotEmpty(jndiName)) {
if (this.jndiTemplate == null) {
this.jndiTemplate = new JndiTemplate();
}
try {
configured = (T)this.jndiTemplate.lookup(jndiName, objectClass);
} catch (NamingException e) {
throw new ConfigurationException("Could not locate the " + objectClass.getSimpleName() + " at the given JNDI location: '" + jndiName + "'", e);
}
}
}
return configured;
}
示例2: validateConfigurerState
import org.kuali.rice.core.api.config.property.ConfigContext; //导入方法依赖的package包/类
@Override
public final void validateConfigurerState() {
if (StringUtils.isBlank(this.moduleName)) {
throw new IllegalStateException("the module name for this module has not been set");
}
if (CollectionUtils.isEmpty(this.validRunModes)) {
throw new IllegalStateException("the valid run modes for this module has not been set");
}
// ConfigContext must be initialized...
if (!ConfigContext.isInitialized()) {
throw new ConfigurationException("ConfigContext has not yet been initialized, please initialize prior to using.");
}
validateRunMode();
doAdditonalConfigurerValidations();
}
示例3: tearDown
import org.kuali.rice.core.api.config.property.ConfigContext; //导入方法依赖的package包/类
@After
public void tearDown() {
if (context != null) {
context.destroy();
}
if (ConfigContext.isInitialized()) {
ConfigContext.destroy();
}
Jta.reset();
if (this.builder != null) {
this.builder.clear();
}
}