You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2012/07/23 08:51:35 UTC

svn commit: r1364517 - /servicemix/components/branches/components-2011.02.x/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/ListServiceHandler.java

Author: ffang
Date: Mon Jul 23 06:51:35 2012
New Revision: 1364517

URL: http://svn.apache.org/viewvc?rev=1364517&view=rev
Log:
[SMXCOMP-937]when deploying multiple CXF JBI services all services are shown in the list regardless of port they are running on.

Modified:
    servicemix/components/branches/components-2011.02.x/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/ListServiceHandler.java

Modified: servicemix/components/branches/components-2011.02.x/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/ListServiceHandler.java
URL: http://svn.apache.org/viewvc/servicemix/components/branches/components-2011.02.x/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/ListServiceHandler.java?rev=1364517&r1=1364516&r2=1364517&view=diff
==============================================================================
--- servicemix/components/branches/components-2011.02.x/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/ListServiceHandler.java (original)
+++ servicemix/components/branches/components-2011.02.x/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/ListServiceHandler.java Mon Jul 23 06:51:35 2012
@@ -31,6 +31,7 @@ import org.apache.cxf.Bus;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.endpoint.ServerRegistry;
 import org.apache.cxf.transport.http_jetty.JettyHTTPDestination;
+import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine;
 import org.eclipse.jetty.http.HttpMethods;
 import org.eclipse.jetty.http.MimeTypes;
 import org.eclipse.jetty.server.HttpConnection;
@@ -84,9 +85,13 @@ public class ListServiceHandler extends 
             ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class);
             servers.addAll(serverRegistry.getServers());
         }
+        int serverPort = request.getServerPort();
         for (Iterator<Server> iter = servers.iterator(); iter.hasNext();) {
             Server server = (Server) iter.next();
             JettyHTTPDestination jhd = (JettyHTTPDestination)server.getDestination();
+            if (((JettyHTTPServerEngine)jhd.getEngine()).getPort() != serverPort) {
+                continue;
+            }
             String address = jhd.getAddress().getAddress().getValue();
             writer.write("<li><a href=\"");
             writer.write(address);