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 2008/12/10 17:56:08 UTC

svn commit: r725337 - in /servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http: endpoints/HttpConsumerEndpoint.java processors/ConsumerProcessor.java

Author: gnodet
Date: Wed Dec 10 08:56:08 2008
New Revision: 725337

URL: http://svn.apache.org/viewvc?rev=725337&view=rev
Log:
SM-1727: When a SU is stopped on servicemix-http, pending exchanges are not processed correctly

Modified:
    servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpConsumerEndpoint.java
    servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java

Modified: servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpConsumerEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpConsumerEndpoint.java?rev=725337&r1=725336&r2=725337&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpConsumerEndpoint.java (original)
+++ servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpConsumerEndpoint.java Wed Dec 10 08:56:08 2008
@@ -271,16 +271,16 @@
             if (handleStaticResource(request, response)) {
                 return;
             }
-            // Check endpoint is started
-            if (!started) {
-                response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Endpoint is stopped");
-                return;
-            }
             // Not giving a specific mutex will synchronize on the continuation
             // itself
             Continuation cont = ContinuationSupport.getContinuation(request, null);
             // If the continuation is not a retry
             if (!cont.isPending()) {
+	            // Check endpoint is started
+	            if (!started) {
+	                response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Endpoint is stopped");
+	                return;
+	            }
                 // Create the exchange
                 exchange = createExchange(request);
                 // Put the exchange in a map so that we can later retrieve it

Modified: servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java?rev=725337&r1=725336&r2=725337&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java (original)
+++ servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/processors/ConsumerProcessor.java Wed Dec 10 08:56:08 2008
@@ -141,10 +141,6 @@
             processGetRequest(request, response);
             return;
         }
-        if (!started) {
-            response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Endpoint is stopped");
-            return;
-        }
         if (!"POST".equals(request.getMethod())) {
             response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, request.getMethod() + " not supported");
             return;
@@ -155,6 +151,10 @@
         // If the continuation is not a retry
         if (!cont.isPending()) {
             try {
+		        if (!started) {
+		            response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Endpoint is stopped");
+		            return;
+		        }
                 Context ctx = createContext(request);
                 request.setAttribute(Context.class.getName(), ctx);
                 exchange = soapHelper.onReceive(ctx);