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:46:02 UTC

svn commit: r573246 - /incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java

Author: gnodet
Date: Thu Sep  6 05:46:01 2007
New Revision: 573246

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

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

Modified: incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java?rev=573246&r1=573245&r2=573246&view=diff
==============================================================================
--- incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java (original)
+++ incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java Thu Sep  6 05:46:01 2007
@@ -37,7 +37,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.*;
 import org.apache.servicemix.http.jetty.JaasJettyPrincipal;
@@ -106,7 +106,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);
     }
@@ -157,7 +157,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(), 
@@ -180,15 +180,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());
                 }