cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r834239 - in /cxf/branches/2.2.x-fixes: ./ api/ api/src/main/build-resources/ common/schemas/src/main/resources/META-INF/ common/schemas/src/main/resources/schemas/configuration/ common/xjc/dv/src/main/java/org/apache/cxf/xjc/dv/ rt/transpo...
Date Mon, 09 Nov 2009 21:18:05 GMT
Author: dkulp
Date: Mon Nov  9 21:18:04 2009
New Revision: 834239

URL: http://svn.apache.org/viewvc?rev=834239&view=rev
Log:
Merged revisions 834232 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r834232 | dkulp | 2009-11-09 16:06:33 -0500 (Mon, 09 Nov 2009) | 4 lines
  
  [CXF-1647, CXF-2324, CXF-2039, CXF-2113] Introduce "ParameterizedXXXX"
  types for use in the schema derived configuration things to allow
  the primitive things to be properly schema validated, but also allow
  some level of schema validation.
........

Added:
    cxf/branches/2.2.x-fixes/common/schemas/src/main/resources/schemas/configuration/parameterized-types.xsd
      - copied unchanged from r834232, cxf/trunk/common/schemas/src/main/resources/schemas/configuration/parameterized-types.xsd
    cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/bean.properties
      - copied unchanged from r834232, cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/bean.properties
    cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans-props.xml
      - copied unchanged from r834232, cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans-props.xml
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/api/pom.xml
    cxf/branches/2.2.x-fixes/api/src/main/build-resources/catalog.cat
    cxf/branches/2.2.x-fixes/common/schemas/src/main/resources/META-INF/spring.schemas
    cxf/branches/2.2.x-fixes/common/schemas/src/main/resources/schemas/configuration/security.xsd
    cxf/branches/2.2.x-fixes/common/xjc/dv/src/main/java/org/apache/cxf/xjc/dv/DefaultValuePlugin.java
    cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/build-resources/catalog.cat
    cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd
    cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
    cxf/branches/2.2.x-fixes/rt/transports/http/pom.xml
    cxf/branches/2.2.x-fixes/rt/transports/http/src/main/build-resources/catalog.cat
    cxf/branches/2.2.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
    cxf/branches/2.2.x-fixes/rt/transports/jms/pom.xml
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/build-resources/catalog.cat
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
    cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/api/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/pom.xml?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/pom.xml (original)
+++ cxf/branches/2.2.x-fixes/api/pom.xml Mon Nov  9 21:18:04 2009
@@ -154,6 +154,10 @@
                                 <xsdOption>
                                     <xsd>${basedir}/target/schemas/schemas/configuration/security.xsd</xsd>
                                     <bindingFile>${basedir}/target/schemas/schemas/configuration/security.xjb</bindingFile>
+                                    <catalog>${basedir}/src/main/build-resources/catalog.cat</catalog>
+                                    <extensionArgs>
+                                         <extensionArg>-Xdv</extensionArg>
+                                     </extensionArgs>
                                 </xsdOption>
                                 <xsdOption>
                                     <xsd>${basedir}/target/schemas/schemas/wsdl/ws-addr-wsdl.xsd</xsd>

Modified: cxf/branches/2.2.x-fixes/api/src/main/build-resources/catalog.cat
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/build-resources/catalog.cat?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/build-resources/catalog.cat (original)
+++ cxf/branches/2.2.x-fixes/api/src/main/build-resources/catalog.cat Mon Nov  9 21:18:04
2009
@@ -20,4 +20,5 @@
 
 SYSTEM "http://schemas.xmlsoap.org/wsdl/" "../../../target/schemas/schemas/wsdl/wsdl.xsd"
 SYSTEM "http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd" "../../../target/schemas/schemas/wsdl/wsdl.xsd"
+SYSTEM "http://cxf.apache.org/schemas/configuration/parameterized-types.xsd" "../../../target/schemas/schemas/configuration/parameterized-types.xsd"
 

Modified: cxf/branches/2.2.x-fixes/common/schemas/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/common/schemas/src/main/resources/META-INF/spring.schemas?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/common/schemas/src/main/resources/META-INF/spring.schemas (original)
+++ cxf/branches/2.2.x-fixes/common/schemas/src/main/resources/META-INF/spring.schemas Mon
Nov  9 21:18:04 2009
@@ -24,4 +24,5 @@
 http\://schemas.xmlsoap.org/ws/2004/08/addressing=schemas/wsdl/addressing.xsd
 
 http\://cxf.apache.org/schemas/configuration/security.xsd=schemas/configuration/security.xsd
