Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1777

Add LoadersConfigurationBuilder.clearCacheLoaders() method

    XMLWordPrintable

Details

    Description

      The use case for this is defining a cache for web session replication for a single application. The cache needs a unique file cache store location. The only way to modify the location is by copy each sub-builder except the loaders builder, and copying the loader properties manually. The ability to clear cache loaders of a builder would simplify this greatly.
      e.g.
      I could replace:

      ConfigurationBuilder builder = new ConfigurationBuilder().name(config.name());
      // Copy everything except loaders
      builder.clustering().read(config.clustering())
      .customInterceptors().read(config.customInterceptors())
      .dataContainer().read(config.dataContainer())
      .deadlockDetection().read(config.deadlockDetection())
      .eviction().read(config.eviction())
      .expiration().read(config.expiration())
      .indexing().read(config.indexing())
      .invocationBatching().read(config.invocationBatching())
      .jmxStatistics().read(config.jmxStatistics())
      .locking().read(config.locking())
      .storeAsBinary().read(config.storeAsBinary())
      .transaction().read(config.transaction())
      .versioning().read(config.versioning())
      ;
      if (!config.loaders().cacheLoaders().isEmpty()) {
      builder.loaders().clearCacheLoaders();
      // Our cache needs a unique passivation location
      for (AbstractLoaderConfiguration loader: config.loaders().cacheLoaders())

      { this.addCacheLoader(builder.loaders(), loader, manager) .async().read(loader.async()) .singletonStore().read(loader.singletonStore()) ; }

      }

      with:

      ConfigurationBuilder builder = new ConfigurationBuilder().read(config);
      builder.loaders().clearCacheLoaders();
      // Our cache needs a unique passivation location
      for (AbstractLoaderConfiguration loader: config.loaders().cacheLoaders())

      { this.addCacheLoader(builder.loaders(), loader, manager) .async().read(loader.async()) .singletonStore().read(loader.singletonStore()) ; }

      Attachments

        Activity

          People

            pmuiratbleepbleep Pete Muir (Inactive)
            pferraro@redhat.com Paul Ferraro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: