cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1391593 - /cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
Date Fri, 28 Sep 2012 18:50:24 GMT
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;



Mime
View raw message