Package org.jboss.cache.config

Examples of org.jboss.cache.config.ConfigurationException


   {
      FileLookup fileLookup = new FileLookup();
      InputStream is = fileLookup.lookupFile(stacksXmlResource);
      if (is == null)
      {
         throw new ConfigurationException("Unable to find config file " + stacksXmlResource + " either in classpath or on the filesystem!");
      }
     
      return getStackConfigs(is);
   }
View Full Code Here


   private void parseStream(InputStream stream)
   {
      try
      {
// 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 XmlConfigurationParser();
         confCache = parser.parseElement(root);
         if (confCache == null) throw new NullPointerException("Null conf cache!!");
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

      {
         el = XmlConfigHelper.stringToElementInCoreNS(xml);
      }
      catch (Exception e)
      {
         throw new ConfigurationException(e);
      }
      EvictionConfig cfg = parser.parseEvictionElement(el);
      if (validate)
      {
         cfg.getDefaultEvictionRegionConfig().validate();
View Full Code Here

         if (cache == null)
         {
            if (config == null)
            {
               throw new ConfigurationException("Must call setConfiguration() or setCache() before call to create()");
            }

            constructCache();
         }
View Full Code Here

         // search for anything we need to inject
         for (Method method : methods) invokeInjectionMethod(target, method);
      }
      catch (Exception e)
      {
         throw new ConfigurationException("Unable to configure component (type: " + target.getClass() + ", instance " + target + ")", e);
      }
   }
View Full Code Here

   {
      if (defaultFactories == null) scanDefaultFactories();
      Class<? extends ComponentFactory> cfClass = defaultFactories.get(componentClass);
      if (cfClass == null)
      {
         throw new ConfigurationException("No registered default factory for component " + componentClass + " found!");
      }
      // a component factory is a component too!  See if one has been created and exists in the registry
      ComponentFactory cf = getComponent(cfClass);
      if (cf == null)
      {
         // hasn't yet been created.  Create and put in registry
         cf = instantiateFactory(cfClass);
         if (cf == null)
         {
            throw new ConfigurationException("Unable to locate component factory for component " + componentClass);
         }
         // we simply register this factory.  Registration will take care of constructing any dependencies.
         registerComponent(cf, cfClass);
      }

      // ensure the component factory is in the STARTED state!
      Component c = componentLookup.get(cfClass.getName());
      if (c.instance != cf)
      {
         throw new ConfigurationException("Component factory " + cfClass + " incorrectly registered!");
      }
      return cf;
   }
View Full Code Here

         return factory.newInstance();
      }
      catch (Exception e)
      {
         // unable to get a hold of an instance!!
         throw new ConfigurationException("Unable to instantiate factory " + factory, e);
      }
   }
View Full Code Here

    */
   @Override
   public void validate() throws ConfigurationException
   {
      if (getMaxNodes() < 0)
         throw new ConfigurationException("maxNodes not configured");
   }
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

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.