cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1467277 - /cxf/branches/2.7.x-fixes/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
Date Fri, 12 Apr 2013 14:23:21 GMT
Author: dkulp
Date: Fri Apr 12 14:23:20 2013
New Revision: 1467277

URL: http://svn.apache.org/r1467277
Log:
Merged revisions 1467274 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1467274 | dkulp | 2013-04-12 10:13:32 -0400 (Fri, 12 Apr 2013) | 2 lines

  Add a property to allow disabling the ws-discovery publishing

........

Modified:
    cxf/branches/2.7.x-fixes/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java

Modified: cxf/branches/2.7.x-fixes/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java?rev=1467277&r1=1467276&r2=1467277&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
(original)
+++ cxf/branches/2.7.x-fixes/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
Fri Apr 12 14:23:20 2013
@@ -132,14 +132,26 @@ public class WSDiscoveryServiceImpl impl
         registered.add(ht);
     }
     
+    private Object getProperty(Server server, String s) {
+        Object o = server.getEndpoint().get(s);
+        if (o == null) {
+            o = server.getEndpoint().getEndpointInfo().getProperty(s);
+        }
+        return o;
+    }
+    
     public void serverStarted(Server server) {
+        Object o = getProperty(server, "ws-discovery-disable");
+        if (o == Boolean.TRUE || Boolean.valueOf((String)o)) {
+            return;
+        }
         startup();
         HelloType ht = new HelloType();
         ht.setScopes(new ScopesType());
         ht.setMetadataVersion(1);
         
 
-        Object o = server.getEndpoint().get("ws-discovery-types");
+        o = getProperty(server, "ws-discovery-types");
         if (o instanceof QName) {
             ht.getTypes().add((QName)o);
         } else if (o instanceof List) {
@@ -159,12 +171,12 @@ public class WSDiscoveryServiceImpl impl
         }
 
         
-        o = server.getEndpoint().get("ws-discovery-scopes");
+        o = getProperty(server, "ws-discovery-scopes");
         if (o != null) {
             setScopes(ht, o);
         }
         setXAddrs(ht, server);
-        String uuid = (String)server.getEndpoint().get("ws-discovery-uuid");
+        String uuid = (String)getProperty(server, "ws-discovery-uuid");
         if (uuid != null) {
             //persistent uuid
             W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
@@ -177,15 +189,9 @@ public class WSDiscoveryServiceImpl impl
     }
 
     private void setXAddrs(HelloType ht, Server server) {
-        String s = (String)server.getEndpoint().get("ws-discovery-published-url");
-        if (s == null) {
-            s = (String)server.getEndpoint().getEndpointInfo().getProperty("ws-discovery-published-url");
-        } 
-        if (s == null) {
-            s = (String)server.getEndpoint().get("publishedEndpointUrl");
-        }
+        String s = (String)getProperty(server, "ws-discovery-published-url");
         if (s == null) {
-            s = (String)server.getEndpoint().getEndpointInfo().getProperty("publishedEndpointUrl");
+            s = (String)getProperty(server, "publishedEndpointUrl");
         }
         if (s == null) {
             s = server.getEndpoint().getEndpointInfo().getAddress();



Mime
View raw message