本文整理汇总了Java中org.hibernate.util.ConfigHelper类的典型用法代码示例。如果您正苦于以下问题:Java ConfigHelper类的具体用法?Java ConfigHelper怎么用?Java ConfigHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigHelper类属于org.hibernate.util包,在下文中一共展示了ConfigHelper类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadResource
import org.hibernate.util.ConfigHelper; //导入依赖的package包/类
private URL loadResource(String configurationResourceName) {
URL url = ConfigHelper.locateConfig( configurationResourceName );
if (log.isDebugEnabled()) {
log.debug("Creating EhCacheProvider from a specified resource: "
+ configurationResourceName + " Resolved to URL: " + url);
}
return url;
}
示例2: getEhCacheConfigurationFileName
import org.hibernate.util.ConfigHelper; //导入依赖的package包/类
@Override
public String getEhCacheConfigurationFileName() {
return ConfigHelper.findAsResource(this.ehCacheConfigurationFileName)
.toExternalForm();
}
示例3: loadInstance
import org.hibernate.util.ConfigHelper; //导入依赖的package包/类
public HazelcastInstance loadInstance() throws CacheException {
if (instance != null && instance.getLifecycleService().isRunning()) {
logger.log(Level.WARNING, "Current HazelcastInstance is already loaded and running! " +
"Returning current instance...");
return instance;
}
String configResourcePath = null;
if (props != null) {
instanceName = CacheEnvironment.getInstanceName(props);
useLiteMember = CacheEnvironment.isLiteMember(props);
if (!useLiteMember && props.contains(CacheEnvironment.USE_SUPER_CLIENT)) {
useLiteMember = CacheEnvironment.isSuperClient(props);
logger.log(Level.WARNING, "'" + CacheEnvironment.USE_SUPER_CLIENT + "' property is deprecated!" +
" Please use '" + CacheEnvironment.USE_LITE_MEMBER + "' instead...");
}
configResourcePath = CacheEnvironment.getConfigFilePath(props);
}
if (useLiteMember) {
logger.log(Level.WARNING,
"Creating Hazelcast node as Lite-Member. "
+ "Be sure this node has access to an already running cluster...");
}
if (StringHelper.isEmpty(configResourcePath)) {
// If both useLiteMember and instanceName is not set
// then just use default instance.
if (!useLiteMember && instanceName == null) {
staticInstance = true;
}
} else {
URL url = ConfigHelper.locateConfig(configResourcePath);
try {
config = new UrlXmlConfig(url);
} catch (IOException e) {
throw new CacheException(e);
}
}
if (instanceName != null) {
instance = Hazelcast.getHazelcastInstanceByName(instanceName);
if (instance == null) {
try {
createOrGetInstance();
} catch (DuplicateInstanceNameException ignored) {
instance = Hazelcast.getHazelcastInstanceByName(instanceName);
}
}
} else {
createOrGetInstance();
}
return instance;
}
示例4: getConfigurationInputStream
import org.hibernate.util.ConfigHelper; //导入依赖的package包/类
/**
* Get the configuration file as an <tt>InputStream</tt>. Might be overridden
* by subclasses to allow the configuration to be located by some arbitrary
* mechanism.
*/
protected InputStream getConfigurationInputStream(String resource) throws HibernateException {
log.info( "Configuration resource: " + resource );
return ConfigHelper.getResourceAsStream( resource );
}