You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2007/09/06 14:45:25 UTC

svn commit: r573245 - /incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java

Author: gnodet
Date: Thu Sep  6 05:45:22 2007
New Revision: 573245

URL: http://svn.apache.org/viewvc?rev=573245&view=rev
Log:
Fix SM-1050 and SM-1035

Modified:
    incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java

Modified: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java?rev=573245&r1=573244&r2=573245&view=diff
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java (original)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java Thu Sep  6 05:45:22 2007
@@ -39,7 +39,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.JbiConstants;
-import org.apache.servicemix.common.BaseLifeCycle;
+import org.apache.servicemix.common.EndpointComponentContext;
 import org.apache.servicemix.common.ExchangeProcessor;
 import org.apache.servicemix.http.ContextManager;
 import org.apache.servicemix.http.HttpComponent;
@@ -108,7 +108,7 @@
     public void start() throws Exception {
         Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
         String url = endpoint.getLocationURI();
-        context = endpoint.getServiceUnit().getComponent().getComponentContext();
+        context = new EndpointComponentContext(endpoint);
         channel = context.getDeliveryChannel();
         httpContext = getServerManager().createContext(url, this);
     }
@@ -133,7 +133,7 @@
         Continuation cont = ContinuationSupport.getContinuation(request, null);
         MessageExchange exchange;
         // If the continuation is not a retry
-        if (!cont.isPending()) {
+        if (!cont.isPending() && cont.isNew()) {
             try {
                 SoapMessage message = soapHelper.getSoapMarshaler().createReader().read(
                                             request.getInputStream(), 
@@ -156,15 +156,14 @@
                 locks.put(exchange.getExchangeId(), cont);
                 request.setAttribute(MessageExchange.class.getName(), exchange.getExchangeId());
                 synchronized (cont) {
-                    ((BaseLifeCycle) endpoint.getServiceUnit().getComponent().getLifeCycle()).sendConsumerExchange(exchange, endpoint);
-                    if (exchanges.remove(exchange.getExchangeId()) == null) {
-                        if (log.isDebugEnabled()) {
-                            log.debug("Suspending continuation for exchange: " + exchange.getExchangeId());
-                        }
-                        boolean result = cont.suspend(suspentionTime);
-                        if (!result) {
-                            throw new Exception("Error sending exchange: aborted");
-                        }
+                    channel.send(exchange);
+                    if (log.isDebugEnabled()) {
+                        log.debug("Suspending continuation for exchange: " + exchange.getExchangeId());
+                    }
+                    boolean result = cont.suspend(suspentionTime);
+                    exchanges.remove(exchange.getExchangeId());
+                    if (!result) {
+                        throw new Exception("Error sending exchange: aborted");
                     }
                     request.removeAttribute(MessageExchange.class.getName());
                 }