cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1183350 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiAutomaticWorkQueue.java
Date Fri, 14 Oct 2011 13:28:09 GMT
Author: dkulp
Date: Fri Oct 14 13:28:09 2011
New Revision: 1183350

URL: http://svn.apache.org/viewvc?rev=1183350&view=rev
Log:
Avoid possible race condition at startup

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiAutomaticWorkQueue.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiAutomaticWorkQueue.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiAutomaticWorkQueue.java?rev=1183350&r1=1183349&r2=1183350&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiAutomaticWorkQueue.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiAutomaticWorkQueue.java Fri
Oct 14 13:28:09 2011
@@ -47,7 +47,7 @@ public class OSGiAutomaticWorkQueue exte
         Properties current = new Properties();
 
         
-        public void register(BundleContext ctx, Configuration c) {
+        public synchronized void register(BundleContext ctx, Configuration c) {
             Properties props = new Properties();
             props.put(Constants.SERVICE_PID, "org.apache.cxf.workqueues");  
 
@@ -57,7 +57,7 @@ public class OSGiAutomaticWorkQueue exte
             this.config = c;
         }
         
-        public void updateProperty(String key, String val) {
+        public synchronized void updateProperty(String key, String val) {
             if (val != null) {
                 current.put(key, val);
             } else {
@@ -69,7 +69,7 @@ public class OSGiAutomaticWorkQueue exte
                 //ignore
             }
         }
-        public void updated(Dictionary d) throws ConfigurationException {
+        public synchronized void updated(Dictionary d) throws ConfigurationException {
             current.clear();
             if (d == null) {
                 return;
@@ -94,7 +94,9 @@ public class OSGiAutomaticWorkQueue exte
                     }
                 }
             }
-            registration.setProperties(d);
+            if (registration != null) {
+                registration.setProperties(d);
+            }
         }
     };
     final WorkQueueList qlist;



Mime
View raw message