cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/2] cxf git commit: Remove some more JAXWS 2.1 code
Date Wed, 08 Apr 2015 23:20:03 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 40a8c9247 -> bef3d8408


Remove some more JAXWS 2.1 code


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/bef3d840
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/bef3d840
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/bef3d840

Branch: refs/heads/master
Commit: bef3d8408feb07365e17ca6960db7b4b2f1436ec
Parents: 4f91a20
Author: Daniel Kulp <dkulp@apache.org>
Authored: Wed Apr 8 12:24:44 2015 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Wed Apr 8 19:19:54 2015 -0400

----------------------------------------------------------------------
 .../blueprint/EndpointDefinitionParser.java     | 17 +-----------
 .../org/apache/cxf/jaxws/spi/ProviderImpl.java  | 27 +-------------------
 .../cxf/jaxws/support/JaxWsEndpointImpl.java    | 14 +---------
 .../jaxws/support/JaxWsServiceFactoryBean.java  | 22 +++-------------
 4 files changed, 6 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/bef3d840/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/EndpointDefinitionParser.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/EndpointDefinitionParser.java
b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/EndpointDefinitionParser.java
index f2aec98..ae65c57 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/EndpointDefinitionParser.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/EndpointDefinitionParser.java
@@ -29,29 +29,14 @@ import org.w3c.dom.NamedNodeMap;
 import org.apache.aries.blueprint.ParserContext;
 import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
 import org.apache.cxf.Bus;
-import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.jaxws.EndpointImpl;
-import org.apache.cxf.jaxws.spi.ProviderImpl;
 import org.osgi.service.blueprint.reflect.Metadata;
 
 class EndpointDefinitionParser extends AbstractBPBeanDefinitionParser {
-    private static final Class<?> EP_CLASS;
-    static {
-        Class<?> cls = EndpointImpl.class;
-        try {
-            if (ProviderImpl.isJaxWs22()) {
-                cls = ClassLoaderUtils
-                    .loadClass("org.apache.cxf.jaxws22.JAXWS22EndpointImpl", 
-                           EndpointDefinitionParser.class);
-            }
-        } catch (Throwable t) {
-            cls = EndpointImpl.class;
-        }
-        EP_CLASS = cls;
-    }
+    private static final Class<?> EP_CLASS = EndpointImpl.class;
     public static String getIdOrName(Element elem) {
         String id = elem.getAttribute("id");
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/bef3d840/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java
index 29f968a..87b3830 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.jaxws.spi;
 
-import java.lang.reflect.Method;
 import java.net.URL;
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
@@ -51,7 +50,6 @@ import org.w3c.dom.Element;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
-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.feature.Feature;
@@ -76,30 +74,7 @@ public class ProviderImpl extends javax.xml.ws.spi.Provider {
     public static final String JAXWS_PROVIDER = ProviderImpl.class.getName();
     protected static final Logger LOG = LogUtils.getL7dLogger(ProviderImpl.class);
     private static JAXBContext jaxbContext;
-    private static final boolean JAXWS_22;
-    static {
-        boolean b = false;
-        try {
-            //JAX-WS 2.2 would have the HttpContext class in the classloader
-            Class<?> cls = ClassLoaderUtils.loadClass("javax.xml.ws.spi.http.HttpContext",

-                                                      ProviderImpl.class);
-            //In addition to that, the Endpoint class we pick up on the classloader
-            //should have a publish method that uses it.  Otherwise, we MAY be
-            //be getting the HttpContext from the 2.2 jaxws-api jar, but the Endpoint
-            //class from the 2.1 JRE
-            Method m = Endpoint.class.getMethod("publish", cls);
-            b = m != null;
-        } catch (Throwable ex) {
-            b = false;
-        }
-        JAXWS_22 = b;
-    }
-    
-    
-    public static boolean isJaxWs22() {
-        return JAXWS_22;
-    }
-    
+
     @Override
     public ServiceDelegate createServiceDelegate(URL url, QName qname,
                                                  @SuppressWarnings("rawtypes") Class cls)
{

http://git-wip-us.apache.org/repos/asf/cxf/blob/bef3d840/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
index b3584cf..08f1819 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.jaxws.support;
 
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
@@ -49,7 +48,6 @@ import org.apache.cxf.binding.soap.SoapBinding;
 import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor;
 import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
 import org.apache.cxf.binding.xml.XMLBinding;
-import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.endpoint.EndpointException;
 import org.apache.cxf.endpoint.EndpointImpl;
@@ -467,17 +465,7 @@ public class JaxWsEndpointImpl extends EndpointImpl {
                 addAddressingFeature(feature);
             }
             feature.setAddressingRequired(addressing.isRequired());
-            if (ProviderImpl.isJaxWs22()) {
-                try {
-                    Class<?> addrClass = ClassLoaderUtils.loadClass("javax.xml.ws.soap.AddressingFeature",
-                                                                    ProviderImpl.class);
-                    Method responsesMethod = addrClass.getMethod("getResponses", new Class[]
{});
-                    Object responses = responsesMethod.invoke(addressing, new Object[] {});
-                    feature.setResponses(responses.toString());
-                } catch (Exception e) {
-                    // ignore
-                }
-            }
+            feature.setResponses(addressing.getResponses().toString());
         } else {
             removeAddressingFeature();
             getEndpointInfo().setProperty("org.apache.cxf.ws.addressing.MAPAggregator.addressingDisabled",

http://git-wip-us.apache.org/repos/asf/cxf/blob/bef3d840/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
index 0524e9e..f39857b 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
@@ -70,7 +70,6 @@ import org.apache.cxf.jaxws.JAXWSMethodInvoker;
 import org.apache.cxf.jaxws.JAXWSProviderMethodDispatcher;
 import org.apache.cxf.jaxws.WrapperClassGenerator;
 import org.apache.cxf.jaxws.interceptors.WebFaultOutInterceptor;
-import org.apache.cxf.jaxws.spi.ProviderImpl;
 import org.apache.cxf.service.factory.FactoryBeanListener;
 import org.apache.cxf.service.factory.FactoryBeanListener.Event;
 import org.apache.cxf.service.factory.ServiceConstructionException;
@@ -171,24 +170,9 @@ public class JaxWsServiceFactoryBean extends ReflectionServiceFactoryBean
{
         }
 
         if (addressing != null) {
-            if (ProviderImpl.isJaxWs22()) {
-                try {
-                    Method method = Addressing.class.getMethod("responses", new Class<?>[]{});
-                    Object responses = method.invoke(addressing, new Object[]{});
-                    java.lang.reflect.Constructor<?> constructor =
-                        AddressingFeature.class.getConstructor(new Class[] {
-                            boolean.class, boolean.class, responses.getClass()
-                        });
-                    Object obj = constructor.newInstance(addressing.enabled(), addressing.required(),
-                                                         responses);
-                    features.add((WebServiceFeature)obj);
-                } catch (Exception e) {
-                    features.add(new AddressingFeature(addressing.enabled(), addressing.required()));
-                }
-            } else {
-                features.add(new AddressingFeature(addressing.enabled(), addressing.required()));
-            }
-
+            features.add(new AddressingFeature(addressing.enabled(), 
+                                               addressing.required(),
+                                               addressing.responses()));
         }
 
         RespectBinding respectBinding = implInfo.getImplementorClass().getAnnotation(


Mime
View raw message