Package org.jboss.cache.config

Examples of org.jboss.cache.config.ConfigurationException


   protected Element getMBeanElement(Element root)
   {
      // This is following JBoss convention.
      NodeList list = root.getElementsByTagName(XmlConfigHelper.ROOT);
      if (list == null) throw new ConfigurationException("Can't find " + XmlConfigHelper.ROOT + " tag");

      if (list.getLength() > 1) throw new ConfigurationException("Has multiple " + XmlConfigHelper.ROOT + " tag");

      Node node = list.item(0);
      Element element;
      if (node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE)
      {
         element = (Element) node;
      }
      else
      {
         throw new ConfigurationException("Can't find " + XmlConfigHelper.ROOT + " element");
      }
      return element;
   }
View Full Code Here


            String jgc = parseClusterConfigXml(entry.getValue());
            conf.setClusterConfig(jgc);
         }
         else
         {
            throw new ConfigurationException("Unknown configuration element " + propname);
         }
      }
   }
View Full Code Here

      if (existsAttribute(ignoreModifications)) iclc.setIgnoreModifications(getBoolean(ignoreModifications));
      String purgeOnStartup = getAttributeValue(indivElement, "purgeOnStartup");
      if (existsAttribute(purgeOnStartup)) iclc.setPurgeOnStartup(getBoolean(purgeOnStartup));
      String clClass = getAttributeValue(indivElement, "class");
      if (!existsAttribute(clClass))
         throw new ConfigurationException("Missing 'class'  attribute for cache loader configuration");
      iclc.setClassName(clClass);
      iclc.setProperties(XmlConfigHelper.readPropertiesContents(indivElement, "properties"));
      CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig ssc = parseSingletonStoreConfig(getSingleElementInCoreNS("singletonStore", indivElement));
      if (ssc != null)
      {
View Full Code Here

      for (int i = 0; i < nodesToPreload.getLength(); i++)
      {
         Element node = (Element) nodesToPreload.item(i);
         String fqn2preload = getAttributeValue(node, "fqn");
         if (!existsAttribute(fqn2preload))
            throw new ConfigurationException("Missing 'fqn' attribute in 'preload' element");
         if (i > 0) result.append(",");
         result.append(fqn2preload);
      }
      //no elements defined for preload so by default load the root
      if (nodesToPreload.getLength() == 0)
View Full Code Here

   }

   public void validate() throws ConfigurationException
   {
      if (evictionAlgorithmClassName == null)
         throw new ConfigurationException("Eviction algorithm class name cannot be null!");
   }
View Full Code Here

   @Override
   public void validate() throws ConfigurationException
   {
      if (maxElementsPerNode < 0)
      {
         throw new ConfigurationException("maxElementsPerNode must be must be " +
               "configured to a value greater than or equal to 0");
      }
   }
View Full Code Here

   public void validate() throws ConfigurationException
   {
      super.validate();
      if (timeToLive < -1)
      {
         throw new ConfigurationException("timeToLive must be " +
               "configured to a value greater than or equal to 0 (or -1 for unlimited time to live) for " + getEvictionAlgorithmClassName());
      }
   }
View Full Code Here

   @Override
   public void validate() throws ConfigurationException
   {
      if (getMaxNodes() < 0)
      {
         throw new ConfigurationException("maxNodes must be must be " +
               "configured to a value greater than or equal to 0");
      }
   }
View Full Code Here

      }

      public Configuration parseStream(InputStream stream, CacheMode mode)
      {
         // loop through all elements in XML.
         if (stream == null) throw new ConfigurationException("Input stream for configuration xml is null!");

         Element root = XmlConfigHelper.getDocumentRoot(stream);
         XmlConfigurationParser parser = new UnitTestXmlConfigurationParser();
         Configuration conf = parser.parseElement(root);
View Full Code Here

   private void assertNotSingletonAndShared(IndividualCacheLoaderConfig cfg)
   {
      SingletonStoreConfig ssc = cfg.getSingletonStoreConfig();
      if (ssc != null && ssc.isSingletonStoreEnabled() && config.isShared())
         throw new ConfigurationException("Invalid cache loader configuration!!  If a cache loader is configured as a singleton, the cache loader cannot be shared in a cluster!");
   }
View Full Code Here

TOP

Related Classes of org.jboss.cache.config.ConfigurationException

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.