JBoss Cache SVN: r6228 - in core/trunk/src: test/resources and 1 other directory.
by jbosscache-commits@lists.jboss.org
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)
15 years, 11 months
JBoss Cache SVN: r6227 - in core/trunk/src: main/release and 2 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-07-08 17:54:14 -0400 (Tue, 08 Jul 2008)
New Revision: 6227
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
core/trunk/src/main/release/build.xml
core/trunk/src/main/resources/config-samples/buddy-replication.xml
core/trunk/src/test/resources/configs/buddy-replication-cache.xml
Log:
fixed some todos and typos
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:48:35 UTC (rev 6226)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-07-08 21:54:14 UTC (rev 6227)
@@ -172,7 +172,7 @@
configureCustomInterceptors(getSingleElement("customInterceptors"));
} catch (Exception e)
{
- throw new ConfigurationException("Unexpected exception while parsing the configuration file", e);
+ throw new ConfigurationException("Unexpected excetion while parsing the configuration file", e);
}
return config;
}
@@ -384,7 +384,6 @@
{
docBuilderFactory.setValidating(true);
docBuilderFactory.setNamespaceAware(true);
- //todo mmarkus load schema from classpath
docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
}
DocumentBuilder parser = docBuilderFactory.newDocumentBuilder();
Modified: core/trunk/src/main/release/build.xml
===================================================================
--- core/trunk/src/main/release/build.xml 2008-07-08 21:48:35 UTC (rev 6226)
+++ core/trunk/src/main/release/build.xml 2008-07-08 21:54:14 UTC (rev 6227)
@@ -128,14 +128,6 @@
</testng>
</target>
- <!-- todo mmarkus add a paragraph in documentation to mntion about this-->
- <!-- todo mmarkus add an sh and bat file to call this, which should also be present in the dist file -->
- <target name="config2to3">
- <echo message="${os.name}"/>
- <xslt in="${source}" out="${destination}" style="resources/config2to3.xslt"/>
- </target>
-
-
<target name="run.tests" depends="compile" description="run TestNG test cases.">
<testng
outputDir="${reports}"
Modified: core/trunk/src/main/resources/config-samples/buddy-replication.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/buddy-replication.xml 2008-07-08 21:48:35 UTC (rev 6226)
+++ core/trunk/src/main/resources/config-samples/buddy-replication.xml 2008-07-08 21:54:14 UTC (rev 6227)
@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
- <!-- todo mmarkus add comments to sample config files (after DTD is written) -->
- <!-- todo mmarkus include the DTD file in all configs -->
-
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
Modified: core/trunk/src/test/resources/configs/buddy-replication-cache.xml
===================================================================
--- core/trunk/src/test/resources/configs/buddy-replication-cache.xml 2008-07-08 21:48:35 UTC (rev 6226)
+++ core/trunk/src/test/resources/configs/buddy-replication-cache.xml 2008-07-08 21:54:14 UTC (rev 6227)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
- <!-- todo mmarkus upload the schema on the jbosscache website -->
+
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
15 years, 11 months
JBoss Cache SVN: r6226 - in core/trunk/src: test/resources/configs and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-07-08 17:48:35 -0400 (Tue, 08 Jul 2008)
New Revision: 6226
Modified:
core/trunk/src/main/resources/config-samples/buddy-replication.xml
core/trunk/src/main/resources/config-samples/cacheloader-enabled.xml
core/trunk/src/main/resources/config-samples/eviction-enabled.xml
core/trunk/src/main/resources/config-samples/local.xml
core/trunk/src/main/resources/config-samples/multiplexer-enabled.xml
core/trunk/src/main/resources/config-samples/optimistically-locked.xml
core/trunk/src/test/resources/configs/buddy-replication-cache.xml
core/trunk/src/test/resources/configs/clonable-config.xml
core/trunk/src/test/resources/configs/local-lru-eviction.xml
core/trunk/src/test/resources/configs/local-passivation.xml
core/trunk/src/test/resources/configs/local-tx.xml
core/trunk/src/test/resources/configs/mixedPolicy-eviction.xml
core/trunk/src/test/resources/configs/mux.xml
core/trunk/src/test/resources/configs/parser-test.xml
core/trunk/src/test/resources/configs/policyPerRegion-eviction.xml
core/trunk/src/test/resources/configs/replSync.xml
core/trunk/src/test/resources/configs/string-property-replaced.xml
Log:
all config files point to the online xsd now
Modified: core/trunk/src/main/resources/config-samples/buddy-replication.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/buddy-replication.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/main/resources/config-samples/buddy-replication.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -3,7 +3,8 @@
<!-- todo mmarkus add comments to sample config files (after DTD is written) -->
<!-- todo mmarkus include the DTD file in all configs -->
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../jbosscache-config-3.0.xsd">
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000" nodeLockingScheme="mvcc"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
Modified: core/trunk/src/main/resources/config-samples/cacheloader-enabled.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/cacheloader-enabled.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/main/resources/config-samples/cacheloader-enabled.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../jbosscache-config-3.0.xsd">
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000" nodeLockingScheme="mvcc"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<eviction wakeUpInterval="5000">
Modified: core/trunk/src/main/resources/config-samples/eviction-enabled.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/eviction-enabled.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/main/resources/config-samples/eviction-enabled.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../jbosscache-config-3.0.xsd">
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000" nodeLockingScheme="mvcc"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<eviction wakeUpInterval="5000">
Modified: core/trunk/src/main/resources/config-samples/local.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/local.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/main/resources/config-samples/local.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../jbosscache-config-3.0.xsd">
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000" nodeLockingScheme="mvcc"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
</jbosscache>
Modified: core/trunk/src/main/resources/config-samples/multiplexer-enabled.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/multiplexer-enabled.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/main/resources/config-samples/multiplexer-enabled.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../jbosscache-config-3.0.xsd">
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000" nodeLockingScheme="mvcc"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<startup stateRetrievalTimeout="20000"/>
Modified: core/trunk/src/main/resources/config-samples/optimistically-locked.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/optimistically-locked.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/main/resources/config-samples/optimistically-locked.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../jbosscache-config-3.0.xsd">
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="10000" nodeLockingScheme="optimistic"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<startup fetchInMemoryState="false"/>
Modified: core/trunk/src/test/resources/configs/buddy-replication-cache.xml
===================================================================
--- core/trunk/src/test/resources/configs/buddy-replication-cache.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/test/resources/configs/buddy-replication-cache.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- todo mmarkus upload the schema on the jbosscache website -->
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="file:///C:/projects/cache/branches/za_trunk/src/main/resources/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<startup stateRetrievalTimeout="20000"/>
Modified: core/trunk/src/test/resources/configs/clonable-config.xml
===================================================================
--- core/trunk/src/test/resources/configs/clonable-config.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/test/resources/configs/clonable-config.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="file:///C:/projects/cache/branches/za_trunk/src/main/resources/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="SERIALIZABLE" lockAcquisitionTimeout="1" nodeLockingScheme="optimistic"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<startup fetchInMemoryState="false" stateRetrievalTimeout="3"/>
Modified: core/trunk/src/test/resources/configs/local-lru-eviction.xml
===================================================================
--- core/trunk/src/test/resources/configs/local-lru-eviction.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/test/resources/configs/local-lru-eviction.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="file:///C:/projects/cache/branches/za_trunk/src/main/resources/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
Modified: core/trunk/src/test/resources/configs/local-passivation.xml
===================================================================
--- core/trunk/src/test/resources/configs/local-passivation.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/test/resources/configs/local-passivation.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="file:///C:/projects/cache/branches/za_trunk/src/main/resources/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
Modified: core/trunk/src/test/resources/configs/local-tx.xml
===================================================================
--- core/trunk/src/test/resources/configs/local-tx.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/test/resources/configs/local-tx.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="file:///C:/projects/cache/branches/za_trunk/src/main/resources/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
Modified: core/trunk/src/test/resources/configs/mixedPolicy-eviction.xml
===================================================================
--- core/trunk/src/test/resources/configs/mixedPolicy-eviction.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/test/resources/configs/mixedPolicy-eviction.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="file:///C:/projects/cache/branches/za_trunk/src/main/resources/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
Modified: core/trunk/src/test/resources/configs/mux.xml
===================================================================
--- core/trunk/src/test/resources/configs/mux.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/test/resources/configs/mux.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="file:///C:/projects/cache/branches/za_trunk/src/main/resources/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
Modified: core/trunk/src/test/resources/configs/parser-test.xml
===================================================================
--- core/trunk/src/test/resources/configs/parser-test.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/test/resources/configs/parser-test.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -3,7 +3,7 @@
<!-- file used for functional test of the xml parser -->
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="file:///C:/projects/cache/branches/za_trunk/src/main/resources/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockParentForChildInsertRemove="true" lockAcquisitionTimeout="10234"
Modified: core/trunk/src/test/resources/configs/policyPerRegion-eviction.xml
===================================================================
--- core/trunk/src/test/resources/configs/policyPerRegion-eviction.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/test/resources/configs/policyPerRegion-eviction.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="file:///C:/projects/cache/branches/za_trunk/src/main/resources/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<startup stateRetrievalTimeout="20000"/>
Modified: core/trunk/src/test/resources/configs/replSync.xml
===================================================================
--- core/trunk/src/test/resources/configs/replSync.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/test/resources/configs/replSync.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="file:///C:/projects/cache/branches/za_trunk/src/main/resources/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<serialization useRegionBasedMarshalling="true"/>
Modified: core/trunk/src/test/resources/configs/string-property-replaced.xml
===================================================================
--- core/trunk/src/test/resources/configs/string-property-replaced.xml 2008-07-08 21:15:29 UTC (rev 6225)
+++ core/trunk/src/test/resources/configs/string-property-replaced.xml 2008-07-08 21:48:35 UTC (rev 6226)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="file:///C:/projects/cache/branches/za_trunk/src/main/resources/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
<locking lockAcquisitionTimeout="${test.property.LockAcquisitionTimeout:15000}"
nodeLockingScheme="${test.property.NodeLockingScheme:OPTIMISTIC}"/>
<transaction syncCommitPhase="${test.property.SyncCommitPhase:true}" syncRollbackPhase="true"/>
15 years, 11 months
JBoss Cache SVN: r6225 - core/trunk/src/main/resources.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-07-08 17:15:29 -0400 (Tue, 08 Jul 2008)
New Revision: 6225
Modified:
core/trunk/src/main/resources/config2to3.sh
Log:
bug fixing
Modified: core/trunk/src/main/resources/config2to3.sh
===================================================================
--- core/trunk/src/main/resources/config2to3.sh 2008-07-08 20:40:47 UTC (rev 6224)
+++ core/trunk/src/main/resources/config2to3.sh 2008-07-08 21:15:29 UTC (rev 6225)
@@ -1,14 +1,14 @@
-#!/bin/bash
-if [ -z $1 ]
-then
- echo Usage:
- echo
- echo $0 [source_file] [destination_file]
- exit 1;
-fi
-for JAR in ../lib/*
-do
- CLASSPATH=$CLASSPATH:$JAR
-done
-echo classpath is $CLASSPATH
+#!/bin/bash
+if [ -z $1 ]
+then
+ echo Usage:
+ echo $0 [source_file] [destination_file]
+ exit 1;
+fi
+for JAR in ../lib/*
+do
+ CLASSPATH=$CLASSPATH:$JAR
+done
+CLASSPATH=../jbosscache-core.jar:$CLASSPATH
+echo classpath is $CLASSPATH
java -classpath $CLASSPATH -Dsource=$1 -Ddestination=$2 org.jboss.cache.config.parsing.ConfigFilesConvertor
\ No newline at end of file
15 years, 11 months
JBoss Cache SVN: r6224 - in core/trunk/src/main: resources and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-07-08 16:40:47 -0400 (Tue, 08 Jul 2008)
New Revision: 6224
Added:
core/trunk/src/main/resources/config2to3.bat
core/trunk/src/main/resources/config2to3.sh
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/ConfigFilesConvertor.java
Log:
added transformer classes
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/ConfigFilesConvertor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/ConfigFilesConvertor.java 2008-07-08 18:49:35 UTC (rev 6223)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/ConfigFilesConvertor.java 2008-07-08 20:40:47 UTC (rev 6224)
@@ -110,6 +110,7 @@
FileOutputStream fos = new FileOutputStream(destinationName);
convertor.parse(is, fos, "config2to3.xslt");
is.close();
+ System.out.println("File successfully created.");
}
private Transformer getTransformer(InputStream xsltInStream)
Added: core/trunk/src/main/resources/config2to3.bat
===================================================================
--- core/trunk/src/main/resources/config2to3.bat (rev 0)
+++ core/trunk/src/main/resources/config2to3.bat 2008-07-08 20:40:47 UTC (rev 6224)
@@ -0,0 +1,22 @@
+@echo off
+
+if "%1a" == "a" goto noParams
+if "%2a" == "a" goto noParams
+
+setlocal enabledelayedexpansion
+
+set LIB=
+for %%f in (..\lib\*.jar) do set LIB=!LIB!;%%f
+rem echo libs: %LIB%
+
+set CP=%LIB%;..\jbosscache-core.jar;%CP%
+rem echo cp is %CP%
+
+java -classpath "%CP%" -Dsource=%1 -Ddestination=%2 org.jboss.cache.config.parsing.ConfigFilesConvertor
+
+goto fileEnd
+
+:noParams
+echo usage: "%0 <file_to_transform> <destination_file>"
+
+:fileEnd
\ No newline at end of file
Added: core/trunk/src/main/resources/config2to3.sh
===================================================================
--- core/trunk/src/main/resources/config2to3.sh (rev 0)
+++ core/trunk/src/main/resources/config2to3.sh 2008-07-08 20:40:47 UTC (rev 6224)
@@ -0,0 +1,14 @@
+#!/bin/bash
+if [ -z $1 ]
+then
+ echo Usage:
+ echo
+ echo $0 [source_file] [destination_file]
+ exit 1;
+fi
+for JAR in ../lib/*
+do
+ CLASSPATH=$CLASSPATH:$JAR
+done
+echo classpath is $CLASSPATH
+java -classpath $CLASSPATH -Dsource=$1 -Ddestination=$2 org.jboss.cache.config.parsing.ConfigFilesConvertor
\ No newline at end of file
15 years, 11 months
JBoss Cache SVN: r6223 - core/trunk/src/main/java/org/jboss/cache/config/parsing.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-07-08 14:49:35 -0400 (Tue, 08 Jul 2008)
New Revision: 6223
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
Log:
fixed typo
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 18:48:24 UTC (rev 6222)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-07-08 18:49:35 UTC (rev 6223)
@@ -172,7 +172,7 @@
configureCustomInterceptors(getSingleElement("customInterceptors"));
} catch (Exception e)
{
- throw new ConfigurationException("Unexpected expcetion while parsing the configuration file", e);
+ throw new ConfigurationException("Unexpected exception while parsing the configuration file", e);
}
return config;
}
15 years, 11 months
JBoss Cache SVN: r6222 - core/trunk/src/main/java/org/jboss/cache/config/parsing.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-07-08 14:48:24 -0400 (Tue, 08 Jul 2008)
New Revision: 6222
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
Log:
added an handle for the unexpected exceptions
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 18:44:38 UTC (rev 6221)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-07-08 18:48:24 UTC (rev 6222)
@@ -156,18 +156,24 @@
{
throw new OldFileFormatException();
}
- configureLocking(getSingleElement("locking"));
- configureTransaction(getSingleElement("transaction"));
- configureReplication(getSingleElement("replication"));
- configureSerialization(getSingleElement("serialization"));
- configureInvalidation(getSingleElement("invalidation"));
- configureStartup(getSingleElement("startup"));
- configureTransport(getSingleElement("transport"));
- configureShutdown(getSingleElement("shutdown"));
- configureJmxStatistics(getSingleElement("jmxStatistics"));
- configureEviction(getSingleElement("eviction"));
- configureCacheLoaders(getSingleElement("loaders"));
- configureCustomInterceptors(getSingleElement("customInterceptors"));
+ try
+ {
+ configureLocking(getSingleElement("locking"));
+ configureTransaction(getSingleElement("transaction"));
+ configureReplication(getSingleElement("replication"));
+ configureSerialization(getSingleElement("serialization"));
+ configureInvalidation(getSingleElement("invalidation"));
+ configureStartup(getSingleElement("startup"));
+ configureTransport(getSingleElement("transport"));
+ configureShutdown(getSingleElement("shutdown"));
+ configureJmxStatistics(getSingleElement("jmxStatistics"));
+ configureEviction(getSingleElement("eviction"));
+ configureCacheLoaders(getSingleElement("loaders"));
+ configureCustomInterceptors(getSingleElement("customInterceptors"));
+ } catch (Exception e)
+ {
+ throw new ConfigurationException("Unexpected expcetion while parsing the configuration file", e);
+ }
return config;
}
15 years, 11 months
JBoss Cache SVN: r6221 - core/trunk/src/test/resources/configs/conf2x.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-07-08 14:44:38 -0400 (Tue, 08 Jul 2008)
New Revision: 6221
Added:
core/trunk/src/test/resources/configs/conf2x/pess-local.xml
Log:
fall back to the old configuration format
Added: core/trunk/src/test/resources/configs/conf2x/pess-local.xml
===================================================================
--- core/trunk/src/test/resources/configs/conf2x/pess-local.xml (rev 0)
+++ core/trunk/src/test/resources/configs/conf2x/pess-local.xml 2008-07-08 18:44:38 UTC (rev 6221)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Sample for total replication. -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<server>
+
+ <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+ <!-- ==================================================================== -->
+ <!-- Defines TreeCache configuration -->
+ <!-- ==================================================================== -->
+
+ <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+ name="jboss.cache:service=testTreeCache">
+
+ <depends>jboss:service=Naming</depends>
+ <depends>jboss:service=TransactionManager</depends>
+
+ <!--
+ Configure the TransactionManager
+ -->
+ <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+ </attribute>
+
+
+ <!--
+ Node locking level : SERIALIZABLE
+ REPEATABLE_READ (default)
+ READ_COMMITTED
+ READ_UNCOMMITTED
+ NONE
+ -->
+ <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+ <!--
+ Valid modes are LOCAL
+ REPL_ASYNC
+ REPL_SYNC
+ INVALIDATION_ASYNC
+ INVALIDATION_SYNC
+ -->
+ <attribute name="CacheMode">LOCAL</attribute>
+
+ <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
+ cluster in order to find each other.
+ -->
+ <attribute name="ClusterName">JBossCache-Cluster</attribute>
+ <!--
+ The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members in a clustered environment
+ -->
+ <attribute name="StateRetrievalTimeout">20000</attribute>
+
+ <!--
+ Number of milliseconds to wait until all responses for a
+ synchronous call have been received.
+ -->
+ <attribute name="SyncReplTimeout">15000</attribute>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <attribute name="LockAcquisitionTimeout">10000</attribute>
+ </mbean>
+</server>
15 years, 11 months
JBoss Cache SVN: r6220 - in core/trunk/src: main/java/org/jboss/cache/config and 4 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-07-08 14:43:36 -0400 (Tue, 08 Jul 2008)
New Revision: 6220
Added:
core/trunk/src/main/java/org/jboss/cache/config/OldFileFormatException.java
Modified:
core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java
core/trunk/src/test/java/org/jboss/cache/CacheFactoryTest.java
core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java
Log:
fall back to the old configuration format
Modified: core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java 2008-07-08 17:15:50 UTC (rev 6219)
+++ core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java 2008-07-08 18:43:36 UTC (rev 6220)
@@ -8,8 +8,9 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.ConfigurationException;
+import org.jboss.cache.config.OldFileFormatException;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
-import org.jboss.cache.config.parsing.XmlConfigurationParser;
import org.jboss.cache.factories.ComponentFactory;
import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.invocation.CacheInvocationDelegate;
@@ -64,7 +65,15 @@
public Cache<K, V> createCache(String configFileName, boolean start) throws ConfigurationException
{
XmlConfigurationParser parser = new XmlConfigurationParser();
- Configuration c = parser.parseFile(configFileName);
+ Configuration c = null;
+ try
+ {
+ c = parser.parseFile(configFileName);
+ } catch (OldFileFormatException e)
+ {
+ XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();
+ c = oldParser.parseFile(configFileName);
+ }
return createCache(c, start);
}
@@ -142,9 +151,16 @@
public Cache<K, V> createCache(InputStream is) throws ConfigurationException
{
- //todo mmarkus also try to parse old file types.
XmlConfigurationParser parser = new XmlConfigurationParser();
- Configuration c = parser.parseStream(is);
+ Configuration c = null;
+ try
+ {
+ c = parser.parseStream(is);
+ } catch (OldFileFormatException e)
+ {
+ XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();
+ c = oldParser.parseStream(is);
+ }
return createCache(c);
}
Added: core/trunk/src/main/java/org/jboss/cache/config/OldFileFormatException.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/OldFileFormatException.java (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/config/OldFileFormatException.java 2008-07-08 18:43:36 UTC (rev 6220)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.cache.config;
+
+/**
+ * This exception indicates that an old configuration file is passed to a parser that only knows how to handle newer
+ * configuration file.
+ *
+ * @author Mircea.Markus(a)jboss.com
+ * @since 3.0
+ */
+public class OldFileFormatException extends ConfigurationException
+{
+ public OldFileFormatException(String string)
+ {
+ super(string);
+ }
+
+ public OldFileFormatException()
+ {
+ this("The configuration file has an old format.");
+ }
+}
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 17:15:50 UTC (rev 6219)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-07-08 18:43:36 UTC (rev 6220)
@@ -109,6 +109,7 @@
* Parses an XML file and returns a new configuration.
* For looking up the file, {@link org.jboss.cache.config.parsing.FileLookup} is used.
*
+ * @throws OldFileFormatException if the file has a 2.x format
* @see org.jboss.cache.config.parsing.FileLookup
*/
public Configuration parseFile(String filename)
@@ -123,6 +124,8 @@
/**
* Similar to {@link #parseFile(String)}, just that it does not create the input stream.
+ *
+ * @throws OldFileFormatException if the file has a 2.x format
*/
public Configuration parseStream(InputStream configStream)
{
@@ -132,6 +135,8 @@
/**
* Root should be the <b>jbosscache</b> element in the configuration file.
+ *
+ * @throws OldFileFormatException if the file has a 2.x format
*/
public Configuration parseElement(Element root)
{
@@ -147,6 +152,10 @@
private Configuration processElements()
{
+ if ("server".equalsIgnoreCase(root.getNodeName()))
+ {
+ throw new OldFileFormatException();
+ }
configureLocking(getSingleElement("locking"));
configureTransaction(getSingleElement("transaction"));
configureReplication(getSingleElement("replication"));
Modified: core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java 2008-07-08 17:15:50 UTC (rev 6219)
+++ core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java 2008-07-08 18:43:36 UTC (rev 6220)
@@ -25,11 +25,10 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.*;
import org.jboss.cache.config.*;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
import org.jboss.cache.config.parsing.JGroupsStackParser;
import org.jboss.cache.config.parsing.element.BuddyElementParser;
-import org.jboss.cache.config.parsing.element.LoadersElementParser;
import org.jboss.cache.config.parsing.element.EvictionElementParser;
+import org.jboss.cache.config.parsing.element.LoadersElementParser;
import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.util.CachePrinter;
import org.jgroups.Address;
Modified: core/trunk/src/test/java/org/jboss/cache/CacheFactoryTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/CacheFactoryTest.java 2008-07-08 17:15:50 UTC (rev 6219)
+++ core/trunk/src/test/java/org/jboss/cache/CacheFactoryTest.java 2008-07-08 18:43:36 UTC (rev 6220)
@@ -44,6 +44,12 @@
}
}
+ public void testLoadOldConfig()
+ {
+ cache = (CacheSPI) new DefaultCacheFactory().createCache("configs/conf2x/buddy-replication-cache.xml");
+ assert cache.getCacheStatus() == CacheStatus.STARTED : "Should have started";
+ }
+
public void testFromConfigFileStarted()
{
cache = (CacheSPI) new DefaultCacheFactory().createCache(configFile);
Modified: core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java 2008-07-08 17:15:50 UTC (rev 6219)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java 2008-07-08 18:43:36 UTC (rev 6220)
@@ -28,6 +28,19 @@
config = parser.parseFile("configs/parser-test.xml");
}
+ public void testParseOldConfigFile()
+ {
+ XmlConfigurationParser parser = new XmlConfigurationParser();
+ try
+ {
+ parser.parseFile("configs/conf2x/pess-local.xml");
+ assert false : "exception expected";
+ } catch (OldFileFormatException e)
+ {
+ //expectd
+ }
+ }
+
public void testTransactionManagerLookupClass()
{
assert config.getTransactionManagerLookupClass().equals("org.jboss.cache.transaction.GenericTransactionManagerLookup");
15 years, 11 months
JBoss Cache SVN: r6219 - core/trunk/src/main/java/org/jboss/cache/config/parsing.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-07-08 13:15:50 -0400 (Tue, 08 Jul 2008)
New Revision: 6219
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java
Log:
enhanced javadoc
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java 2008-07-08 17:04:46 UTC (rev 6218)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java 2008-07-08 17:15:50 UTC (rev 6219)
@@ -33,28 +33,41 @@
*/
public abstract class XmlParserBase
{
+ /**
+ * @see Integer#parseInt(String)
+ */
protected int getInt(String intStr)
{
return Integer.parseInt(intStr);
}
+ /**
+ * @see Long#parseLong(String)
+ */
protected long getLong(String longStr)
{
- return Long.valueOf(longStr);
+ return Long.parseLong(longStr);
}
+ /**
+ * @see Boolean#valueOf(String)
+ */
protected boolean getBoolean(String str)
{
return Boolean.valueOf(str);
}
-
+ /**
+ * Retunrs true if the given value is not empty.
+ */
protected boolean existsAttribute(String attrValue)
{
return attrValue.length() > 0;
}
-
+ /**
+ * Convenient method for retrieving a single element with the give name.
+ */
protected Element getSingleElement(String elementName, Element parent)
{
NodeList nodeList = parent.getElementsByTagName(elementName);
@@ -65,6 +78,11 @@
return (Element) nodeList.item(0);
}
+ /**
+ * Beside querying the element for it's attribute value, it will look into the value, if any, and replace the
+ * jboss properties(e.g. ${someValue:defaultValue}.
+ * @see StringPropertyReplacer#replaceProperties(value);
+ */
protected String getAttributeValue(Element element, String attrName)
{
String value = element.getAttribute(attrName);
15 years, 11 months