camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r735862 - in /camel/branches/camel-1.x: ./ components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpEndpointDisconnectTest.java
Date Mon, 19 Jan 2009 22:46:57 GMT
Author: gertv
Date: Mon Jan 19 14:46:57 2009
New Revision: 735862

URL: http://svn.apache.org/viewvc?rev=735862&view=rev
Log:
Merged revisions 735847 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r735847 | gertv | 2009-01-19 23:16:30 +0100 (Mon, 19 Jan 2009) | 1 line
  
  CAMEL-1274: Jetty HTTP SelectChannelConnector not closed when CamelContext shuts down
........

Added:
    camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpEndpointDisconnectTest.java
      - copied unchanged from r735847, camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpEndpointDisconnectTest.java
Modified:
    camel/branches/camel-1.x/   (props changed)
    camel/branches/camel-1.x/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 19 14:46:57 2009
@@ -1 +1,2 @@
 /activemq/camel/trunk:732943,733749,734053,734057-734058,734064,734130,734309,734340-734342,734348,734392,734422,734727,734903,734932,735421,735427,735732
+/camel/trunk:735847

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-1.x/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java?rev=735862&r1=735861&r2=735862&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
(original)
+++ camel/branches/camel-1.x/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
Mon Jan 19 14:46:57 2009
@@ -110,7 +110,7 @@
     public void connect(HttpConsumer consumer) throws Exception {
         // Make sure that there is a connector for the requested endpoint.
         JettyHttpEndpoint endpoint = (JettyHttpEndpoint)consumer.getEndpoint();
-        String connectorKey = endpoint.getProtocol() + ":" + endpoint.getHttpUri().getHost()
+ ":" + endpoint.getPort();
+        String connectorKey = getConnectorKey(endpoint);
 
         synchronized (connectors) {
             ConnectorRef connectorRef = connectors.get(connectorKey);
@@ -167,8 +167,8 @@
     public void disconnect(HttpConsumer consumer) throws Exception {
         // If the connector is not needed anymore then stop it
         HttpEndpoint endpoint = consumer.getEndpoint();
-        String connectorKey = endpoint.getProtocol() + ":" + endpoint.getPort();
-
+        String connectorKey = getConnectorKey(endpoint);
+        
         synchronized (connectors) {
             ConnectorRef connectorRef = connectors.get(connectorKey);
             if (connectorRef != null) {
@@ -181,6 +181,10 @@
             }
         }
     }
+    
+    private String getConnectorKey(HttpEndpoint endpoint) {
+        return endpoint.getProtocol() + ":" + endpoint.getHttpUri().getHost() + ":" + endpoint.getPort();
+    }
 
     // Properties
     // -------------------------------------------------------------------------
@@ -270,7 +274,7 @@
     @Override
     protected void doStop() throws Exception {
         for (ConnectorRef connectorRef : connectors.values()) {
-            connectorRef.connector.stop();
+            connectorRef.connector.stop();            
         }
         connectors.clear();
 



Mime
View raw message