Package org.jboss.cache.config.parsing

Examples of org.jboss.cache.config.parsing.XmlConfigurationParser


      System.setProperty(NUM_BUDDIES_PROP, "3");
      System.setProperty(SYNC_COMMIT_PROP, "false");
      System.setProperty(MAX_NODES_PROP, "1000");
      System.setProperty(BUDDY_POOL_PROP, "replaced");

      Configuration cfg = new XmlConfigurationParser().parseFile(STRING_REPLACED_FILE);

      assertEquals(NodeLockingScheme.MVCC, cfg.getNodeLockingScheme());
      assertFalse(cfg.isSyncCommitPhase());
      assertTrue(cfg.isSyncRollbackPhase());
      assertEquals(15000, cfg.getLockAcquisitionTimeout());
View Full Code Here


   private static final Log log = LogFactory.getLog(ConfigurationCloningTest.class);

   public void testClone() throws Exception
   {
      XmlConfigurationParser parser = new XmlConfigurationParser();
      Configuration c = parser.parseFile(DEFAULT_CONFIGURATION_FILE);

      try
      {
         Configuration clone = c.clone();
View Full Code Here

   {
      String fileName = getFileName("/policyPerRegion-eviction.xml");
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      convertor.parse(fileName, baos, XSLT_FILE);

      XmlConfigurationParser newParser = new XmlConfigurationParser();
      XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();

      Configuration newConfig = newParser.parseStream(new ByteArrayInputStream(baos.toByteArray()));
      Configuration oldConfig = oldParser.parseFile(fileName);

      assert oldConfig.equals(newConfig);
   }
View Full Code Here

      {
         String fileName = getFileName(file);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         convertor.parse(fileName, baos, XSLT_FILE);

         XmlConfigurationParser newParser = new XmlConfigurationParser();
         XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();

         Configuration newConfig = newParser.parseStream(new ByteArrayInputStream(baos.toByteArray()));
         Configuration oldConfig = oldParser.parseFile(fileName);

         assert newConfig.equals(oldConfig);
      }
   }
View Full Code Here

      {
         String fileName = getFileName(file);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         convertor.parse(fileName, baos, XSLT_FILE);

         XmlConfigurationParser newParser = new XmlConfigurationParser();
         XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();

         Configuration newConfig = newParser.parseStream(new ByteArrayInputStream(baos.toByteArray()));
         Configuration oldConfig = oldParser.parseFile(fileName);

         assert newConfig.equals(oldConfig);
      }
   }
View Full Code Here

      // in 3.x, unlimited values in eviction are denoted by -1 and not 0!
      String fileName = getFileName("/zeroTTL.xml");
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      convertor.parse(fileName, baos, XSLT_FILE);

      XmlConfigurationParser newParser = new XmlConfigurationParser();
      XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();

      Configuration newConfig = newParser.parseStream(new ByteArrayInputStream(baos.toByteArray()));
      Configuration oldConfig = oldParser.parseFile(fileName);

      for (EvictionRegionConfig erc : oldConfig.getEvictionConfig().getEvictionRegionConfigs())
      {
         correctUnlimitedValues(erc);
View Full Code Here

         Element element = (Element) node;
         String name = element.getAttribute(CONFIG_NAME);
         if (name == null || name.trim().length() == 0)
            throw new ConfigurationException("Element " + element + " has no name attribute");

         XmlConfigurationParser parser = new XmlConfigurationParser();
         Configuration c = parser.parseElementIgnoringRoot(element);

         // Prove that we can successfully clone it
         c = c.clone();
         result.put(name.trim(), c);
      }
View Full Code Here

      return createCache(configFileName, true);
   }

   public Cache<K, V> createCache(String configFileName, boolean start) throws ConfigurationException
   {
      XmlConfigurationParser parser = new XmlConfigurationParser();
      Configuration c;
      try
      {
         c = parser.parseFile(configFileName);
      }
      catch (ConfigurationException e)
      {
         XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();
         c = oldParser.parseFile(configFileName);
View Full Code Here

      this.defaultClassLoader = loader;
   }

   public Cache<K, V> createCache(InputStream is) throws ConfigurationException
   {
      XmlConfigurationParser parser = new XmlConfigurationParser();
      Configuration c = null;
      try
      {
         c = parser.parseStream(is);
      }
      catch (ConfigurationException e)
      {
         XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();
         c = oldParser.parseStream(is);
View Full Code Here

      return createCache(c);
   }

   public Cache<K, V> createCache(InputStream is, boolean start) throws ConfigurationException
   {
      XmlConfigurationParser parser = new XmlConfigurationParser();
      Configuration c = parser.parseStream(is);
      return createCache(c, start);
   }
View Full Code Here

TOP

Related Classes of org.jboss.cache.config.parsing.XmlConfigurationParser

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.