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


Java CacheManager.getCacheManager方法代码示例

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


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

示例1: registerCacheMBean

import net.sf.ehcache.CacheManager; //导入方法依赖的package包/类
private void registerCacheMBean() {
    CacheManager manager = CacheManager.getCacheManager(CacheManager.DEFAULT_NAME);
    MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
    ManagementService.registerMBeans(manager, mBeanServer, false, false, true, true);
}
 
开发者ID:vitaly-chibrikov,项目名称:otus_java_2017_06,代码行数:6,代码来源:DBServiceImpl.java

示例2: getCacheManager

import net.sf.ehcache.CacheManager; //导入方法依赖的package包/类
private static CacheManager getCacheManager()
{
   return CacheManager.getCacheManager(CACHE_MANAGER_NAME);
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:5,代码来源:ProcessingValve.java

示例3: afterPropertiesSet

import net.sf.ehcache.CacheManager; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet() throws IOException, CacheException {
	logger.info("Initializing EhCache CacheManager");
	InputStream is = (this.configLocation != null ? this.configLocation.getInputStream() : null);
	try {
		Configuration configuration = (is != null ?
				ConfigurationFactory.parseConfiguration(is) : ConfigurationFactory.parseConfiguration());
		if (this.cacheManagerName != null) {
			configuration.setName(this.cacheManagerName);
		}
		if (this.shared) {
			// Old-school EhCache singleton sharing...
			// No way to find out whether we actually created a new CacheManager
			// or just received an existing singleton reference.
			this.cacheManager = CacheManager.create(configuration);
		}
		else if (this.acceptExisting) {
			// EhCache 2.5+: Reusing an existing CacheManager of the same name.
			// Basically the same code as in CacheManager.getInstance(String),
			// just storing whether we're dealing with an existing instance.
			synchronized (CacheManager.class) {
				this.cacheManager = CacheManager.getCacheManager(this.cacheManagerName);
				if (this.cacheManager == null) {
					this.cacheManager = new CacheManager(configuration);
				}
				else {
					this.locallyManaged = false;
				}
			}
		}
		else {
			// Throwing an exception if a CacheManager of the same name exists already...
			this.cacheManager = new CacheManager(configuration);
		}
	}
	finally {
		if (is != null) {
			is.close();
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:42,代码来源:EhCacheManagerFactoryBean.java


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