directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r291374 - in /directory/sandbox/trunk/osgi-spec/trunk/configuration: ./ src/main/java/org/apache/configuration/impl/
Date Sun, 25 Sep 2005 04:13:16 GMT
Author: erodriguez
Date: Sat Sep 24 21:13:10 2005
New Revision: 291374

URL: http://svn.apache.org/viewcvs?rev=291374&view=rev
Log:
o  Removed use of generics and JDK 1.5 util.concurrent.
o  Added dependency on backport-util-concurrent and updated imports.

Modified:
    directory/sandbox/trunk/osgi-spec/trunk/configuration/project.xml
    directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/ConfigurationAdminFactory.java
    directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/PluginManager.java
    directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/UpdateConsumer.java

Modified: directory/sandbox/trunk/osgi-spec/trunk/configuration/project.xml
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-spec/trunk/configuration/project.xml?rev=291374&r1=291373&r2=291374&view=diff
==============================================================================
--- directory/sandbox/trunk/osgi-spec/trunk/configuration/project.xml (original)
+++ directory/sandbox/trunk/osgi-spec/trunk/configuration/project.xml Sat Sep 24 21:13:10
2005
@@ -14,5 +14,15 @@
   <package>org.apache.configuration</package>
   <shortDescription>Apache Configuration Admin Bundle</shortDescription>
   <description>Apache Configuration Admin Bundle</description>
+  <dependencies>
+    <dependency>
+      <groupId>backport-util-concurrent</groupId>
+      <artifactId>backport-util-concurrent</artifactId>
+      <version>2.0_01_pd</version>
+      <properties>
+        <osgi.jar.bundle>true</osgi.jar.bundle>
+      </properties>
+    </dependency>
+  </dependencies>
 </project>
 

Modified: directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/ConfigurationAdminFactory.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/ConfigurationAdminFactory.java?rev=291374&r1=291373&r2=291374&view=diff
==============================================================================
--- directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/ConfigurationAdminFactory.java
(original)
+++ directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/ConfigurationAdminFactory.java
Sat Sep 24 21:13:10 2005
@@ -18,8 +18,6 @@
 package org.apache.configuration.impl;
 
 import java.util.Dictionary;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
 
 import javax.naming.spi.InitialContextFactory;
 
@@ -39,6 +37,9 @@
 import org.ungoverned.gravity.servicebinder.Lifecycle;
 import org.ungoverned.gravity.servicebinder.ServiceBinderContext;
 
+import edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue;
+import edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue;
+
 /**
  * ConfigurationAdmin implementation
  */
@@ -49,7 +50,7 @@
 
     public static final String DYNAMIC_BUNDLE_LOCATION = "dynamic.service.bundleLocation";
 
-    private BlockingQueue<UpdateEvent> queue = new LinkedBlockingQueue<UpdateEvent>();
+    private BlockingQueue queue = new LinkedBlockingQueue();
     private PluginManager pluginManager;
     private UpdateConsumer updateConsumer;
     private Thread updateThread;

Modified: directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/PluginManager.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/PluginManager.java?rev=291374&r1=291373&r2=291374&view=diff
==============================================================================
--- directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/PluginManager.java
(original)
+++ directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/PluginManager.java
Sat Sep 24 21:13:10 2005
@@ -48,17 +48,17 @@
     /**
      * Sorted Map of ranked ServiceReferences.
      */
-    private Map<RankingKey, ServiceReference> preModificationPlugins = new TreeMap<RankingKey,
ServiceReference>();
+    private Map preModificationPlugins = new TreeMap();
 
     /**
      * Sorted Map of ranked ServiceReferences.
      */
-    private Map<RankingKey, ServiceReference> modifyingPlugins = new TreeMap<RankingKey,
ServiceReference>();
+    private Map modifyingPlugins = new TreeMap();
 
     /**
      * Sorted Map of ranked ServiceReferences.
      */
-    private Map<RankingKey, ServiceReference> postModificationPlugins = new TreeMap<RankingKey,
ServiceReference>();
+    private Map postModificationPlugins = new TreeMap();
 
     PluginManager( BundleContext bc )
     {
@@ -85,15 +85,15 @@
         int eventType = event.getType();
         Object rankingProperty = sr.getProperty( CM_RANKING );
 
-        Integer ranking;
+        int ranking;
 
         if ( rankingProperty == null || rankingProperty.getClass() != Integer.class )
         {
-            ranking = new Integer( 0 );
+            ranking = 0;
         }
         else
         {
-            ranking = (Integer) rankingProperty;
+            ranking = ( (Integer) rankingProperty ).intValue();
         }
 
         RankingKey key = new RankingKey( ranking, sr );
@@ -242,10 +242,10 @@
 
     private class RankingKey implements Comparable
     {
-        private Integer ranking;
+        private int ranking;
         private ServiceReference reference;
 
-        private RankingKey( Integer ranking, ServiceReference reference )
+        private RankingKey( int ranking, ServiceReference reference )
         {
             this.ranking = ranking;
             this.reference = reference;

Modified: directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/UpdateConsumer.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/UpdateConsumer.java?rev=291374&r1=291373&r2=291374&view=diff
==============================================================================
--- directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/UpdateConsumer.java
(original)
+++ directory/sandbox/trunk/osgi-spec/trunk/configuration/src/main/java/org/apache/configuration/impl/UpdateConsumer.java
Sat Sep 24 21:13:10 2005
@@ -22,7 +22,6 @@
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.BlockingQueue;
 
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -39,6 +38,8 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue;
+
 public class UpdateConsumer implements Runnable, BundleListener
 {
     /** the log for this class */
@@ -47,16 +48,16 @@
     public static final String DYNAMIC_BUNDLE_LOCATION = "dynamic.service.bundleLocation";
 
     private static final String ANY_LOCATION = "*";
-    private Map<String, Set<String>> locationToPids = new HashMap<String,
Set<String>>();
-    private Set<String> existingBundleLocations = new HashSet<String>();
+    private Map locationToPids = new HashMap();
+    private Set existingBundleLocations = new HashSet();
 
     private BundleContext bc;
     private JndiConfigurationStore store;
     private PluginManager pluginManager;
-    private BlockingQueue<UpdateEvent> queue;
+    private BlockingQueue queue;
 
     public UpdateConsumer( BundleContext bc, JndiConfigurationStore store, PluginManager
pluginManager,
-            BlockingQueue<UpdateEvent> queue )
+            BlockingQueue queue )
     {
         this.bc = bc;
         this.store = store;
@@ -90,7 +91,7 @@
         {
             try
             {
-                update = queue.take();
+                update = (UpdateEvent) queue.take();
                 log.debug( "Dequeued update " + update.toString() );
                 handleEvent( update );
             }
@@ -440,11 +441,11 @@
             return;
         }
 
-        Set<String> pidsForLocation = locationToPids.get( bundleLocation );
+        Set pidsForLocation = (Set) locationToPids.get( bundleLocation );
 
         if ( pidsForLocation == null )
         {
-            pidsForLocation = new HashSet<String>();
+            pidsForLocation = new HashSet();
             locationToPids.put( bundleLocation, pidsForLocation );
         }
 
@@ -464,7 +465,7 @@
         }
 
         String bundleLocation = sr.getBundle().getLocation();
-        Set<String> pidsForLocation = locationToPids.get( bundleLocation );
+        Set pidsForLocation = (Set) locationToPids.get( bundleLocation );
 
         if ( pidsForLocation == null )
         {



Mime
View raw message