Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-2428

In camel-cache "diskStorePath" property not efficient

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.0
    • 2.2.0
    • None
    • None

    Description

      If you want to change path to persisent cache with "diskStorePath", it has no effect because cacheManager erase this value.

      In "addCacheNoCheck" method, "setDiskStorePath" call with "diskStorePath" CacheManager property value.

      CacheManager.java
          public void addCache(Ehcache cache) throws IllegalStateException,
                  ObjectExistsException, CacheException {
              checkStatus();
              if (cache == null) {
                  return;
              }
              addCacheNoCheck(cache);
          }
      
          private void addCacheNoCheck(Ehcache cache) throws IllegalStateException,
                  ObjectExistsException, CacheException {
              if (ehcaches.get(cache.getName()) != null) {
                  throw new ObjectExistsException("Cache " + cache.getName() + " already exists");
              }
              cache.setCacheManager(this);
              cache.setDiskStorePath(diskStorePath);
              cache.initialise();
              try {
                  cache.bootstrap();
              } catch (CacheException e) {
                  LOG.log(Level.WARNING, "Cache " + cache.getName() + "requested bootstrap but a CacheException occured. " + e.getMessage(), e);
              }
              ehcaches.put(cache.getName(), cache);
              if (cache instanceof Cache) {
                  caches.put(cache.getName(), cache);
              }
      
              //Don't notify initial config. The init method of each listener should take care of this.
              if (status.equals(Status.STATUS_ALIVE)) {
                  cacheManagerEventListenerRegistry.notifyCacheAdded(cache.getName());
              }
          }
      

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            skydjol skydjol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: