net.sf.ehcache.Cache.getCacheEventNotificationService()方法的使用及代码示例

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

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

Cache.getCacheEventNotificationService介绍

[英]Use this to access the service in order to register and unregister listeners
[中]使用此选项访问服务,以便注册和注销侦听器

代码示例

代码示例来源:origin: net.sf.ehcache/ehcache

RegisteredEventListeners listeners = getCacheEventNotificationService();
registerCacheListeners(configuration, listeners, loader);
registerCacheExtensions(configuration, this, loader);

代码示例来源:origin: net.sf.ehcache/ehcache

RegisteredEventListeners registeredEventListenersFromOriginal = original.getCacheEventNotificationService();
if (registeredEventListenersFromOriginal == null || registeredEventListenersFromOriginal.getCacheEventListeners().size() == 0) {
  registeredEventListeners = new RegisteredEventListeners(this);

代码示例来源:origin: net.oschina.j2cache/j2cache-core

/**
 * Creates a new EhCache instance
 *
 * @param cache The underlying EhCache instance to use.
 * @param listener cache listener
 */
public EhCache(Cache cache, CacheExpiredListener listener) {
  this.cache = cache;
  this.cache.getCacheEventNotificationService().registerListener(this);
  this.listener = listener;
}

代码示例来源:origin: yangfuhai/jboot

public Cache getOrAddCache(String cacheName) {
  Cache cache = cacheManager.getCache(cacheName);
  if (cache == null) {
    synchronized (locker) {
      cache = cacheManager.getCache(cacheName);
      if (cache == null) {
        log.warn("Could not find cache config [" + cacheName + "], using default.");
        cacheManager.addCacheIfAbsent(cacheName);
        cache = cacheManager.getCache(cacheName);
        if (cacheEventListener != null) {
          cache.getCacheEventNotificationService().registerListener(cacheEventListener);
        }
      }
    }
  }
  return cache;
}

代码示例来源:origin: lutece-platform/lutece-core

/**
 * Create a cache
 * 
 * @param strCacheName
 *            The cache name
 */
private void createCache( String strCacheName )
{
  _cache = CacheService.getInstance( ).createCache( strCacheName );
  _cache.getCacheEventNotificationService( ).registerListener( this );
}

代码示例来源:origin: net.jradius/jradius-core

public void afterPropertiesSet() throws Exception
{
  if ((sessionCache == null || logCache == null) && cacheManager == null) 
  {
    throw new RuntimeException("cacheManager required");
  }
  if (sessionCache == null) 
  {
    sessionCache = cacheManager.getCache(cacheName);
    if (sessionCache == null)
    {
      sessionCache = new Cache(cacheName, 1000, true, false, maxInactiveInterval, maxInactiveInterval);
      cacheManager.addCache(sessionCache);
    }
  }
  if (logCache == null) 
  {
    logCache = cacheManager.getCache(logCacheName);
    if (logCache == null)
    {
      logCache = new Cache(logCacheName, 100, true, false, maxInactiveInterval, maxInactiveInterval);
      cacheManager.addCache(logCache);
    }
  }
  sessionCache.getCacheEventNotificationService().registerListener(this);
  logCache.getCacheEventNotificationService().registerListener(this);
}

代码示例来源:origin: coova/jradius

public void afterPropertiesSet() throws Exception
{
  if ((sessionCache == null || logCache == null) && cacheManager == null) 
  {
    throw new RuntimeException("cacheManager required");
  }
  if (sessionCache == null) 
  {
    sessionCache = cacheManager.getCache(cacheName);
    if (sessionCache == null)
    {
      sessionCache = new Cache(cacheName, 1000, true, false, maxInactiveInterval, maxInactiveInterval);
      cacheManager.addCache(sessionCache);
    }
  }
  if (logCache == null) 
  {
    logCache = cacheManager.getCache(logCacheName);
    if (logCache == null)
    {
      logCache = new Cache(logCacheName, 100, true, false, maxInactiveInterval, maxInactiveInterval);
      cacheManager.addCache(logCache);
    }
  }
  sessionCache.getCacheEventNotificationService().registerListener(this);
  logCache.getCacheEventNotificationService().registerListener(this);
}

代码示例来源:origin: org.openl.rules/org.openl.rules.ruleservice

private CompiledOpenClassCache() {
  OpenLEhCacheHolder.getInstance().getModulesCache().getCacheEventNotificationService().registerListener(
    new CacheEventListenerAdapter() {
      @Override

代码示例来源:origin: openl-tablets/openl-tablets

private CompiledOpenClassCache() {
  OpenLEhCacheHolder.getInstance().getModulesCache().getCacheEventNotificationService().registerListener(
    new CacheEventListenerAdapter() {
      @Override

代码示例来源:origin: com.github.tianjing/tgtools.core

public MessageEhcacheStore() {
  if (null == CacheFactory.get("MessageCache")) {
    Cache cache = new Cache("MessageCache", 100000, false, true, 0, 0);
    CacheFactory.create(cache);
  }
  m_Cache = CacheFactory.get("MessageCache");
  m_Cache.getCacheEventNotificationService().registerListener(new MyCacheEventListener(m_Keys));
}

代码示例来源:origin: sakaiproject/sakai

/**
 * Create a raw Cache object based on the configuration of this FactoryBean.
 */
protected Cache createCache() {
  // Only call EHCache 1.6 constructor if actually necessary (for compatibility with EHCache 1.3+)
  Cache cache = (!this.clearOnFlush) ?
      new Cache(this.cacheName, this.maxElementsInMemory, this.memoryStoreEvictionPolicy,
          this.overflowToDisk, null, this.eternal, this.timeToLive, this.timeToIdle,
          this.diskPersistent, this.diskExpiryThreadIntervalSeconds, null,
          this.bootstrapCacheLoader, this.maxElementsOnDisk, this.diskSpoolBufferSize,
          this.clearOnFlush) :
      new Cache(this.cacheName, this.maxElementsInMemory, this.memoryStoreEvictionPolicy,
          this.overflowToDisk, null, this.eternal, this.timeToLive, this.timeToIdle,
          this.diskPersistent, this.diskExpiryThreadIntervalSeconds, null,
          this.bootstrapCacheLoader, this.maxElementsOnDisk, this.diskSpoolBufferSize);
  if (this.cacheEventListeners != null) {
    for (CacheEventListener listener : this.cacheEventListeners) {
      cache.getCacheEventNotificationService().registerListener(listener);
    }
  }
  if (this.disabled) {
    cache.setDisabled(true);
  }
  net.sf.ehcache.config.CacheConfiguration config = cache.getCacheConfiguration();
  config.setMaxEntriesLocalHeap(maxElementsInMemory);
  return cache;
}

代码示例来源:origin: datasalt/splout-db

dbCache.getCacheEventNotificationService().registerListener(new CacheListener());

代码示例来源:origin: apache/oozie

if (exists == null) {
  cacheManager.addCache(missingCache);
  missingCache.getCacheEventNotificationService().registerListener(this);

代码示例来源:origin: org.apache.oozie/oozie-core

if (exists == null) {
  cacheManager.addCache(missingCache);
  missingCache.getCacheEventNotificationService().registerListener(this);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

RegisteredEventListeners registeredEventListenersFromCopy = copy.getCacheEventNotificationService();
if (registeredEventListenersFromCopy == null || registeredEventListenersFromCopy.getCacheEventListeners().size() == 0) {
  copy.registeredEventListeners = new RegisteredEventListeners(copy);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

sampledCacheStatistics = new SampledCacheStatisticsWrapper();
RegisteredEventListeners listeners = getCacheEventNotificationService();
registerCacheListeners(configuration, listeners);
registerCacheExtensions(configuration, this);

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

RegisteredEventListeners listeners = getCacheEventNotificationService();
registerCacheListeners(configuration, listeners, loader);
registerCacheExtensions(configuration, this, loader);

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

RegisteredEventListeners listeners = getCacheEventNotificationService();
registerCacheListeners(configuration, listeners, loader);
registerCacheExtensions(configuration, this, loader);

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

RegisteredEventListeners registeredEventListenersFromOriginal = original.getCacheEventNotificationService();
if (registeredEventListenersFromOriginal == null || registeredEventListenersFromOriginal.getCacheEventListeners().size() == 0) {
  registeredEventListeners = new RegisteredEventListeners(this);

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

RegisteredEventListeners registeredEventListenersFromOriginal = original.getCacheEventNotificationService();
if (registeredEventListenersFromOriginal == null || registeredEventListenersFromOriginal.getCacheEventListeners().size() == 0) {
  registeredEventListeners = new RegisteredEventListeners(this);

相关文章

Cache类方法