cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1363784 - in /cxf/branches/2.6.x-fixes: ./ api/src/main/java/org/apache/cxf/configuration/jsse/ rt/core/src/main/java/org/apache/cxf/configuration/blueprint/ rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/ rt/tran...
Date Fri, 20 Jul 2012 14:01:13 GMT
Author: ay
Date: Fri Jul 20 14:01:12 2012
New Revision: 1363784

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

........
  r1363782 | ay | 2012-07-20 15:57:32 +0200 (Fri, 20 Jul 2012) | 1 line
  
  clean up for CXF-4423
........

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParametersConfig.java
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
    cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
    cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java

Propchange: cxf/branches/2.6.x-fixes/
            ('svn:mergeinfo' removed)

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

Modified: cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParametersConfig.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParametersConfig.java?rev=1363784&r1=1363783&r2=1363784&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParametersConfig.java
(original)
+++ cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParametersConfig.java
Fri Jul 20 14:01:12 2012
@@ -32,8 +32,6 @@ import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.stream.XMLStreamReader;
 
-import org.w3c.dom.Node;
-
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.common.jaxb.JAXBContextCache;
 import org.apache.cxf.common.jaxb.JAXBContextCache.CachedContextAndSchemas;
@@ -160,21 +158,6 @@ public final class TLSClientParametersCo
         }
     }
     
