You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2012/09/28 20:50:24 UTC

svn commit: r1391593 - /cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java

Author: dkulp
Date: Fri Sep 28 18:50:24 2012
New Revision: 1391593

URL: http://svn.apache.org/viewvc?rev=1391593&view=rev
Log:
Allow use of a bus property to configure managed mode

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

Modified: cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java?rev=1391593&r1=1391592&r2=1391593&view=diff
==============================================================================
--- cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java (original)
+++ cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java Fri Sep 28 18:50:24 2012
@@ -72,10 +72,12 @@ public class WSDiscoveryServiceImpl impl
     public WSDiscoveryServiceImpl(Bus b) {
         bus = b;
         client = new WSDiscoveryClient();
+        update(bus.getProperties());
     }
     public WSDiscoveryServiceImpl() {
         bus = BusFactory.newInstance().createBus();
         client = new WSDiscoveryClient();
+        update(bus.getProperties());
     }
     public WSDiscoveryServiceImpl(Bus b, Map<String, Object> props) {
         bus = b;
@@ -83,9 +85,14 @@ public class WSDiscoveryServiceImpl impl
         update(props);
     }
     
-    public final void update(Map<String, Object> props) {
+    public final synchronized void update(Map<String, Object> props) {
         String address = (String)props.get("org.apache.cxf.service.ws-discovery.address");
         client.setAddress(address);
+        if (udpEndpoint != null && !client.isAdHoc()) {
+            udpEndpoint.stop();
+            udpEndpoint = null;
+            started = false;
+        }
     }
     public WSDiscoveryClient getClient() {
         return client;