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


Java ConfigHelper类代码示例

本文整理汇总了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;
  }
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:9,代码来源:EhCacheProvider.java

示例2: getEhCacheConfigurationFileName

import org.hibernate.util.ConfigHelper; //导入依赖的package包/类
@Override
   public String getEhCacheConfigurationFileName() {
return ConfigHelper.findAsResource(this.ehCacheConfigurationFileName)
	.toExternalForm();
   }
 
开发者ID:SAP,项目名称:smp_mobiliser_template,代码行数:6,代码来源:MobiliserHibernateBeans.java

示例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;
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:51,代码来源:HazelcastInstanceLoader.java

示例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 );

}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:Configuration.java


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