+http\://cxf.apache.org/schemas/configuration/parameterized-types.xsd=schemas/configuration/parameterized-types.xsd
 

Modified: cxf/branches/2.2.x-fixes/common/schemas/src/main/resources/schemas/configuration/security.xsd
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/common/schemas/src/main/resources/schemas/configuration/security.xsd?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/common/schemas/src/main/resources/schemas/configuration/security.xsd
(original)
+++ cxf/branches/2.2.x-fixes/common/schemas/src/main/resources/schemas/configuration/security.xsd
Mon Nov  9 21:18:04 2009
@@ -26,6 +26,7 @@
            xmlns:tns="http://cxf.apache.org/configuration/security"
            xmlns:beans="http://www.springframework.org/schema/beans"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xmlns:pt="http://cxf.apache.org/configuration/parameterized-types" 
            xsi:schemaLocation="
                http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans.xsd"
@@ -33,6 +34,9 @@
 
     <xs:import namespace="http://www.springframework.org/schema/beans"/>
     
+    <xs:import namespace="http://cxf.apache.org/configuration/parameterized-types"
+               schemaLocation="http://cxf.apache.org/schemas/configuration/parameterized-types.xsd"/>
+    
     <xs:complexType name="AuthorizationPolicy">
         <xs:annotation>
             <xs:documentation>
@@ -99,14 +103,14 @@
     </xs:complexType>
     
     <xs:complexType name="ClientAuthentication">
-        <xs:attribute name="want"     type="xs:boolean">
+        <xs:attribute name="want"     type="pt:ParameterizedBoolean">
           <xs:annotation>
             <xs:documentation>
             This attribute specifies if client authentication should be requested.
             </xs:documentation>
           </xs:annotation>
         </xs:attribute>
-        <xs:attribute name="required" type="xs:boolean">
+        <xs:attribute name="required" type="pt:ParameterizedBoolean">
           <xs:annotation>
             <xs:documentation>
             This attribute specifies if client authentication should be required.
@@ -429,7 +433,7 @@
               </xs:annotation>
            </xs:element>
         </xs:all>
-           <xs:attribute name="disableCNCheck" type="xs:boolean" default="false">
+           <xs:attribute name="disableCNCheck" type="pt:ParameterizedBoolean" default="false">
              <xs:annotation>
                 <xs:documentation>
                 This attribute specifies if JSSE should omit checking if the

Modified: cxf/branches/2.2.x-fixes/common/xjc/dv/src/main/java/org/apache/cxf/xjc/dv/DefaultValuePlugin.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/common/xjc/dv/src/main/java/org/apache/cxf/xjc/dv/DefaultValuePlugin.java?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/common/xjc/dv/src/main/java/org/apache/cxf/xjc/dv/DefaultValuePlugin.java
(original)
+++ cxf/branches/2.2.x-fixes/common/xjc/dv/src/main/java/org/apache/cxf/xjc/dv/DefaultValuePlugin.java
Mon Nov  9 21:18:04 2009
@@ -56,7 +56,7 @@
 import org.apache.cxf.common.logging.LogUtils;
 
 /**
- * Modifies the JAXB code model to initialise fields mapped from schema elements 
+ * Modifies the JAXB code model to initialize fields mapped from schema elements 
  * with their default value.
  */
 public class DefaultValuePlugin {
@@ -105,11 +105,10 @@
                 // Use XML schema object model to determine if field is mapped
                 // from an element (attributes default values are handled
                 // natively) and get its default value.
-
                 XmlString xmlDefaultValue = null;
                 XSType xsType = null;
                 boolean isElement = false;
-
+                boolean isRequiredAttr = true;
                 if (f.getPropertyInfo().getSchemaComponent() instanceof XSParticle) {
                     XSParticle particle = (XSParticle)f.getPropertyInfo().getSchemaComponent();
                     XSTerm term = particle.getTerm();
@@ -126,6 +125,7 @@
                     XSAttributeDecl decl = attributeUse.getDecl();
                     xmlDefaultValue = decl.getDefaultValue();                        
                     xsType = decl.getType();
+                    isRequiredAttr = attributeUse.isRequired();
                 }
 
                 
@@ -143,19 +143,30 @@
                     }
                 }
 
