cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1506431 - in /cxf/trunk/rt: core/src/main/java/org/apache/cxf/configuration/blueprint/ transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/
Date Wed, 24 Jul 2013 08:02:54 GMT
Author: ffang
Date: Wed Jul 24 08:02:53 2013
New Revision: 1506431

URL: http://svn.apache.org/r1506431
Log:
[CXF-5148]extract mapElementToHolder method to parent class

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpDestinationBPBeanDefinitionParser.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java?rev=1506431&r1=1506430&r2=1506431&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/configuration/blueprint/AbstractBPBeanDefinitionParser.java
Wed Jul 24 08:02:53 2013
@@ -46,6 +46,7 @@ import org.apache.cxf.common.logging.Log
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.staxutils.StaxUtils;
 import org.osgi.framework.Bundle;
 import org.osgi.service.blueprint.reflect.BeanMetadata;
 import org.osgi.service.blueprint.reflect.CollectionMetadata;
@@ -334,6 +335,32 @@ public abstract class AbstractBPBeanDefi
             LOG.warning("Unable to parse property " + propertyName + " due to " + e);
         }
     }
+    
+    protected void mapElementToHolder(ParserContext ctx, MutableBeanMetadata bean, Element
parent, QName name,
+                                    String propertyName, Class<?> cls) {
+        Element data = DOMUtils.getFirstChildWithName(parent, name);
+        if (data == null) {
+            return;
+        }
+        MutableBeanMetadata ef = ctx.createMetadata(MutableBeanMetadata.class);
+
+        ef.setRuntimeClass(cls);
+
+        try {
+            // Print the DOM node
+
+            String xmlString = StaxUtils.toString(data);
+            ef.addProperty("parsedElement", createValue(ctx, xmlString));
+            ef.setInitMethod("init");
+
+            ef.setActivation(ComponentMetadata.ACTIVATION_EAGER);
+            bean.addProperty(propertyName, ef);
+
+        } catch (Exception e) {
+            throw new RuntimeException("Could not process configuration.", e);
+        }
+
+    }
 
     protected synchronized JAXBContext getContext(Class<?> cls) {
         if (jaxbContext == null || jaxbClasses == null || !jaxbClasses.contains(cls)) {

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java?rev=1506431&r1=1506430&r2=1506431&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpConduitBPBeanDefinitionParser.java
Wed Jul 24 08:02:53 2013
@@ -37,12 +37,9 @@ import org.apache.cxf.configuration.secu
 import org.apache.cxf.configuration.security.SecureRandomParameters;
 import org.apache.cxf.configuration.security.TLSClientParametersType;
 import org.apache.cxf.configuration.security.TrustManagersType;
-import org.apache.cxf.helpers.DOMUtils;
-import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.transport.http.HTTPConduit;
 import org.apache.cxf.transport.http.MessageTrustDecider;
 import org.apache.cxf.transport.http.auth.HttpAuthSupplier;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
 import org.osgi.service.blueprint.reflect.Metadata;
 
 public class HttpConduitBPBeanDefinitionParser extends AbstractBPBeanDefinitionParser {
@@ -174,29 +171,5 @@ public class HttpConduitBPBeanDefinition
         }
     }
     
-    private void mapElementToHolder(ParserContext ctx, MutableBeanMetadata bean, Element
parent,
-                                          QName name, String propertyName, Class<?>
cls) {
-        Element data = DOMUtils.getFirstChildWithName(parent, name);
-        if (data == null) {
-            return;
-        }
-        MutableBeanMetadata ef = ctx.createMetadata(MutableBeanMetadata.class);
-
-        ef.setRuntimeClass(cls);
-
-        try {
-            // Print the DOM node
-
-            String xmlString = StaxUtils.toString(data);
-            ef.addProperty("parsedElement", createValue(ctx, xmlString));
-            ef.setInitMethod("init");
-
-            ef.setActivation(ComponentMetadata.ACTIVATION_EAGER);
-            bean.addProperty(propertyName, ef);
-
-        } catch (Exception e) {
-            throw new RuntimeException("Could not process configuration.", e);
-        }
-
-    }
+    
 }

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpDestinationBPBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpDestinationBPBeanDefinitionParser.java?rev=1506431&r1=1506430&r2=1506431&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpDestinationBPBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/blueprint/HttpDestinationBPBeanDefinitionParser.java
Wed Jul 24 08:02:53 2013
@@ -32,10 +32,7 @@ import org.apache.aries.blueprint.mutabl
 import org.apache.aries.blueprint.mutable.MutableValueMetadata;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser;
-import org.apache.cxf.helpers.DOMUtils;
-import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.transport.http.AbstractHTTPDestination;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
 import org.osgi.service.blueprint.reflect.Metadata;
 
 public class HttpDestinationBPBeanDefinitionParser extends AbstractBPBeanDefinitionParser
{
@@ -85,32 +82,5 @@ public class HttpDestinationBPBeanDefini
         }
     }
     
-    private void mapElementToHolder(ParserContext ctx,
-                                            MutableBeanMetadata bean, Element parent, 
-                                            QName name,
-                                            String propertyName,
-                                            Class<?> cls) {
-        Element data = DOMUtils.getFirstChildWithName(parent, name);
-        if (data == null) {
-            return;
-        }
-        MutableBeanMetadata ef = ctx.createMetadata(MutableBeanMetadata.class);
-        
-        ef.setRuntimeClass(cls);
-
-        try {
-            // Print the DOM node
-
-            String xmlString = StaxUtils.toString(data);
-            ef.addProperty("parsedElement", createValue(ctx, xmlString));
-            ef.setInitMethod("init");
-
-            ef.setActivation(ComponentMetadata.ACTIVATION_EAGER);
-            bean.addProperty(propertyName, ef);
-            
-        } catch (Exception e) {
-            throw new RuntimeException("Could not process configuration.", e);
-        }
-        
-    }
+    
 }



Mime
View raw message