cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r545482 - in /incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws: DispatchImpl.java support/JaxWsEndpointImpl.java
Date Fri, 08 Jun 2007 11:37:14 GMT
Author: jliu
Date: Fri Jun  8 04:37:13 2007
New Revision: 545482

URL: http://svn.apache.org/viewvc?view=rev&rev=545482
Log:
Removed unnecessary interceptors for Dispatch.

Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java?view=diff&rev=545482&r1=545481&r2=545482
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
Fri Jun  8 04:37:13 2007
@@ -36,6 +36,7 @@
 import javax.xml.soap.SOAPFactory;
 import javax.xml.soap.SOAPFault;
 import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Binding;
 import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Dispatch;
 import javax.xml.ws.Response;
@@ -47,12 +48,16 @@
 import javax.xml.ws.soap.SOAPFaultException;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.binding.soap.SoapBinding;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.endpoint.ConduitSelector;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.UpfrontConduitSelector;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.interceptor.MessageSenderInterceptor;
+import org.apache.cxf.jaxws.handler.logical.LogicalHandlerInInterceptor;
+import org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor;
 import org.apache.cxf.jaxws.interceptors.DispatchInInterceptor;
 import org.apache.cxf.jaxws.interceptors.DispatchOutInterceptor;
 import org.apache.cxf.jaxws.support.ContextPropertiesMapping;
@@ -215,17 +220,22 @@
             LOG.fine("Interceptors contributed by bus: " + il);
         }
         chain.add(il);
-        il = endpoint.getOutInterceptors();
-        if (LOG.isLoggable(Level.FINE)) {
-            LOG.fine("Interceptors contributed by endpoint: " + il);
-        }
-        chain.add(il);
-
-        List<Interceptor> outInterceptors = new ArrayList<Interceptor>();
-        outInterceptors.add(new DispatchOutInterceptor());
-
-        chain.add(outInterceptors);
+        
+        if (endpoint instanceof JaxWsEndpointImpl) {
+            Binding jaxwsBinding = ((JaxWsEndpointImpl)endpoint).getJaxwsBinding();
+            if (endpoint.getBinding() instanceof SoapBinding) {
+                //endpoint.getInInterceptors().add(new SOAPHandlerInterceptor(jaxwsBinding));
+                chain.add(new SOAPHandlerInterceptor(jaxwsBinding));
+            } else {
+                // TODO: what for non soap bindings?
+            }
+            //endpoint.getInInterceptors().add(new LogicalHandlerInInterceptor(jaxwsBinding));
        
+            chain.add(new LogicalHandlerInInterceptor(jaxwsBinding));
+        }   
+        
+        chain.add(new MessageSenderInterceptor());
 
+        chain.add(new DispatchOutInterceptor());
         return chain;
     }
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java?view=diff&rev=545482&r1=545481&r2=545482
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
Fri Jun  8 04:37:13 2007
@@ -60,65 +60,62 @@
  */
 public class JaxWsEndpointImpl extends EndpointImpl {
 
-    private Binding binding;
+    private Binding jaxwsBinding;
     
     public JaxWsEndpointImpl(Bus bus, Service s, EndpointInfo ei) throws EndpointException
{
         super(bus, s, ei);
 
         createJaxwsBinding();
 
-        Interceptor soap = null;
+        //Inbound chain
+        List<Interceptor> in = super.getInInterceptors();
+        in.add(new LogicalHandlerInInterceptor(jaxwsBinding));
+        in.add(new WrapperClassInInterceptor());
+        in.add(new HolderInInterceptor());
         if (getBinding() instanceof SoapBinding) {
-            soap = new SOAPHandlerInterceptor(binding);
-            getInInterceptors().add(new SwAInInterceptor());
+            in.add(new SOAPHandlerInterceptor(jaxwsBinding));
+            in.add(new SwAInInterceptor());
             getOutInterceptors().add(new SwAOutInterceptor());
         } else {
              // TODO: what for non soap bindings?
         }
         
-        List<Interceptor> fault = super.getOutFaultInterceptors();        
-        
-        LogicalHandlerFaultOutInterceptor lh = new LogicalHandlerFaultOutInterceptor(binding);
-        fault.add(lh);
+        //Outbound chain       
+        List<Interceptor> out = super.getOutInterceptors();
+        out.add(new LogicalHandlerOutInterceptor(jaxwsBinding));
+        out.add(new WrapperClassOutInterceptor());
+        out.add(new HolderOutInterceptor());       
         if (getBinding() instanceof SoapBinding) {
-            SOAPHandlerFaultOutInterceptor sh = new SOAPHandlerFaultOutInterceptor(binding);
-            fault.add(sh);
-        }
-        
-        List<Interceptor> in = super.getInInterceptors();
-        in.add(new LogicalHandlerInInterceptor(binding));
-        if (soap != null) {
-            in.add(soap);
+            out.add(new SOAPHandlerInterceptor(jaxwsBinding));
         }
-        in.add(new WrapperClassInInterceptor());
-        in.add(new HolderInInterceptor());
         
-        List<Interceptor> out = super.getOutInterceptors();
-        out.add(new LogicalHandlerOutInterceptor(binding));
-        if (soap != null) {
-            out.add(soap);
+        //Outbound fault chain
+        List<Interceptor> outFault = super.getOutFaultInterceptors();    
+        outFault.add(new LogicalHandlerFaultOutInterceptor(jaxwsBinding));
+        if (getBinding() instanceof SoapBinding) {
+            outFault.add(new SOAPHandlerFaultOutInterceptor(jaxwsBinding));
         }
-        out.add(new WrapperClassOutInterceptor());
-        out.add(new HolderOutInterceptor());
-        
-        getInFaultInterceptors().add(new ClientFaultConverter());
+
+        //Inbound fault chain
+        List<Interceptor> inFault = super.getInFaultInterceptors(); 
+        inFault.add(new ClientFaultConverter());
+        inFault.add(new LogicalHandlerFaultInInterceptor(jaxwsBinding));
         if (getBinding() instanceof SoapBinding) {
-            getInFaultInterceptors().add(new SOAPHandlerFaultInInterceptor(binding));
+            inFault.add(new SOAPHandlerFaultInInterceptor(jaxwsBinding));
         }
-        getInFaultInterceptors().add(new LogicalHandlerFaultInInterceptor(binding));
     }
     
     public Binding getJaxwsBinding() {
-        return binding;
+        return jaxwsBinding;
     }
     
     final void createJaxwsBinding() {
         if (getBinding() instanceof SoapBinding) {
-            binding = new SOAPBindingImpl(getEndpointInfo().getBinding());
+            jaxwsBinding = new SOAPBindingImpl(getEndpointInfo().getBinding());
         } else if (getBinding() instanceof XMLBinding) {
-            binding = new HTTPBindingImpl(getEndpointInfo().getBinding());
+            jaxwsBinding = new HTTPBindingImpl(getEndpointInfo().getBinding());
         } else {
-            binding = new BindingImpl();
+            jaxwsBinding = new BindingImpl();
         }
     }
 }



Mime
View raw message