-                if (null == xmlDefaultValue || null == xmlDefaultValue.value) {
-                    continue;
+                JExpression dvExpr = null;
+                if (null != xmlDefaultValue && null != xmlDefaultValue.value) {
+                    dvExpr = getDefaultValueExpression(f, co, outline, xsType, isElement,
+                                                       xmlDefaultValue, false);
                 }
-                
-                JExpression dvExpr = 
-                    getDefaultValueExpression(f, co, outline, xsType, isElement, xmlDefaultValue);
-                
-                if (null == dvExpr) {
+                 
+                if (null == dvExpr
+                    && !isElement && !isRequiredAttr
+                    && xsType != null && xsType.getOwnerSchema() != null
+                    && !"http://www.w3.org/2001/XMLSchema"
+                        .equals(xsType.getOwnerSchema().getTargetNamespace())) {
+                    //non-primitive attribute, may still be able to convert it, but need
to do
+                    //a bunch more checks and changes to setters and isSet and such
+                    dvExpr = 
+                        getDefaultValueExpression(f, co, outline, xsType, isElement, xmlDefaultValue,
true);
+                    
+                    updateSetter(co, f, co.implClass);
+                    updateGetter(co, f, co.implClass, dvExpr, true);                    
+                    
+                } else if (null == dvExpr) {
                     continue;
+                } else {
+                    updateGetter(co, f, co.implClass, dvExpr, false);                   

                 }
-                
-                updateGetter(co, f, co.implClass, dvExpr);               
-                
             }
         }
 
@@ -168,11 +179,14 @@
                                           Outline outline,
                                           XSType xsType,
                                           boolean isElement,
-                                          XmlString xmlDefaultValue
-                                          ) {
+                                          XmlString xmlDefaultValue,
+                                          boolean unbox) {
         JType type = f.getRawType();
         String typeName = type.fullName();
-        String defaultValue = xmlDefaultValue.value;
+        String defaultValue = xmlDefaultValue == null ? null : xmlDefaultValue.value;
+        if (defaultValue == null) {
+            return null;
+        }
 
         JExpression dv = null;
         
@@ -230,12 +244,39 @@
             if (cls.getClassType() == ClassType.ENUM) {
                 dv = cls.staticInvoke("fromValue").arg(defaultValue);
             }
+        } else if (unbox) {
+            typeName = type.unboxify().fullName();
+            if ("int".equals(typeName)) {
+                dv = JExpr.lit(Integer.valueOf(defaultValue).intValue());
+            } else if ("long".equals(typeName)) {
+                dv = JExpr.lit(Long.valueOf(defaultValue).longValue());
+            } else if ("short".equals(typeName)) {
+                dv = JExpr.lit(Short.valueOf(defaultValue).shortValue());
+            } else if ("boolean".equals(typeName)) {
+                dv = JExpr.lit(Boolean.valueOf(defaultValue).booleanValue());
+            } else if ("double".equals(typeName)) {
+                dv = JExpr.lit(Double.valueOf(defaultValue).doubleValue());
+            } else if ("float".equals(typeName)) {
+                dv = JExpr.lit(Float.valueOf(defaultValue).floatValue());
+            } else if ("byte".equals(typeName)) {
+                dv = JExpr.lit(Byte.valueOf(defaultValue).byteValue());
+            } else {
+                dv = getDefaultValueExpression(f,
+                                               co,
+                                               outline,
+                                               xsType,
+                                               true,
+                                               xmlDefaultValue,
+                                               false);
+            }
         }
         // TODO: GregorianCalendar, ...
         return dv;
     }
     
-    private void updateGetter(ClassOutline co, FieldOutline fo, JDefinedClass dc, JExpression
dvExpr) {
+    private void updateGetter(ClassOutline co, FieldOutline fo, 
+                              JDefinedClass dc, JExpression dvExpr,
+                              boolean remapRet) {
 
         String fieldName = fo.getPropertyInfo().getName(false);
         JType type = fo.getRawType();
@@ -248,6 +289,9 @@
         JDocComment doc = method.javadoc();
         int mods = method.mods().getValue();
         JType mtype = method.type();
+        if (remapRet) {
+            mtype = mtype.unboxify();
+        }
 
         if (LOG.isLoggable(Level.FINE)) {
             LOG.fine("Updating getter: " + getterName);
@@ -260,11 +304,55 @@
         method.javadoc().append(doc);
 
         JFieldRef fr = JExpr.ref(fieldName);
+        if (dvExpr != null) {
+            JExpression test = JOp.eq(JExpr._null(), fr);
+            JConditional jc =  method.body()._if(test);
+            jc._then()._return(dvExpr);
+            jc._else()._return(fr);
+        } else {
+            method.body()._return(fr);
+        }
+    }
+    private void updateSetter(ClassOutline co, FieldOutline fo, 
+                              JDefinedClass dc) {
 
-        JExpression test = JOp.eq(JExpr._null(), fr);
-        JConditional jc =  method.body()._if(test);
-        jc._then()._return(dvExpr);
-        jc._else()._return(fr);
+        String fieldName = fo.getPropertyInfo().getName(false);
+        JType type = fo.getRawType();
+        String typeName = type.fullName();
+
+        String getterName = ("java.lang.Boolean".equals(typeName) ? "is" : "get")
+                            + fo.getPropertyInfo().getName(true);
+        JMethod method = dc.getMethod(getterName, new JType[0]);
+        JType mtype = method.type();
+        String setterName = "set" + fo.getPropertyInfo().getName(true);
+        method = dc.getMethod(setterName, new JType[] {mtype});
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Updating setter: " + setterName);
+        }
+        JDocComment doc = method.javadoc();
+        // remove existing method and define new one
+        dc.methods().remove(method);
+
+        int mods = method.mods().getValue();
+        mtype = mtype.unboxify();
+        method = dc.method(mods, method.type(), setterName);
+        
+        method.javadoc().append(doc);
+        method.param(mtype, "value");
+
+        JFieldRef fr = JExpr.ref(fieldName);
+        method.body().assign(fr, JExpr.ref("value"));
+        
+        method = dc.method(mods, method.type(), "unset" + fo.getPropertyInfo().getName(true));
+        method.body().assign(fr, JExpr._null());
+        
+        method = dc.getMethod("isSet" + fo.getPropertyInfo().getName(true), new JType[0]);
+        if (method != null) {
+            //move to end
+            dc.methods().remove(method);
+            dc.methods().add(method);
+        }
+        
     }
 
 }

