Examples of cacheExists()


Examples of net.sf.ehcache.CacheManager.cacheExists()

  }

  public void remove() {
    setClassLoader();
    CacheManager singletonManager = CacheManager.getInstance();
    if(singletonManager.cacheExists(cacheName))
      singletonManager.removeCache(cacheName);
   
  }

 
View Full Code Here

Examples of net.sf.ehcache.CacheManager.cacheExists()

    try
    {
      CacheManager manager = getCacheManager();
      synchronized(manager)
      {
        if (manager.cacheExists("liblayout-data") == false)
        {
          manager.addCache("liblayout-data");
        }
        return new EHResourceDataCache(manager.getCache("liblayout-data"));
      }
View Full Code Here

Examples of net.sf.ehcache.CacheManager.cacheExists()

    try
    {
      CacheManager manager = getCacheManager();
      synchronized(manager)
      {
        if (manager.cacheExists("liblayout-factory") == false)
        {
          manager.addCache("liblayout-factory");
        }
        return new EHResourceFactoryCache(manager.getCache("liblayout-factory"));
      }
View Full Code Here

Examples of net.sf.ehcache.CacheManager.cacheExists()

    try
    {
      final CacheManager manager = getCacheManager();
      synchronized(manager)
      {
        if (manager.cacheExists("liblayout-data") == false)
        {
          manager.addCache("liblayout-data");
        }
        return new EHResourceDataCache(manager.getCache("liblayout-data"));
      }
View Full Code Here

Examples of net.sf.ehcache.CacheManager.cacheExists()

    try
    {
      final CacheManager manager = getCacheManager();
      synchronized(manager)
      {
        if (manager.cacheExists("liblayout-factory") == false)
        {
          manager.addCache("liblayout-factory");
        }
        return new EHResourceFactoryCache(manager.getCache("liblayout-factory"));
      }
View Full Code Here

Examples of net.sf.ehcache.CacheManager.cacheExists()

     * @return {@link Cache}
     */
    public Ehcache initializeCache() {
        CacheManager cacheManager = getCacheManagerFactory().getInstance();
        Ehcache cache;
        if (cacheManager.cacheExists(config.getCacheName())) {
            if (LOG.isTraceEnabled()) {
                LOG.trace("Found an existing cache: {}", config.getCacheName());
                LOG.trace("Cache {} currently contains {} elements",
                        config.getCacheName(),
                        cacheManager.getEhcache(config.getCacheName()).getSize());
View Full Code Here

Examples of net.sf.ehcache.CacheManager.cacheExists()

    /**
     * Ininitialize cache
     */
    private void initializeCache() {
        CacheManager cacheManager = CacheManager.create();
        if (!cacheManager.cacheExists(DEFAULT_CACHENAME)) {
            cacheManager.addCache(DEFAULT_CACHENAME);
        }
        cache = cacheManager.getCache(DEFAULT_CACHENAME);
        LOG.debug("CacheManager initialized as '{}'", cache.getName());
    }
View Full Code Here

Examples of net.sf.ehcache.CacheManager.cacheExists()

      stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(cacheConfigurationPath);
      cacheManager = stream == null ? CacheManager.create() : CacheManager.create(stream);
    }

    if(!cacheManager.cacheExists(DANDELION_CACHE_NAME)){
      cacheManager.addCache(DANDELION_CACHE_NAME);
      LOG.debug("Added cache called '{}' to the cache manager", DANDELION_CACHE_NAME);
    }
    cache = cacheManager.getCache(DANDELION_CACHE_NAME);
  }
View Full Code Here

Examples of org.dozer.cache.DozerCacheManager.cacheExists()

    String cacheName = getRandomString();
    cacheMgr.addCache(cacheName, 1);
    cacheMgr2.addCache(cacheName, 1);

    assertTrue("cache should exist in cache mgr1", cacheMgr.cacheExists(cacheName));
    assertTrue("cache should also exist in cache mgr2", cacheMgr2.cacheExists(cacheName));

    Cache cache1 = cacheMgr.getCache(cacheName);
    Cache cache2 = cacheMgr2.getCache(cacheName);

    assertFalse("caches should not be the same instance", cache1 == cache2);
View Full Code Here

Examples of org.dozer.cache.DozerCacheManager.cacheExists()

    String cacheName = getRandomString();
    cacheMgr.addCache(cacheName, 1);
    cacheMgr2.addCache(cacheName, 1);

    assertTrue("cache should exist in cache mgr1", cacheMgr.cacheExists(cacheName));
    assertTrue("cache should also exist in cache mgr2", cacheMgr2.cacheExists(cacheName));

    Cache cache1 = cacheMgr.getCache(cacheName);
    Cache cache2 = cacheMgr2.getCache(cacheName);

    assertFalse("caches should not be the same instance", cache1 == cache2);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.