Package org.jboss.cache.config.parsing

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


         c.setEvictionConfig(ec);
         doTest(c);
      }
      else
      {
         doTest(new XmlConfigurationParser().parseElement(XmlConfigHelper.stringToElementInCoreNS(xml)));
      }
   }
View Full Code Here


   }

   private void initCaches()
   {
      CacheFactory<String, String> instance = new UnitTestCacheFactory<String, String>();
      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser().parseFile("configs/local-passivation.xml"), false);
      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      Object listener = new TestCacheListener();
      cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());
      cache.start();
      cache.getNotifier().addCacheListener(listener);
View Full Code Here

   }

   private void initCaches()
   {
      CacheFactory<String, String> instance = new UnitTestCacheFactory<String, String>();
      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser().parseFile("configs/local-passivation.xml"), false);
      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());
      cache.start();
   }
View Full Code Here

      String fileName = getFileName("/policyPerRegion-eviction.xml");
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      convertor.parse(fileName, baos, XSLT_FILE);
      System.out.println("result = \n" + baos);

      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);
         System.out.println("result = \n" + baos);

         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);
         System.out.println("result = \n" + baos);

         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

      {
         // 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);

         Element list = (Element) root.getElementsByTagNameNS("*","protocol_stacks").item(0);
         NodeList stacks = list.getElementsByTagNameNS("*", "stack");

         for (int i = 0; i < stacks.getLength(); i++)
View Full Code Here

      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

      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)
      {
         System.out.println("Detected legacy configuration file format when parsing [" + configFileName + "].  Migrating to the new (3.x) file format is recommended.  See FAQs for details.");
         XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();
View Full Code Here

      return createCache(is, true);
   }

   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.