Modified: cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/build-resources/catalog.cat
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/build-resources/catalog.cat?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/build-resources/catalog.cat
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/build-resources/catalog.cat
Mon Nov  9 21:18:04 2009
@@ -20,5 +20,6 @@
 
 SYSTEM "http://schemas.xmlsoap.org/wsdl/" "../../../../../../common/schemas/src/main/resources/schemas/wsdl/wsdl.xsd"
 SYSTEM "http://cxf.apache.org/schemas/configuration/security.xsd" "../../../../../../common/schemas/src/main/resources/schemas/configuration/security.xsd"
+SYSTEM "http://cxf.apache.org/schemas/configuration/parameterized-types.xsd" "../../../../../../common/schemas/src/main/resources/schemas/configuration/parameterized-types.xsd"
 SYSTEM "http://cxf.apache.org/schemas/wsdl/http-conf.xsd"         "../../../../../../rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd"
 SYSTEM "http://cxf.apache.org/schemas/configuration/http-jetty.xsd" "schemas/configuration/http-jetty.xsd"

Modified: cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd
Mon Nov  9 21:18:04 2009
@@ -26,6 +26,7 @@
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
            xmlns:sec="http://cxf.apache.org/configuration/security"
   		   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  		   xmlns:ptp="http://cxf.apache.org/configuration/parameterized-types" 
   		   xsi:schemaLocation="
   		     http://www.springframework.org/schema/beans
   		       http://www.springframework.org/schema/beans/spring-beans.xsd"
@@ -36,17 +37,18 @@
 
     <xs:import namespace="http://cxf.apache.org/configuration/security"
                schemaLocation="http://cxf.apache.org/schemas/configuration/security.xsd"/>
-    
+    <xs:import namespace="http://cxf.apache.org/configuration/parameterized-types"
+               schemaLocation="http://cxf.apache.org/schemas/configuration/parameterized-types.xsd"/>
     
     <!-- Is this really supposed to be supperceeded by http-conf:HTTPListenerPolicy? -->
     <xs:complexType name="ThreadingParametersType">
-       <xs:attribute name="minThreads" type="xs:unsignedShort">
+       <xs:attribute name="minThreads" type="ptp:ParameterizedUShort">
           <xs:annotation>
              <xs:documentation>Specifies the minimum number of threads available to
the Jetty instance for processing requests.</xs:documentation>
           </xs:annotation>
        </xs:attribute>
-       <xs:attribute name="maxThreads" type="xs:unsignedShort">
-                    <xs:annotation>
+       <xs:attribute name="maxThreads" type="ptp:ParameterizedUShort">
+       <xs:annotation>
              <xs:documentation>Specifies the maximum number of threads available to
the Jetty instance for processing requests.</xs:documentation>
           </xs:annotation>
        </xs:attribute>
@@ -118,11 +120,11 @@
          </xs:choice>         
          <xs:element name="connector" type="xsd:anyType" minOccurs="0"/>
          <xs:element name="handlers" type="xsd:anyType" minOccurs="0"/>
-         <xs:element name="sessionSupport" type="xsd:boolean" minOccurs="0"/>
-         <xs:element name="reuseAddress" type="xsd:boolean" minOccurs="0" />      
   
