cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1399360 - /cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/listeners/WSDiscoveryServerListener.java
Date Wed, 17 Oct 2012 17:39:27 GMT
Author: sergeyb
Date: Wed Oct 17 17:39:26 2012
New Revision: 1399360

URL: http://svn.apache.org/viewvc?rev=1399360&view=rev
Log:
Updating WS-Discovery listener to check if interface if available

Modified:
    cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/listeners/WSDiscoveryServerListener.java

Modified: cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/listeners/WSDiscoveryServerListener.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/listeners/WSDiscoveryServerListener.java?rev=1399360&r1=1399359&r2=1399360&view=diff
==============================================================================
--- cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/listeners/WSDiscoveryServerListener.java
(original)
+++ cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/listeners/WSDiscoveryServerListener.java
Wed Oct 17 17:39:26 2012
@@ -25,6 +25,8 @@ import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.endpoint.ServerLifeCycleListener;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.InterfaceInfo;
 import org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl;
 
 /**
@@ -63,7 +65,7 @@ public class WSDiscoveryServerListener i
     }
 
     public void startServer(Server server) {
-        QName sn = server.getEndpoint().getEndpointInfo().getInterface().getName();
+        QName sn = getServiceQName(server);
         if ("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01".equals(sn.getNamespaceURI()))
{
             return;
         }
@@ -71,10 +73,21 @@ public class WSDiscoveryServerListener i
     }
 
     public void stopServer(Server server) {
-        QName sn = server.getEndpoint().getEndpointInfo().getInterface().getName();
+        QName sn = getServiceQName(server);
         if ("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01".equals(sn.getNamespaceURI()))
{
             return;
         }
         getService().serverStopped(server);
     }
+    
+    private QName getServiceQName(Server server) {
+        EndpointInfo ei = server.getEndpoint().getEndpointInfo();
+        InterfaceInfo ii = ei.getInterface();
+        if (ii != null) {
+            return ii.getName();
+        } else {
+            return ei.getService().getName();
+        }
+    }
+    
 }



Mime
View raw message