servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r1415107 - in /servicemix/smx4/nmr/trunk/nmr/osgi/src: main/java/org/apache/servicemix/nmr/osgi/ main/resources/OSGI-INF/blueprint/ test/java/org/apache/servicemix/nmr/osgi/
Date Thu, 29 Nov 2012 09:43:35 GMT
Author: gertv
Date: Thu Nov 29 09:43:34 2012
New Revision: 1415107

URL: http://svn.apache.org/viewvc?rev=1415107&view=rev
Log:
SMX4NMR-306: Container freezes while installing jbi feature

Modified:
    servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/ExecutorConfigurator.java
    servicemix/smx4/nmr/trunk/nmr/osgi/src/main/resources/OSGI-INF/blueprint/servicemix-nmr.xml
    servicemix/smx4/nmr/trunk/nmr/osgi/src/test/java/org/apache/servicemix/nmr/osgi/ExecutorConfiguratorTest.java

Modified: servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/ExecutorConfigurator.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/ExecutorConfigurator.java?rev=1415107&r1=1415106&r2=1415107&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/ExecutorConfigurator.java
(original)
+++ servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/ExecutorConfigurator.java
Thu Nov 29 09:43:34 2012
@@ -29,7 +29,7 @@ import java.util.Map;
 /**
  * A managed service that will update the configurations based on the ConfigAdmin configuration
  */
-public class ExecutorConfigurator implements ManagedService {
+public class ExecutorConfigurator {
 
     private ExecutorFactoryImpl executorFactory;
 
@@ -41,14 +41,14 @@ public class ExecutorConfigurator implem
         this.executorFactory = factory;
     }
 
-    public void updated(Dictionary properties) throws ConfigurationException {
+    public void update(Map properties) throws ConfigurationException {
         if (executorFactory.getDefaultConfig() == null) {
             executorFactory.setDefaultConfig(new ExecutorConfig(true, null));
         }
         Map<String, ExecutorConfig> configs = new HashMap<String, ExecutorConfig>();
         if (properties != null) {
-            for (Enumeration e = properties.keys(); e.hasMoreElements();) {
-                String key = (String) e.nextElement();
+            for (Object keyObject : properties.keySet()) {
+                String key = (String) keyObject;
                 if (key.endsWith(".corePoolSize")) {
                     getConfig(configs, key).setCorePoolSize(getInt(properties, key));
                 } else if (key.endsWith(".maximumPoolSize")) {
@@ -101,15 +101,15 @@ public class ExecutorConfigurator implem
         return config;
     }
 
-    private int getInt(Dictionary properties, String key) {
+    private int getInt(Map properties, String key) {
         return Integer.parseInt(properties.get(key).toString());
     }
 
-    private long getLong(Dictionary properties, String key) {
+    private long getLong(Map properties, String key) {
         return Long.parseLong(properties.get(key).toString());
     }
 
-    private boolean getBool(Dictionary properties, String key) {
+    private boolean getBool(Map properties, String key) {
         return Boolean.parseBoolean(properties.get(key).toString());
     }
 }

Modified: servicemix/smx4/nmr/trunk/nmr/osgi/src/main/resources/OSGI-INF/blueprint/servicemix-nmr.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/osgi/src/main/resources/OSGI-INF/blueprint/servicemix-nmr.xml?rev=1415107&r1=1415106&r2=1415107&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/osgi/src/main/resources/OSGI-INF/blueprint/servicemix-nmr.xml
(original)
+++ servicemix/smx4/nmr/trunk/nmr/osgi/src/main/resources/OSGI-INF/blueprint/servicemix-nmr.xml
Thu Nov 29 09:43:34 2012
@@ -133,6 +133,12 @@
 
     <service ref="executorFactory" interface="org.apache.servicemix.executors.ExecutorFactory"/>
 
+    <!-- ExecutorFactory configurer -->
+    <bean id="executorConfigurator" class="org.apache.servicemix.nmr.osgi.ExecutorConfigurator">
+        <cm:managed-properties persistent-id="org.apache.servicemix.nmr"
+                               update-strategy="component-managed" update-method="update"
/>
+        <property name="executorFactory" ref="executorFactory"/>
+    </bean>
 
     <!-- Property place holder -->
     <cm:property-placeholder persistent-id="org.apache.servicemix.nmr">

Modified: servicemix/smx4/nmr/trunk/nmr/osgi/src/test/java/org/apache/servicemix/nmr/osgi/ExecutorConfiguratorTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/osgi/src/test/java/org/apache/servicemix/nmr/osgi/ExecutorConfiguratorTest.java?rev=1415107&r1=1415106&r2=1415107&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/osgi/src/test/java/org/apache/servicemix/nmr/osgi/ExecutorConfiguratorTest.java
(original)
+++ servicemix/smx4/nmr/trunk/nmr/osgi/src/test/java/org/apache/servicemix/nmr/osgi/ExecutorConfiguratorTest.java
Thu Nov 29 09:43:34 2012
@@ -21,7 +21,7 @@ import org.apache.servicemix.executors.i
 import org.osgi.service.cm.ConfigurationException;
 
 /**
- * Test cases for {@link org.apache.servicemix.nmr.osgi.ExecutorConfigurator#updated(java.util.Dictionary)}
+ * Test cases for {@link org.apache.servicemix.nmr.osgi.ExecutorConfigurator#update(java.util.Map)}
  */
 public class ExecutorConfiguratorTest extends TestCase {
 
@@ -30,7 +30,7 @@ public class ExecutorConfiguratorTest ex
         configurator.setExecutorFactory(new ExecutorFactoryImpl());
         
         try {
-            configurator.updated(null);
+            configurator.update(null);
             // this is OK
         } catch (Exception e) {
             e.printStackTrace();



Mime
View raw message