cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r667178 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
Date Thu, 12 Jun 2008 17:44:13 GMT
Author: dkulp
Date: Thu Jun 12 10:44:13 2008
New Revision: 667178

URL: http://svn.apache.org/viewvc?rev=667178&view=rev
Log:
[CXF-1630] Add sorting to the service list

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java?rev=667178&r1=667177&r2=667178&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
Thu Jun 12 10:44:13 2008
@@ -21,7 +21,10 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.net.URL;
-import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.LinkedList;
+import java.util.List;
 import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -185,7 +188,6 @@
             return;
         }
         
-        Collection<ServletDestination> destinations = transport.getDestinations();
         response.setContentType("text/html");        
         response.setCharacterEncoding("UTF-8");
         
@@ -205,6 +207,16 @@
         response.getWriter().write("<title>CXF - Service list</title>");
         response.getWriter().write("</head><body>");
         if (!isHideServiceList) {
+            List<ServletDestination> destinations 
+                = new LinkedList<ServletDestination>(transport.getDestinations());
+            Collections.sort(destinations, new Comparator<ServletDestination>() {
+                public int compare(ServletDestination o1, ServletDestination o2) {
+                    return o1.getEndpointInfo().getInterface().getName()
+                         .getLocalPart().compareTo(o2.getEndpointInfo()
+                                                       .getInterface().getName().getLocalPart());
+                }
+            });
+                
             if (destinations.size() > 0) {  
                 response.getWriter().write("<span class=\"heading\">Available services:</span><br/>");
                 response.getWriter().write("<table " + (serviceListStyleSheet == null



Mime
View raw message