Package net.sf.ehcache

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


    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

    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

    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

    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

     * @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

    /**
     * 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

      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

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.