net.sf.ehcache.config.Configuration.name()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中net.sf.ehcache.config.Configuration.name()方法的一些代码示例,展示了Configuration.name()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.name()方法的具体详情如下:
包路径:net.sf.ehcache.config.Configuration
类名称:Configuration
方法名:name

Configuration.name介绍

[英]Builder to set the cache manager name.

Cache manager names have constraints on the characters they can use:

  • cache managers that are registered as MBeans must obey the javax.management.ObjectName rules for unquoted value. This means the following characters are illegal: ',', '=', ':', '"', '*' and '?'.
    Note that a clustered cache manager is by default registered as MBean.
    [中]生成器来设置缓存管理器名称。
    缓存管理器名称对其可以使用的字符有限制:
    注册为MBean的缓存管理器必须遵守javax。经营不带引号的值的ObjectName规则。这意味着以下字符是非法的:“、”、“=”、“:”、“”、“”和“?”。
    请注意,集群缓存管理器默认注册为MBean。

代码示例

代码示例来源: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() ) ) );

相关文章

Configuration类方法