+         <xs:element name="sessionSupport" type="ptp:ParameterizedBoolean" minOccurs="0"/>
+         <xs:element name="reuseAddress" type="ptp:ParameterizedBoolean" minOccurs="0"
/>          
        </xs:sequence>
        
-       <xs:attribute name="port" type="xs:int" use="required">
+       <xs:attribute name="port" type="ptp:ParameterizedInt" use="required">
              <xs:annotation>
                 <xs:documentation>Specifies the port used by the Jetty instance.
                 You can specify a value of 0 for the port attribute. Any threading 
@@ -139,7 +141,7 @@
                 </xs:documentation>
              </xs:annotation>
        </xs:attribute>
-       <xs:attribute name="continuationsEnabled" type="xs:boolean">
+       <xs:attribute name="continuationsEnabled" type="ptp:ParameterizedBoolean">
            <xs:annotation>
                 <xs:documentation>Specifies if Jetty Continuations will be explicitly
supported
                 by Jetty destinations. Continuations will be checked if this attribute is
set to true or                            omitted, ignored otherwise</xs:documentation>

Modified: cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
Mon Nov  9 21:18:04 2009
@@ -77,10 +77,6 @@
         }
     }
     
-    // This test fails because I think it is trying to read the http-conf.xsd
-    // twice, failing on a duplicate name for 
-    //http://cxf.apache.org/transports/http/configuration,authorization
-    
     @Test
     public void testContext() throws Exception {
         String s4 = getClass()
@@ -90,7 +86,18 @@
             new String[] {S1, S2, S3, s4});
         
         //ctx.refresh();
+        checkContext(ctx);
+    }
+    @Test
+    public void testContextWithProperties() throws Exception {
+        String s4 = getClass()
+            .getResource("/org/apache/cxf/transport/http_jetty/spring/beans-props.xml").toString();
         
+        TestApplicationContext ctx = new TestApplicationContext(
+            new String[] {S1, S2, S3, s4});
+        checkContext(ctx);
+    }
+    private void checkContext(TestApplicationContext ctx) throws Exception {
         ConfigurerImpl cfg = new ConfigurerImpl(ctx);
         
         EndpointInfo info = getEndpointInfo("bla", "Foo", "http://localhost:9000");
@@ -170,4 +177,6 @@
         info2.setAddress(address);
         return info2;
     }
+    
+
 }

Modified: cxf/branches/2.2.x-fixes/rt/transports/http/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http/pom.xml?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/http/pom.xml (original)
+++ cxf/branches/2.2.x-fixes/rt/transports/http/pom.xml Mon Nov  9 21:18:04 2009
@@ -87,6 +87,9 @@
                                     <xsd>${basedir}/src/main/resources/schemas/wsdl/http-conf.xsd</xsd>
                                     <bindingFile>${basedir}/src/main/resources/schemas/wsdl/http-conf.xjb</bindingFile>
                                     <catalog>${basedir}/src/main/build-resources/catalog.cat</catalog>
+                                    <extensionArgs>
+                                        <extensionArg>-Xdv</extensionArg>
+                                    </extensionArgs>
                                     <deleteDirs>
                                         <deleteDir>${basedir}/target/generated/src/main/java/org/apache/cxf/wsdl</deleteDir>
                                     </deleteDirs>

Modified: cxf/branches/2.2.x-fixes/rt/transports/http/src/main/build-resources/catalog.cat
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http/src/main/build-resources/catalog.cat?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/http/src/main/build-resources/catalog.cat (original)
+++ cxf/branches/2.2.x-fixes/rt/transports/http/src/main/build-resources/catalog.cat Mon Nov
 9 21:18:04 2009
@@ -20,5 +20,6 @@
 
 SYSTEM "http://schemas.xmlsoap.org/wsdl/" "../../../../../../common/schemas/src/main/resources/schemas/wsdl/wsdl.xsd"
 SYSTEM "http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd" "../../../../../../common/schemas/src/main/resources/schemas/wsdl/wsdl.xsd"
+SYSTEM "http://cxf.apache.org/schemas/configuration/parameterized-types.xsd" "../../../../../../common/schemas/src/main/resources/schemas/configuration/parameterized-types.xsd"
 SYSTEM "http://cxf.apache.org/schemas/configuration/security.xsd" "../../../../../../common/schemas/src/main/resources/schemas/configuration/security.xsd"
 SYSTEM "http://cxf.apache.org/schemas/wsdl/http-conf.xsd" "schemas/wsdl/http-conf.xsd"

