本文整理了Java中net.sf.ehcache.config.Configuration.name()
方法的一些代码示例,展示了Configuration.name()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.name()
方法的具体详情如下:
包路径:net.sf.ehcache.config.Configuration
类名称:Configuration
方法名:name
[英]Builder to set the cache manager name.
Cache manager names have constraints on the characters they can use:
代码示例来源:origin: gocd/gocd
@Bean(name = "goCache")
public GoCache createCache() {
CacheManager cacheManager = CacheManager.newInstance(new Configuration().name(getClass().getName()));
Cache cache = new Cache(cacheConfiguration);
cacheManager.addCache(cache);
return new GoCache(cache, transactionSynchronizationManager);
}
代码示例来源:origin: gocd/gocd
private static Ehcache createCacheIfRequired() {
final CacheManager instance = CacheManager.newInstance(new Configuration().name(CachingSubjectDnX509PrincipalExtractor.class.getName()));
synchronized (instance) {
if (!instance.cacheExists(CACHE_NAME)) {
instance.addCache(new Cache(cacheConfiguration()));
}
return instance.getCache(CACHE_NAME);
}
}
代码示例来源:origin: gocd/gocd
private static Ehcache createCacheIfRequired(String cacheName) {
final CacheManager instance = CacheManager.newInstance(new Configuration().name(cacheName));
synchronized (instance) {
if (!instance.cacheExists(cacheName)) {
instance.addCache(new net.sf.ehcache.Cache(cacheConfiguration(cacheName)));
}
return instance.getCache(cacheName);
}
}
代码示例来源:origin: gocd/gocd
private static Ehcache createCacheIfRequired(String cacheName) {
final CacheManager instance = CacheManager.newInstance(new Configuration().name(cacheName));
synchronized (instance) {
if (!instance.cacheExists(cacheName)) {
instance.addCache(new Cache(cacheConfiguration(cacheName)));
}
return instance.getCache(cacheName);
}
}
代码示例来源:origin: spring-projects/spring-framework
@Before
public void setup() {
cacheManager = new CacheManager(new Configuration().name("EhCacheCacheTests")
.defaultCache(new CacheConfiguration("default", 100)));
nativeCache = new net.sf.ehcache.Cache(new CacheConfiguration(CACHE_NAME, 100));
cacheManager.addCache(nativeCache);
cache = new EhCacheCache(nativeCache);
}
代码示例来源:origin: spring-projects/spring-framework
@Before
public void setup() {
nativeCacheManager = new CacheManager(new Configuration().name("EhCacheCacheManagerTests")
.defaultCache(new CacheConfiguration("default", 100)));
addNativeCache(CACHE_NAME);
cacheManager = new EhCacheCacheManager(nativeCacheManager);
cacheManager.setTransactionAware(false);
cacheManager.afterPropertiesSet();
transactionalCacheManager = new EhCacheCacheManager(nativeCacheManager);
transactionalCacheManager.setTransactionAware(true);
transactionalCacheManager.afterPropertiesSet();
}
代码示例来源:origin: com.atlassian.jira/jira-core
@Override
public Configuration newConfiguration(@Nonnull final URL baseXmlConfiguration, @Nonnull final ClusterNodeProperties clusterNodeProperties)
{
notNull(baseXmlConfiguration, "baseXmlConfiguration");
notNull(clusterNodeProperties, "clusterNodeProperties");
FactoryConfiguration peerListenerFactory = buildPeerListenerFactory(clusterNodeProperties);
FactoryConfiguration peerProviderFactory = buildPeerProviderFactory(clusterNodeProperties);
return ConfigurationFactory.parseConfiguration(baseXmlConfiguration)
.name(MANAGER_NAME)
.cacheManagerPeerProviderFactory(peerProviderFactory)
.cacheManagerPeerListenerFactory(peerListenerFactory);
}
代码示例来源:origin: fr.inria.eventcloud/eventcloud-core
private CacheManager createCacheManager(String diskStorePath) {
Configuration cacheManagerConfig =
new Configuration().dynamicConfig(false)
.diskStore(
new DiskStoreConfiguration().path(diskStorePath))
.name("default")
.updateCheck(false);
return CacheManager.create(cacheManagerConfig);
}
代码示例来源:origin: org.apache.archiva.redback.components.cache/spring-cache-ehcache
this.cacheManager = new CacheManager( new Configuration().name( getName() ).diskStore(
new DiskStoreConfiguration().path( getDiskStorePath() ) ) );
内容来源于网络,如有侵权,请联系作者删除!