[jbosscache-commits] JBoss Cache SVN: r6228 - in core/trunk/src: test/resources and 1 other directory.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Tue Jul 8 18:13:22 EDT 2008
Author: mircea.markus
Date: 2008-07-08 18:13:22 -0400 (Tue, 08 Jul 2008)
New Revision: 6228
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheConfigsXmlParser.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
core/trunk/src/test/resources/jbc2-registry-configs.xml
Log:
CacheConfigsXmlParser works with new configuration format
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheConfigsXmlParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheConfigsXmlParser.java 2008-07-08 21:54:14 UTC (rev 6227)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheConfigsXmlParser.java 2008-07-08 22:13:22 UTC (rev 6228)
@@ -75,9 +75,6 @@
private static final Log log = LogFactory.getLog(CacheConfigsXmlParser.class);
- //todo mmarkus make this use the new parser
- private final XmlConfigurationParser2x parser = new XmlConfigurationParser2x();
-
public Map<String, Configuration> parseConfigs(String fileName) throws CloneNotSupportedException
{
FileLookup fileLookup = new FileLookup();
@@ -112,8 +109,8 @@
String name = element.getAttribute(CONFIG_NAME);
if (name == null || name.trim().length() == 0)
throw new ConfigurationException("Element " + element + " has no name attribute");
-
- Configuration c = parser.parseConfiguration(element);
+ XmlConfigurationParser parser = new XmlConfigurationParser();
+ Configuration c = parser.parseElement(element);
// Prove that we can successfully clone it
c = c.clone();
result.put(name.trim(), c);
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-07-08 21:54:14 UTC (rev 6227)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-07-08 22:13:22 UTC (rev 6228)
@@ -348,9 +348,9 @@
String useReplQueue = getAttributeValue(element, "useReplQueue");
if (existsAttribute(useReplQueue)) config.setUseReplQueue(getBoolean(useReplQueue));
String replQueueInterval = getAttributeValue(element, "replQueueInterval");
- if (replQueueInterval != null) config.setReplQueueInterval(getLong(replQueueInterval));
+ if (existsAttribute(replQueueInterval)) config.setReplQueueInterval(getLong(replQueueInterval));
String replQueueMaxElements = getAttributeValue(element, "replQueueMaxElements");
- if (replQueueMaxElements != null) config.setReplQueueMaxElements(getInt(replQueueMaxElements));
+ if (existsAttribute(replQueueMaxElements)) config.setReplQueueMaxElements(getInt(replQueueMaxElements));
}
private void configureLocking(Element element)
@@ -394,7 +394,7 @@
} catch (Exception e)
{
log.error(e);
- throw new ConfigurationException("Could not parseStream the config file");
+ throw new ConfigurationException("Could not parse the config file");
}
}
Modified: core/trunk/src/test/resources/jbc2-registry-configs.xml
===================================================================
(Binary files differ)
More information about the jbosscache-commits
mailing list