-    public static <T> T createTLSClientParameter(Node data, Class<T> cls) {
-        Unmarshaller u;
-        try {
-            u = getContext().createUnmarshaller();
-            Object obj = u.unmarshal(data, cls);
-            if (obj instanceof JAXBElement<?>) {
-                JAXBElement<?> el = (JAXBElement<?>)obj;
-                obj = el.getValue();
-            }
-            return cls.cast(obj);
-        } catch (JAXBException e) {
-            throw new RuntimeException("Could not parse configuration.", e);
-        }
-    }
-    
     public static class TLSClientParametersTypeInternal extends TLSClientParametersType {
         private KeyManager[] keyManagersRef;
         private TrustManager[] trustManagersRef;

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java?rev=1363784&r1=1363783&r2=1363784&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
Fri Jul 20 14:01:12 2012
@@ -313,12 +313,18 @@ public abstract class AbstractBPBeanDefi
                                             QName name,
                                             String propertyName, 
                                             Class<?> c) {
-
         Element data = DOMUtils.getFirstChildWithName(parent, name);
         if (data == null) {
             return;
         }
-        
+
+        mapElementToJaxbProperty(ctx, bean, data, propertyName, c);
+    }
+
+    protected void mapElementToJaxbProperty(ParserContext ctx,
+                                            MutableBeanMetadata bean, Element data, 
+                                            String propertyName, 
+                                            Class<?> c) {
         try {
             Unmarshaller unmarshaller = getContext(c).createUnmarshaller();
             MutablePassThroughMetadata value = ctx.createMetadata(MutablePassThroughMetadata.class);

Modified: cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java?rev=1363784&r1=1363783&r2=1363784&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
Fri Jul 20 14:01:12 2012
@@ -126,34 +126,28 @@ public class HttpConduitBPBeanDefinition
                 if (ref != null && ref.length() > 0) {
                     paramsbean.addProperty("keyManagersRef", createRef(ctx, ref));
                 } else {
-                    paramsbean.addProperty(ename, 
-                        createPassThrough(ctx, 
-                            TLSClientParametersConfig.createTLSClientParameter(n, KeyManagersType.class)));
+                    mapElementToJaxbProperty(ctx, paramsbean, (Element)n, ename, 
+                                             KeyManagersType.class);
                 }
             } else if ("trustManagers".equals(ename)) {
                 if (ref != null && ref.length() > 0) {
                     paramsbean.addProperty("trustManagersRef", createRef(ctx, ref));
                 } else {
-                    paramsbean.addProperty(ename,
-                        createPassThrough(ctx, 
-                            TLSClientParametersConfig.createTLSClientParameter(n, TrustManagersType.class)));
+                    mapElementToJaxbProperty(ctx, paramsbean, (Element)n, ename, 
+                                             TrustManagersType.class);
                 }
             } else if ("cipherSuites".equals(ename)) {
-                paramsbean.addProperty(ename,
-                    createPassThrough(ctx, 
-                        TLSClientParametersConfig.createTLSClientParameter(n, CipherSuites.class)));
+                mapElementToJaxbProperty(ctx, paramsbean, (Element)n, ename,
+                                         CipherSuites.class);
             } else if ("cipherSuitesFilter".equals(ename)) {
-                paramsbean.addProperty(ename,
-                    createPassThrough(ctx, 
-                        TLSClientParametersConfig.createTLSClientParameter(n, FiltersType.class)));
+                mapElementToJaxbProperty(ctx, paramsbean, (Element)n, ename,
+                                         FiltersType.class);
             } else if ("secureRandomParameters".equals(ename)) {
-                paramsbean.addProperty(ename,
-                    createPassThrough(ctx,
-                        TLSClientParametersConfig.createTLSClientParameter(n, SecureRandomParameters.class)));
+                mapElementToJaxbProperty(ctx, paramsbean, (Element)n, ename,
+                                         SecureRandomParameters.class);
             } else if ("certConstraints".equals(ename)) {
-                paramsbean.addProperty(ename,
-                    createPassThrough(ctx,
-                        TLSClientParametersConfig.createTLSClientParameter(n, CertificateConstraintsType.class)));
+                mapElementToJaxbProperty(ctx, paramsbean, (Element)n, ename,
+                                         CertificateConstraintsType.class);
             } else if ("certAlias".equals(ename)) {
                 paramsbean.addProperty(ename, createValue(ctx, n.getTextContent()));
             }

Modified: cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java?rev=1363784&r1=1363783&r2=1363784&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java
Fri Jul 20 14:01:12 2012
@@ -145,28 +145,28 @@ public class HttpConduitBeanDefinitionPa
                 if (ref != null && ref.length() > 0) {
                     paramsbean.addPropertyReference("keyManagersRef", ref);
                 } else {
-                    paramsbean.addPropertyValue(ename, 
-                        TLSClientParametersConfig.createTLSClientParameter(n, KeyManagersType.class));
+                    mapElementToJaxbProperty((Element)n, paramsbean, ename, 
+                                             KeyManagersType.class);
                 }
             } else if ("trustManagers".equals(ename)) {
                 if (ref != null && ref.length() > 0) {
                     paramsbean.addPropertyReference("trustManagersRef", ref);
                 } else {
-                    paramsbean.addPropertyValue(ename, 
-                        TLSClientParametersConfig.createTLSClientParameter(n, TrustManagersType.class));
+                    mapElementToJaxbProperty((Element)n, paramsbean, ename, 
+                                             TrustManagersType.class);                  
 
                 }
             } else if ("cipherSuites".equals(ename)) {
-                paramsbean.addPropertyValue(ename,
-                    TLSClientParametersConfig.createTLSClientParameter(n, CipherSuites.class));
+                mapElementToJaxbProperty((Element)n, paramsbean, ename, 
+                                         CipherSuites.class);
             } else if ("cipherSuitesFilter".equals(ename)) {
-                paramsbean.addPropertyValue(ename,
-                    TLSClientParametersConfig.createTLSClientParameter(n, FiltersType.class));
+                mapElementToJaxbProperty((Element)n, paramsbean, ename,
+                                         FiltersType.class);
             } else if ("secureRandomParameters".equals(ename)) {
-                paramsbean.addPropertyValue(ename,
-                    TLSClientParametersConfig.createTLSClientParameter(n, SecureRandomParameters.class));
+                mapElementToJaxbProperty((Element)n, paramsbean, ename,
+                                         SecureRandomParameters.class);
             } else if ("certConstraints".equals(ename)) {
-                paramsbean.addPropertyValue(ename,
-                    TLSClientParametersConfig.createTLSClientParameter(n, CertificateConstraintsType.class));
+                mapElementToJaxbProperty((Element)n, paramsbean, ename,
+                                         CertificateConstraintsType.class);
             } else if ("certAlias".equals(ename)) {
                 paramsbean.addPropertyValue(ename, n.getTextContent());
             }



Mime
View raw message