Modified: cxf/branches/2.2.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
Mon Nov  9 21:18:04 2009
@@ -20,6 +20,7 @@
 
 <xs:schema targetNamespace="http://cxf.apache.org/transports/http/configuration" 
            xmlns:http-conf="http://cxf.apache.org/transports/http/configuration" 
+           xmlns:ptp="http://cxf.apache.org/configuration/parameterized-types" 
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -30,9 +31,12 @@
 
     <xs:import namespace="http://schemas.xmlsoap.org/wsdl/" 
         schemaLocation="http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd"/>
+    <xs:import namespace="http://cxf.apache.org/configuration/parameterized-types"
+        schemaLocation="http://cxf.apache.org/schemas/configuration/parameterized-types.xsd"/>
     
     <xs:element name="server" type="http-conf:HTTPServerPolicy"/>
     <xs:element name="client" type="http-conf:HTTPClientPolicy"/>
+    
     <xs:element name="contextMatchStrategy" type="xs:string" default="stem"/>
     <xs:element name="fixedParameterOrder"  type="xs:boolean" default="false"/>
     
@@ -163,7 +167,7 @@
         <xs:complexContent>
             <xs:extension base="wsdl:tExtensibilityElement">
 
-                <xs:attribute name="ConnectionTimeout" type="xs:unsignedInt" use="optional"
default="30000">
+                <xs:attribute name="ConnectionTimeout" type="ptp:ParameterizedUInt" use="optional"
default="30000">
                     <xs:annotation>
                         <xs:documentation>
                         Specifies the amount of time, in milliseconds, that the consumer
will attempt to establish a connection before it times out. 0 is infinite.
@@ -171,7 +175,7 @@
                     </xs:annotation>      
                 </xs:attribute>
 
-                <xs:attribute name="ReceiveTimeout" type="xs:unsignedInt" use="optional"
default="60000">
+                <xs:attribute name="ReceiveTimeout" type="ptp:ParameterizedUInt" use="optional"
default="60000">
                     <xs:annotation>
                         <xs:documentation>
                         Specifies the amount of time, in milliseconds, that the consumer
will wait for a response before it times out. 0 is infinite.
@@ -179,7 +183,7 @@
                     </xs:annotation>      
                 </xs:attribute>
 
-                <xs:attribute name="AutoRedirect" type="xs:boolean" use="optional" default="false">
+                <xs:attribute name="AutoRedirect" type="ptp:ParameterizedBoolean" use="optional"
default="false">
                     <xs:annotation>
                         <xs:documentation>
                        Specifies if the consumer will automatically follow a server issued
redirection.
@@ -188,7 +192,7 @@
                     </xs:annotation>      
                 </xs:attribute>
 
-                <xs:attribute name="MaxRetransmits" type="xs:int" use="optional" default="-1">
+                <xs:attribute name="MaxRetransmits" type="ptp:ParameterizedInt" use="optional"
default="-1">
                     <xs:annotation>
                         <xs:documentation>
                         Specifies the maximum amount of retransmits that are allowed for
redirects. Retransmits for 
@@ -202,7 +206,7 @@
                     </xs:annotation>      
                 </xs:attribute>
 
-                <xs:attribute name="AllowChunking" type="xs:boolean" use="optional" default="true">
+                <xs:attribute name="AllowChunking" type="ptp:ParameterizedBoolean" use="optional"
default="true">
                     <xs:annotation>
                         <xs:documentation>
                         If true, the client is free to use chunking streams if it wants,
but it is not 
@@ -211,7 +215,7 @@
                         </xs:documentation>
                     </xs:annotation>      
                 </xs:attribute>
-                <xs:attribute name="ChunkingThreshold" type="xs:int" use="optional" default="4096">
+                <xs:attribute name="ChunkingThreshold" type="ptp:ParameterizedInt" use="optional"
default="4096">
                     <xs:annotation>
                         <xs:documentation>
                         If AllowChunking is true, this sets the threshold at which messages
start
@@ -338,7 +342,7 @@
                         </xs:documentation>
                     </xs:annotation>      
                 </xs:attribute>
