Package org.infinispan.commons

Examples of org.infinispan.commons.CacheConfigurationException


   }

   @Override
   public void validate() {
      if (jndiUrl == null) {
         throw new CacheConfigurationException("The jndiUrl has not been specified");
      }
   }
View Full Code Here


         Constructor<C> constructor = klass.getDeclaredConstructor(AbstractJdbcStoreConfigurationBuilder.class);
         C builder = constructor.newInstance(this);
         this.connectionFactory = (ConnectionFactoryConfigurationBuilder<ConnectionFactoryConfiguration>) builder;
         return builder;
      } catch (Exception e) {
         throw new CacheConfigurationException("Could not instantiate loader configuration builder '" + klass.getName() + "'", e);
      }
   }
View Full Code Here

   }

   @Override
   public void validate() {
      if (connectionUrl == null) {
         throw new CacheConfigurationException("A connectionUrl has not been specified");
      }
   }
View Full Code Here

   }

   @Override
   public boolean startBatch() {
      if (!config.invocationBatching().enabled()) {
         throw new CacheConfigurationException("Invocation batching not enabled in current configuration! Please enable it.");
      }
      return batchContainer.startBatch();
   }
View Full Code Here

   }

   @Override
   public void endBatch(boolean successful) {
      if (!config.invocationBatching().enabled()) {
         throw new CacheConfigurationException("Invocation batching not enabled in current configuration! Please enable it.");
      }
      batchContainer.endBatch(successful);
   }
View Full Code Here

         parse(is, holder);
         return holder;
      } catch (CacheConfigurationException e) {
         throw e;
      } catch (Exception e) {
         throw new CacheConfigurationException(e);
      }
   }
View Full Code Here

         globalComponentRegistry = new GlobalComponentRegistry(globalConfiguration, this, caches.keySet());
         authzHelper = new AuthorizationHelper(globalConfiguration.security(), AuditContext.CACHEMANAGER, globalConfiguration.globalJmxStatistics().cacheManagerName());
      } catch (CacheConfigurationException ce) {
         throw ce;
      } catch (RuntimeException re) {
         throw new CacheConfigurationException(re);
      }
      if (start)
         start();
   }
View Full Code Here

         properties.load(is);
         is.close();
      }
      catch (IOException e) {
         log.errorReadingProperties(e);
         throw new CacheConfigurationException("Exception occured while reading properties from XML document", e);
      }
      return properties;
   }
View Full Code Here

            // this is ok, but certainly log this as a warning
            // this is hugely noisy!
            //if (log.isWarnEnabled()) log.warn("Unrecognised attribute " + propName + ".  Please check your configuration.  Ignoring!!");
         }
         catch (Exception e) {
            throw new CacheConfigurationException("Unable to invoke setter " + setter + " on " + objectClass, e);
         }

         boolean setterFound = false;
         // if we get here, we could not find a String or Element setter.
         for (Method m : objectClass.getMethods()) {
            if (setter.equals(m.getName()) || fluentSetter.equals(m.getName())) {
               Class<?> paramTypes[] = m.getParameterTypes();
               if (paramTypes.length != 1) {
                  log.tracef("Rejecting setter %s on class %s due to incorrect number of parameters", m, objectClass);
                  continue; // try another param with the same name.
               }

               Class<?> parameterType = paramTypes[0];
               PropertyEditor editor = PropertyEditorManager.findEditor(parameterType);
               if (editor == null) {
                  throw new CacheConfigurationException("Couldn't find a property editor for parameter type " + parameterType);
               }

               editor.setAsText((String) attribs.get(propName));

               Object parameter = editor.getValue();
               //if (log.isDebugEnabled()) log.debug("Invoking setter method: " + setter + " with parameter \"" + parameter + "\" of type " + parameter.getClass());

               try {
                  m.invoke(target, parameter);
                  setterFound = true;
                  break;
               }
               catch (Exception e) {
                  throw new CacheConfigurationException("Unable to invoke setter " + setter + " on " + objectClass, e);
               }
            }
         }
         // Skip hot rod properties ...
         if (!setterFound && !propName.startsWith("infinispan.client.hotrod"))
            if (failOnMissingSetter) {
               throw new CacheConfigurationException("Couldn't find a setter named [" + setter + "] which takes a single parameter, for parameter " + propName + " on class [" + objectClass + "]");
            } else {
               ignoredAttribs.put(propName, attribs.get(propName));
            }
      }
      return ignoredAttribs;
View Full Code Here

   public void validate() {
      //if both remote cache and remote site are not specified then this is not a backup
      if (remoteCache == null && remoteSite == null)
         return;
      if (remoteSite == null || remoteCache == null) {
         throw new CacheConfigurationException("Both 'remoteCache' and 'remoteSite' must be specified for a backup'!");
      }
   }
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.