servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r949938 - /servicemix/components/engines/servicemix-cxf-se/trunk/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
Date Tue, 01 Jun 2010 06:52:22 GMT
Author: ffang
Date: Tue Jun  1 06:52:22 2010
New Revision: 949938

URL: http://svn.apache.org/viewvc?rev=949938&view=rev
Log:
[SMXCOMP-753]ensure clean up dead destination before init cxf se endpoint

Modified:
    servicemix/components/engines/servicemix-cxf-se/trunk/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java

Modified: servicemix/components/engines/servicemix-cxf-se/trunk/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-cxf-se/trunk/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java?rev=949938&r1=949937&r2=949938&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-cxf-se/trunk/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
(original)
+++ servicemix/components/engines/servicemix-cxf-se/trunk/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
Tue Jun  1 06:52:22 2010
@@ -45,6 +45,7 @@ import org.w3c.dom.Element;
 import org.xml.sax.SAXException;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.BusException;
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.SoapVersion;
@@ -275,6 +276,7 @@ public class CxfSeEndpoint extends Provi
             if (getPojoEndpoint() != null) {
                 sf.setEndpointName(getPojoEndpoint());
             }
+            cleanUpDeadDestination();
             server = sf.create();
             server.getEndpoint().getInInterceptors().addAll(getInInterceptors());
             server.getEndpoint().getInFaultInterceptors().addAll(getInFaultInterceptors());
@@ -352,6 +354,7 @@ public class CxfSeEndpoint extends Provi
         
         // prepare the CXF server in case of JAXB
         if (!isUseAegis()) {
+            cleanUpDeadDestination();
             endpoint.publish(address);
             server = endpoint.getServer();
         }
@@ -516,6 +519,21 @@ public class CxfSeEndpoint extends Provi
         return ((CxfSeComponent)getServiceUnit().getComponent()).getBus();
     }
     
+    private void cleanUpDeadDestination() throws DeploymentException {
+        JBITransportFactory jbiTransportFactory;
+        try {
+            jbiTransportFactory = (JBITransportFactory)getBus()
+                .getExtension(ConduitInitiatorManager.class).getConduitInitiator(CxfSeComponent.JBI_TRANSPORT_ID);
+        } catch (BusException e) {
+            throw new DeploymentException(e);
+        }
+        if (jbiTransportFactory != null 
+                && getPojoService() != null 
+                && getPojoInterfaceName() != null) {
+             jbiTransportFactory.removeDestination(getPojoService().toString() + getPojoInterfaceName().toString());
+        }
+    }
+    
     private QName findOperation(NormalizedMessage nm, Message message, MessageExchange exchange)
         throws TransformerException, ParserConfigurationException, IOException, SAXException
{
         // try to figure out the operationName based on the incoming message



Mime
View raw message