[jbosscache-commits] JBoss Cache SVN: r6211 - in core/trunk/src: main/resources and 1 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Jul 8 11:25:11 EDT 2008


Author: mircea.markus
Date: 2008-07-08 11:25:11 -0400 (Tue, 08 Jul 2008)
New Revision: 6211

Modified:
   core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
   core/trunk/src/main/resources/jbosscache-config.xsd
   core/trunk/src/test/resources/configs/string-property-replaced.xml
Log:
added support for jboss-style props; e.g. ${sys.prop:defaultValue}

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 15:20:56 UTC (rev 6210)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java	2008-07-08 15:25:11 UTC (rev 6211)
@@ -25,6 +25,7 @@
 
 /**
  * todo mmarkus comment classes
+ * todo mmarkus - allow disabling parser validation through -Djbc.config.validation=false
  *
  * @author Mircea.Markus at jboss.com
  * @since 3.0

Modified: core/trunk/src/main/resources/jbosscache-config.xsd
===================================================================
--- core/trunk/src/main/resources/jbosscache-config.xsd	2008-07-08 15:20:56 UTC (rev 6210)
+++ core/trunk/src/main/resources/jbosscache-config.xsd	2008-07-08 15:25:11 UTC (rev 6211)
@@ -24,22 +24,16 @@
       <xs:attribute name="isolationLevel">
          <xs:simpleType>
             <xs:restriction base="xs:string">
-               <xs:enumeration value="SERIALIZABLE"/>
-               <xs:enumeration value="REPEATABLE_READ"/>
-               <xs:enumeration value="READ_COMMITTED"/>
-               <xs:enumeration value="READ_UNCOMMITTED"/>
-               <xs:enumeration value="NONE"/>
+               <xs:pattern value="SERIALIZABLE|REPEATABLE_READ|READ_COMMITTED|NONE|\$\{.*\}"/>
             </xs:restriction>
          </xs:simpleType>
       </xs:attribute>
       <xs:attribute name="lockParentForChildInsertRemove" type="booleanType"/>
-      <xs:attribute name="lockAcquisitionTimeout" type="xs:positiveInteger"/>
+      <xs:attribute name="lockAcquisitionTimeout" type="positiveInteger"/>
       <xs:attribute name="nodeLockingScheme">
          <xs:simpleType>
             <xs:restriction base="xs:string">
-               <xs:enumeration value="mvcc"/>
-               <xs:enumeration value="optimistic"/>
-               <xs:enumeration value="pessimistic"/>
+               <xs:pattern value="mvcc|optimistic|pessimistic|\$\{.*\}"/>
             </xs:restriction>
          </xs:simpleType>
       </xs:attribute>
@@ -56,24 +50,22 @@
    <xs:complexType name="startupType">
       <xs:attribute name="fetchInMemoryState" type="booleanType"/>
       <xs:attribute name="inactiveOnStartup" type="booleanType"/>
-      <xs:attribute name="stateRetrievalTimeout" type="xs:positiveInteger"/>
+      <xs:attribute name="stateRetrievalTimeout" type="positiveInteger"/>
    </xs:complexType>
 
    <xs:complexType name="shutdownType">
       <xs:attribute name="hookBehavior">
          <xs:simpleType>
             <xs:restriction base="xs:string">
-               <xs:enumeration value="DEFAULT"/>
-               <xs:enumeration value="REGISTER"/>
-               <xs:enumeration value="DONT_REGISTER"/>
+               <xs:pattern value="DEFAULT|REGISTER|DONT_REGISTER|\$\{.*\}"/>
             </xs:restriction>
          </xs:simpleType>
       </xs:attribute>
    </xs:complexType>
 
    <xs:complexType name="serializationType">
-      <xs:attribute name="objectInputStreamPoolSize" type="xs:positiveInteger"/>
-      <xs:attribute name="objectOutputStreamPoolSize" type="xs:positiveInteger"/>
+      <xs:attribute name="objectInputStreamPoolSize" type="positiveInteger"/>
+      <xs:attribute name="objectOutputStreamPoolSize" type="positiveInteger"/>
       <xs:attribute name="version" type="xs:string"/>
       <xs:attribute name="marshallerClass" type="xs:string"/>
       <xs:attribute name="useLazyDeserialization" type="booleanType"/>
@@ -82,11 +74,16 @@
 
    <xs:simpleType name="booleanType">
       <xs:restriction base="xs:string">
-         <xs:enumeration value="true"/>
-         <xs:enumeration value="false"/>
+         <xs:pattern value="\$\{.*\}|true|false"/>
       </xs:restriction>
    </xs:simpleType>
 
+   <xs:simpleType name="positiveInteger">
+      <xs:restriction base="xs:string">
+         <xs:pattern value="\$\{.*\}|\+?[0-9]*"/>
+      </xs:restriction>
+   </xs:simpleType>
+
    <xs:complexType name="replicationType">
       <xs:sequence>
          <xs:choice>
@@ -140,14 +137,14 @@
    </xs:complexType>
 
    <xs:complexType name="syncType">
-      <xs:attribute name="replTimeout" type="xs:positiveInteger"/>
+      <xs:attribute name="replTimeout" type="positiveInteger"/>
    </xs:complexType>
 
 
    <xs:complexType name="asyncType">
       <xs:attribute name="useReplQueue" type="booleanType"/>
-      <xs:attribute name="replQueueInterval" type="xs:positiveInteger"/>
-      <xs:attribute name="replQueueMaxElements" type="xs:positiveInteger"/>
+      <xs:attribute name="replQueueInterval" type="positiveInteger"/>
+      <xs:attribute name="replQueueMaxElements" type="positiveInteger"/>
    </xs:complexType>
 
    <xs:complexType name="evictionType">
@@ -155,13 +152,13 @@
          <xs:element name="defaults" minOccurs="0">
             <xs:complexType>
                <xs:attribute name="policyClass" type="xs:string"/>
-               <xs:attribute name="eventQueueSize" type="xs:positiveInteger"/>
+               <xs:attribute name="eventQueueSize" type="positiveInteger"/>
             </xs:complexType>
          </xs:element>
          <xs:element name="root" type="evictionRegionType" minOccurs="0"/>
          <xs:element name="region" minOccurs="0" maxOccurs="unbounded" type="evictionRegionType"/>
       </xs:sequence>
-      <xs:attribute name="wakeUpInterval" type="xs:positiveInteger"/>
+      <xs:attribute name="wakeUpInterval" type="positiveInteger"/>
    </xs:complexType>
 
    <xs:complexType name="evictionRegionType">
@@ -178,7 +175,7 @@
       </xs:sequence>
       <xs:attribute name="name" type="xs:string"/>
       <xs:attribute name="policyClass" type="xs:string"/>
-      <xs:attribute name="eventQueueSize" type="xs:positiveInteger"/>
+      <xs:attribute name="eventQueueSize" type="positiveInteger"/>
    </xs:complexType>
 
    <xs:complexType name="loadersType">
@@ -230,7 +227,7 @@
                      <xs:complexType>
                         <xs:attribute name="first" type="booleanType"/>
                         <xs:attribute name="last" type="booleanType"/>
-                        <xs:attribute name="index" type="xs:positiveInteger"/>
+                        <xs:attribute name="index" type="positiveInteger"/>
                         <xs:attribute name="before" type="xs:string"/>
                         <xs:attribute name="after" type="xs:string"/>
                      </xs:complexType>

Modified: core/trunk/src/test/resources/configs/string-property-replaced.xml
===================================================================
--- core/trunk/src/test/resources/configs/string-property-replaced.xml	2008-07-08 15:20:56 UTC (rev 6210)
+++ core/trunk/src/test/resources/configs/string-property-replaced.xml	2008-07-08 15:25:11 UTC (rev 6211)
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<jbosscache>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:noNamespaceSchemaLocation="file:///C:/projects/cache/branches/za_trunk/src/main/resources/jbosscache-config.xsd">
    <locking lockAcquisitionTimeout="${test.property.LockAcquisitionTimeout:15000}"
             nodeLockingScheme="${test.property.NodeLockingScheme:OPTIMISTIC}"/>
    <transaction syncCommitPhase="${test.property.SyncCommitPhase:true}" syncRollbackPhase="true"/>




More information about the jbosscache-commits mailing list