Author: manik.surtani(a)jboss.com
Date: 2008-09-03 05:35:12 -0400 (Wed, 03 Sep 2008)
New Revision: 6687
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheConfigsXmlParser.java
Log:
Support for both qualified and unqualified elements
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-09-03
05:41:51 UTC (rev 6686)
+++
core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheConfigsXmlParser.java 2008-09-03
09:35:12 UTC (rev 6687)
@@ -66,6 +66,8 @@
* in a cache configs XML document.
*/
public static final String CONFIG_ROOT = "cache-config";
+ public static final String QUALIFIED_CONFIG_ROOT = "registry:cache-config";
+
/**
* Name of the attribute in a {@link #CONFIG_ROOT cache-config} element that
specifies
* the name of the configuration.
@@ -74,6 +76,7 @@
private static final Log log = LogFactory.getLog(CacheConfigsXmlParser.class);
+
public Map<String, Configuration> parseConfigs(String fileName) throws
CloneNotSupportedException
{
FileLookup fileLookup = new FileLookup();
@@ -93,7 +96,12 @@
NodeList list = root.getElementsByTagName(CONFIG_ROOT);
if (list == null || list.getLength() == 0)
- throw new ConfigurationException("Can't find " + CONFIG_ROOT +
" tag");
+ {
+ // try looking for a QUALIFIED_CONFIG_ROOT
+ list = root.getElementsByTagName(QUALIFIED_CONFIG_ROOT);
+ if (list == null || list.getLength() == 0)
+ throw new ConfigurationException("Can't find " + CONFIG_ROOT +
" or " + QUALIFIED_CONFIG_ROOT + " tag");
+ }
Map<String, Configuration> result = new HashMap<String,
Configuration>();