-                <xs:attribute name="ProxyServerPort" type="xs:int" use="optional">
+                <xs:attribute name="ProxyServerPort" type="ptp:ParameterizedInt" use="optional">
                     <xs:annotation>
                         <xs:documentation>
                         Specifies the port number used by the proxy server.

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/pom.xml?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/pom.xml (original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/pom.xml Mon Nov  9 21:18:04 2009
@@ -124,6 +124,9 @@
                                     <deleteDirs>
                                         <deleteDir>${basedir}/target/generated/src/main/java/org/apache/cxf/wsdl</deleteDir>
                                     </deleteDirs>
+                                    <extensionArgs>
+                                         <extensionArg>-Xdv</extensionArg>
+                                     </extensionArgs>
                                 </xsdOption>
                             </xsdOptions>
                         </configuration>
@@ -132,6 +135,18 @@
                         </goals>
                     </execution>
                 </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.cxf</groupId>
+                        <artifactId>cxf-xjc-dv</artifactId>
+                        <version>${project.version}</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.cxf</groupId>
+                        <artifactId>cxf-common-utilities</artifactId>
+                        <version>${project.version}</version>
+                    </dependency>
+                </dependencies>
             </plugin>
         </plugins>
     </build>

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/build-resources/catalog.cat
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/build-resources/catalog.cat?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/build-resources/catalog.cat (original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/build-resources/catalog.cat Mon Nov
 9 21:18:04 2009
@@ -20,4 +20,6 @@
 
 SYSTEM "http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd" "../../../../../../common/schemas/src/main/resources/schemas/wsdl/wsdl.xsd"
 SYSTEM "http://schemas.xmlsoap.org/wsdl/" "../../../../../../common/schemas/src/main/resources/schemas/wsdl/wsdl.xsd"
+SYSTEM "http://cxf.apache.org/schemas/configuration/parameterized-types.xsd" "../../../../../../common/schemas/src/main/resources/schemas/configuration/parameterized-types.xsd"
+
 

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd (original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd Mon
Nov  9 21:18:04 2009
@@ -21,11 +21,14 @@
   xmlns:jms="http://cxf.apache.org/transports/jms" 
   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
   xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 
-  targetNamespace="http://cxf.apache.org/transports/jms" 
+  targetNamespace="http://cxf.apache.org/transports/jms"
+  xmlns:pt="http://cxf.apache.org/configuration/parameterized-types" 
   elementFormDefault="qualified" jaxb:version="2.0">
   
     <xs:import namespace="http://schemas.xmlsoap.org/wsdl/"
         schemaLocation="http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd"/>
+    <xs:import namespace="http://cxf.apache.org/configuration/parameterized-types"
+        schemaLocation="http://cxf.apache.org/schemas/configuration/parameterized-types.xsd"/>
     
     <!-- Valid wsdl elements -->
     <xs:element name="client" type="jms:ClientBehaviorPolicyType"/>
@@ -41,8 +44,8 @@
         </xs:annotation>
         <xs:complexContent>
             <xs:extension base="wsdl:tExtensibilityElement">
-        		<xs:attribute name="lowWaterMark" type="xs:int" default="20"/>
-        		<xs:attribute name="highWaterMark" type="xs:int" default="500" />
+        		<xs:attribute name="lowWaterMark" type="pt:ParameterizedInt" default="20"/>
+        		<xs:attribute name="highWaterMark" type="pt:ParameterizedInt" default="500"
/>
         	</xs:extension>
 		</xs:complexContent>
     </xs:complexType>
@@ -50,13 +53,13 @@
     <xs:complexType name="ClientConfig">
     	<xs:complexContent>
     		<xs:extension base="wsdl:tExtensibilityElement">
-    			<xs:attribute name="clientReceiveTimeout" type="xs:long"
+    			<xs:attribute name="clientReceiveTimeout" type="pt:ParameterizedLong"
     				default="60000" />
-    			<xs:attribute name="messageTimeToLive" type="xs:long"
+    			<xs:attribute name="messageTimeToLive" type="pt:ParameterizedLong"
     				default="0" />
                 <xs:attribute name="conduitSelectorPrefix" type="xs:string" use="optional"
default=""/>    				
-                <xs:attribute name="useConduitIdSelector" type="xs:boolean" use="optional"/>
-                <xs:attribute name="enforceSpec" type="xs:boolean" use="optional" default="true"/>
+                <xs:attribute name="useConduitIdSelector" type="pt:ParameterizedBoolean"
use="optional"/>
+                <xs:attribute name="enforceSpec" type="pt:ParameterizedBoolean" use="optional"
default="true"/>
     		</xs:extension>
     	</xs:complexContent>
     </xs:complexType>
@@ -64,7 +67,7 @@
     <xs:complexType name="ServerConfig">
 		<xs:complexContent>
             <xs:extension base="wsdl:tExtensibilityElement">
-        		<xs:attribute name="messageTimeToLive" type="xs:long" default="0" />
+        		<xs:attribute name="messageTimeToLive" type="pt:ParameterizedLong" default="0"
/>
         		<xs:attribute name="durableSubscriptionClientId" type="xs:string" />
 			</xs:extension>
 		</xs:complexContent>        	
@@ -85,19 +88,19 @@
             <xs:element name="property" type="jms:JMSPropertyType" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
         <xs:attribute name="JMSCorrelationID" type="xs:string"/>
-        <xs:attribute name="JMSDeliveryMode" type="xs:int"/>
-        <xs:attribute name="JMSExpiration" type="xs:long"/>
+        <xs:attribute name="JMSDeliveryMode" type="pt:ParameterizedInt"/>
+        <xs:attribute name="JMSExpiration" type="pt:ParameterizedLong"/>
         <xs:attribute name="JMSMessageID" type="xs:string"/>
-        <xs:attribute name="JMSPriority" type="xs:int"/>
-        <xs:attribute name="JMSRedelivered" type="xs:boolean"/>
+        <xs:attribute name="JMSPriority" type="pt:ParameterizedInt"/>
+        <xs:attribute name="JMSRedelivered" type="pt:ParameterizedBoolean"/>
         <xs:attribute name="JMSReplyTo" type="xs:string"/>
-        <xs:attribute name="JMSTimeStamp" type="xs:long"/>
+        <xs:attribute name="JMSTimeStamp" type="pt:ParameterizedLong"/>
         <xs:attribute name="JMSType" type="xs:string"/>
-        <xs:attribute name="TimeToLive" type="xs:long"/>
+        <xs:attribute name="TimeToLive" type="pt:ParameterizedLong"/>
     </xs:complexType>
     
     <xs:simpleType name="JMSClientReceiveTimeOut">
-        <xs:restriction base="xs:long"/>
+        <xs:restriction base="pt:ParameterizedLong"/>
     </xs:simpleType>
     
     <xs:simpleType name="DestinationStyleType">
@@ -221,8 +224,8 @@
     					</xs:documentation>
     				</xs:annotation>
     			</xs:attribute>
-    			<xs:attribute name="useJms11" type="xs:boolean" use="optional"/>
-    			<xs:attribute name="reconnectOnException" type="xs:boolean" use="optional"/>
+    			<xs:attribute name="useJms11" type="pt:ParameterizedBoolean" use="optional"/>
+    			<xs:attribute name="reconnectOnException" type="pt:ParameterizedBoolean" use="optional"/>
     		</xs:extension>
     	</xs:complexContent>
     </xs:complexType>
@@ -257,14 +260,14 @@
                         </xs:documentation>
                     </xs:annotation>
                 </xs:attribute>
-                <xs:attribute name="useMessageIDAsCorrelationID" type="xs:boolean" default="false">
+                <xs:attribute name="useMessageIDAsCorrelationID" type="pt:ParameterizedBoolean"
default="false">
                     <xs:annotation>
                         <xs:documentation>
                           Flag to indicate whether to use JMS Message Id as correlation ID.
It is serverside only so should go in ServerPolicy
                         </xs:documentation>
                     </xs:annotation>
                 </xs:attribute>
-                <xs:attribute name="transactional" type="xs:boolean" default="false">
+                <xs:attribute name="transactional" type="pt:ParameterizedBoolean" default="false">
                     <xs:annotation>
                         <xs:documentation>
                           Flag to specify whether to use JMS transaction support on server
side.

Modified: cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java?rev=834239&r1=834238&r2=834239&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
Mon Nov  9 21:18:04 2009
@@ -45,6 +45,7 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.catalog.OASISCatalogManager;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
@@ -174,10 +175,23 @@
         return dir;
     }
 
+        
     protected List<InputSource> getDefaultSchemas() throws IOException {
         List<InputSource> xsdList = new ArrayList<InputSource>();
+        URL url = ClassLoaderUtils.getResource("/schemas/configuration/parameterized-types.xsd",
+                                               this.getClass());
+        if (url != null) {
+            InputSource is = new InputSource(url.openStream());
+            is.setSystemId(url.toString());
+            xsdList.add(is);
+        }
+        addDefaultSchemas(ToolConstants.CXF_SCHEMAS_DIR_INJAR, xsdList);
+        
+        return xsdList;
+    }
+    private void addDefaultSchemas(String location, List<InputSource> xsdList) throws
IOException {
         ClassLoader clzLoader = Thread.currentThread().getContextClassLoader();
-        Enumeration<URL> urls = clzLoader.getResources(ToolConstants.CXF_SCHEMAS_DIR_INJAR);
+        Enumeration<URL> urls = clzLoader.getResources(location);
         while (urls.hasMoreElements()) {
             URL url = urls.nextElement();
             //from jar files 
@@ -238,7 +252,6 @@
         }
         
         sort(xsdList);
-        return xsdList;
     }
 
     private void sort(List<InputSource> list) {



Mime
View raw message