servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r776545 - in /servicemix/smx3/branches/servicemix-3.2/deployables: bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ serviceeng...
Date Wed, 20 May 2009 04:37:30 GMT
Author: ffang
Date: Wed May 20 04:37:29 2009
New Revision: 776545

URL: http://svn.apache.org/viewvc?rev=776545&view=rev
Log:
[SMXCOMP-509]cxfse:endpoint service and endpoint attributes do not influence nmr endpoint
as expected

Added:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_different_service_endpoint_name.xml
  (with props)
Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java
    servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java?rev=776545&r1=776544&r2=776545&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java
Wed May 20 04:37:29 2009
@@ -124,6 +124,10 @@
         }
     }
 
+    public void testCalculatrorWithDifferentServiceEndpointNmae() throws Exception {
+        setUpJBI("org/apache/servicemix/cxfbc/xbean_different_service_endpoint_name.xml");
+        calculatorTestBase();
+    }
     
     private void calculatorTestBase() throws Exception {
 

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_different_service_endpoint_name.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_different_service_endpoint_name.xml?rev=776545&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_different_service_endpoint_name.xml
(added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_different_service_endpoint_name.xml
Wed May 20 04:37:29 2009
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  
+-->
+<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
+       xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
+       xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
+       xmlns:test="urn:test"
+       xmlns:calculator="http://apache.org/cxf/calculator">
+  
+  <sm:container id="jbi" embedded="true">
+    
+    <sm:endpoints>
+      <cxfse:endpoint
+        service="calculator:AnotherCalculatorService"
+        endpoint="AnotherCalculatorPort">
+        <cxfse:pojo>
+          <bean class="org.apache.cxf.calculator.CalculatorImpl" />
+        </cxfse:pojo>
+        <cxfse:inInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxfse:inInterceptors>
+        <cxfse:outInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxfse:outInterceptors>
+        <cxfse:inFaultInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxfse:inFaultInterceptors>
+        <cxfse:outFaultInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxfse:outFaultInterceptors>
+      </cxfse:endpoint>
+      <cxfbc:consumer wsdl="/wsdl/calculator.wsdl"
+                      targetEndpoint="AnotherCalculatorPort"
+                      targetService="calculator:AnotherCalculatorService"
+                      >
+        <cxfbc:inInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxfbc:inInterceptors>
+        <cxfbc:outInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxfbc:outInterceptors>
+        <cxfbc:inFaultInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxfbc:inFaultInterceptors>
+        <cxfbc:outFaultInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxfbc:outFaultInterceptors>
+      </cxfbc:consumer>
+    </sm:endpoints>
+    
+  </sm:container>
+  
+</beans>

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_different_service_endpoint_name.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_different_service_endpoint_name.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_different_service_endpoint_name.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java?rev=776545&r1=776544&r2=776545&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
Wed May 20 04:37:29 2009
@@ -100,6 +100,10 @@
 
     private boolean useAegis;
     
+    private QName pojoService;
+    private String pojoEndpoint;
+    private QName pojoInterfaceName;
+    
     /**
      * Returns the object implementing the endpoint's functionality. It is
      * returned as a generic Java <code>Object</code> that can be cast to the
@@ -256,13 +260,22 @@
                 server.getEndpoint().getOutInterceptors().add(new AttachmentOutInterceptor());
             }
             if (sf.getServiceFactory().getServiceQName() != null) {
-                setService(sf.getServiceFactory().getServiceQName());
+                setPojoService(sf.getServiceFactory().getServiceQName());
+                if (getService() == null) {
+                    setService(sf.getServiceFactory().getServiceQName());
+                }
             }
             if (sf.getServiceFactory().getEndpointInfo().getName() != null) {
-                setEndpoint(sf.getServiceFactory().getEndpointInfo().getName().getLocalPart());
+                setPojoEndpoint(sf.getServiceFactory().getEndpointInfo().getName().getLocalPart());
+                if (getEndpoint() == null) {
+                    setEndpoint(sf.getServiceFactory().getEndpointInfo().getName().getLocalPart());
+                }
             }
             if (sf.getServiceFactory().getInterfaceName() != null) {
-                setInterfaceName(sf.getServiceFactory().getInterfaceName());
+                setPojoInterfaceName(sf.getServiceFactory().getInterfaceName());
+                if (getInterfaceName() == null) {
+                    setInterfaceName(sf.getServiceFactory().getInterfaceName());
+                }
             }
         } else {
             JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
@@ -283,10 +296,18 @@
             }
             JaxWsImplementorInfo implInfo = new JaxWsImplementorInfo(getPojo()
                 .getClass());
-            setService(implInfo.getServiceName());
-            
-            setInterfaceName(implInfo.getInterfaceName());
-            setEndpoint(implInfo.getEndpointName().getLocalPart());
+            setPojoService(implInfo.getServiceName());
+            setPojoInterfaceName(implInfo.getInterfaceName());
+            setPojoEndpoint(implInfo.getEndpointName().getLocalPart());
+            if (getService() == null) {
+                setService(implInfo.getServiceName());
+            }
+            if (getInterfaceName() == null) {
+                setInterfaceName(implInfo.getInterfaceName());
+            }
+            if (getEndpoint() == null) {
+                setEndpoint(implInfo.getEndpointName().getLocalPart());
+            }
             
         }
         super.validate();
@@ -332,19 +353,11 @@
                 .getExtension(ConduitInitiatorManager.class)
                 .getConduitInitiator(CxfSeComponent.JBI_TRANSPORT_ID);
 
-        QName serviceName = exchange.getService();
-        if (serviceName == null) {
-            serviceName = getService();
-            exchange.setService(serviceName);
-        }
-        QName interfaceName = exchange.getInterfaceName();
-        if (interfaceName == null) {
-            interfaceName = getInterfaceName();
-            exchange.setInterfaceName(interfaceName);
-        }
+        exchange.setService(getPojoService());
+        exchange.setInterfaceName(getInterfaceName());
         JBIDestination jbiDestination = jbiTransportFactory
-                .getDestination(serviceName.toString()
-                        + interfaceName.toString());
+                .getDestination(getPojoService().toString()
+                        + getInterfaceName().toString());
         DeliveryChannel dc = getContext().getDeliveryChannel();
         jbiTransportFactory.setDeliveryChannel(dc);
 
@@ -377,9 +390,15 @@
         } catch (Exception e) {
             e.printStackTrace();
         }
-
-        setService(server.getEndpoint().getService().getName());
-        setEndpoint(server.getEndpoint().getEndpointInfo()
+        if (getService() == null) {
+            setService(server.getEndpoint().getService().getName());
+        }
+        if (getEndpoint() == null) {
+            setEndpoint(server.getEndpoint().getEndpointInfo()
+                .getName().getLocalPart());
+        }
+        setPojoService(server.getEndpoint().getService().getName());
+        setPojoEndpoint(server.getEndpoint().getEndpointInfo()
                 .getName().getLocalPart());
         if (!isUseJBIWrapper() && !isUseSOAPEnvelope()) {
             removeInterceptor(server.getEndpoint().getBinding()
@@ -440,8 +459,8 @@
                 .getExtension(ConduitInitiatorManager.class)
                 .getConduitInitiator(CxfSeComponent.JBI_TRANSPORT_ID);
         jbiTransportFactory.setDeliveryChannel(null);
-        jbiTransportFactory.removeDestination(getService().toString()
-                + getInterfaceName().toString());
+        jbiTransportFactory.removeDestination(getPojoService().toString()
+                + getPojoInterfaceName().toString());
         super.stop();
     }
 
@@ -535,4 +554,28 @@
         return useAegis;
     }
 
+    protected void setPojoService(QName pojoService) {
+        this.pojoService = pojoService;
+    }
+
+    protected QName getPojoService() {
+        return pojoService;
+    }
+
+    protected void setPojoEndpoint(String pojoEndpoint) {
+        this.pojoEndpoint = pojoEndpoint;
+    }
+
+    protected String getPojoEndpoint() {
+        return pojoEndpoint;
+    }
+
+    protected void setPojoInterfaceName(QName pojoInterfaceName) {
+        this.pojoInterfaceName = pojoInterfaceName;
+    }
+
+    protected QName getPojoInterfaceName() {
+        return pojoInterfaceName;
+    }
+
 }



Mime
View raw message