Package org.infinispan.commons

Examples of org.infinispan.commons.CacheConfigurationException


   @Override
   public void validate() {
      if (enabled) {
         if (!clustering().cacheMode().isDistributed())
            throw new CacheConfigurationException("Enabling the L1 cache is only supported when using DISTRIBUTED as a cache mode.  Your cache mode is set to " + clustering().cacheMode().friendlyCacheModeString());

         if (lifespan < 1)
            throw new CacheConfigurationException("Using a L1 lifespan of 0 or a negative value is meaningless");

      }
   }
View Full Code Here


   }

   @Override
   public void validate(GlobalConfiguration globalConfig) {
      if (globalConfig.transport().transport() == null) {
         throw new CacheConfigurationException("Must have a transport set in the global configuration in " +
               "order to configure a singleton store");
      }
   }
View Full Code Here

      if (!strategy.isEnabled() && getBuilder().persistence().passivation())
         log.passivationWithoutEviction();
      if(strategy == EvictionStrategy.FIFO)
         log.warnFifoStrategyIsDeprecated();
      if (strategy.isEnabled() && maxEntries <= 0)
         throw new CacheConfigurationException("Eviction maxEntries value cannot be less than or equal to zero if eviction is enabled");
      if (maxEntries > 0 && !strategy.isEnabled()) {
         strategy = EvictionStrategy.LIRS;
         log.debugf("Max entries configured (%d) without eviction strategy. Eviction strategy overriden to %s", maxEntries, strategy);
      }
   }
View Full Code Here

   @Override
   public
   void validate() {
      if (useReplicationQueue && getClusteringBuilder().cacheMode().isDistributed())
         throw new CacheConfigurationException("Use of the replication queue is invalid when using DISTRIBUTED mode.");

      if (useReplicationQueue && getClusteringBuilder().cacheMode().isSynchronous())
         throw new CacheConfigurationException("Use of the replication queue is only allowed with an ASYNCHRONOUS cluster mode.");
   }
View Full Code Here

         Constructor<T> constructor = klass.getDeclaredConstructor(GlobalConfigurationBuilder.class);
         T builder = constructor.newInstance(this);
         this.modules.add(builder);
         return builder;
      } catch (Exception e) {
         throw new CacheConfigurationException("Could not instantiate module configuration builder '" + klass.getName() + "'", e);
      }
   }
View Full Code Here

         Constructor<T> constructor = klass.getDeclaredConstructor(ConfigurationBuilder.class);
         T builder = constructor.newInstance(this);
         this.modules.add(builder);
         return builder;
      } catch (Exception e) {
         throw new CacheConfigurationException("Could not instantiate module configuration builder '" + klass.getName() + "'", e);
      }
   }
View Full Code Here

    */
   public static <T> Class<T> loadClass(String classname, ClassLoader cl) {
      try {
         return loadClassStrict(classname, cl);
      } catch (ClassNotFoundException e) {
         throw new CacheConfigurationException("Unable to instantiate class " + classname, e);
      }
   }
View Full Code Here

    */
   public static <T> T getInstance(Class<T> clazz) {
      try {
         return getInstanceStrict(clazz);
      } catch (IllegalAccessException iae) {
         throw new CacheConfigurationException("Unable to instantiate class " + clazz.getName(), iae);
      } catch (InstantiationException ie) {
         throw new CacheConfigurationException("Unable to instantiate class " + clazz.getName(), ie);
      }
   }
View Full Code Here

    */
   @SuppressWarnings("unchecked")
   public static <B> Class<? extends Builder<B>> builderFor(B built) throws CacheConfigurationException {
      BuiltBy builtBy = built.getClass().getAnnotation(BuiltBy.class);
      if (builtBy == null) {
         throw new CacheConfigurationException("Missing BuiltBy annotation for configuration bean " + built.getClass().getName());
      }
      return (Class<? extends Builder<B>>) builtBy.value();
   }
View Full Code Here

    */
   public static <T> Class<T> loadClass(String classname, ClassLoader cl) {
      try {
         return loadClassStrict(classname, cl);
      } catch (ClassNotFoundException e) {
         throw new CacheConfigurationException("Unable to instantiate class " + classname, e);
      }
   }
View Full Code Here

TOP

Related Classes of org.infinispan.commons.CacheConfigurationException

Copyright © 2018 www.massapicom. 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.