You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2008/04/28 03:49:57 UTC

svn commit: r652042 - /incubator/tuscany/java/sca/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java

Author: jsdelfino
Date: Sun Apr 27 18:49:55 2008
New Revision: 652042

URL: http://svn.apache.org/viewvc?rev=652042&view=rev
Log:
Fixed logic to release HTTP port when there are no servlet mappings on it.

Modified:
    incubator/tuscany/java/sca/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java

Modified: incubator/tuscany/java/sca/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java?rev=652042&r1=652041&r2=652042&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java (original)
+++ incubator/tuscany/java/sca/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java Sun Apr 27 18:49:55 2008
@@ -401,12 +401,14 @@
             servletHandler.setServletMappings(mappings.toArray(new ServletMapping[mappings.size()]));
             
             // Stop the port if there are no servlet mappings on it anymore
-            try {
-                port.getServer().stop();
-            } catch (Exception e) {
-                throw new IllegalStateException(e);
+            if (mappings.size() == 0) {
+                try {
+                    port.getServer().stop();
+                } catch (Exception e) {
+                    throw new IllegalStateException(e);
+                }
+                ports.remove(portNumber);
             }
-            ports.remove(portNumber);
             
         } else {
             logger.info("Trying to Remove servlet mapping: " + path + " where mapping is not registered");