servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r573246 - /incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java
Date Thu, 06 Sep 2007 12:46:02 GMT
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());
                 }



Mime
View raw message