wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r813643 - /incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/registry/ProvidersRegistry.java
Date Fri, 11 Sep 2009 00:41:31 GMT
Author: bluk
Date: Fri Sep 11 00:41:30 2009
New Revision: 813643

URL: http://svn.apache.org/viewvc?rev=813643&view=rev
Log:
Update ProvidersRegistry with ConcurrentHashMap

See [WINK-175]

Modified:
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/registry/ProvidersRegistry.java

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/registry/ProvidersRegistry.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/registry/ProvidersRegistry.java?rev=813643&r1=813642&r2=813643&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/registry/ProvidersRegistry.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/registry/ProvidersRegistry.java
Fri Sep 11 00:41:30 2009
@@ -35,6 +35,8 @@
 import java.util.Set;
 import java.util.TreeSet;
 import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -54,8 +56,6 @@
 import org.apache.wink.common.internal.lifecycle.LifecycleManagersRegistry;
 import org.apache.wink.common.internal.lifecycle.ObjectFactory;
 import org.apache.wink.common.internal.utils.GenericsUtils;
-import org.apache.wink.common.internal.utils.SimpleConcurrentMap;
-import org.apache.wink.common.internal.utils.SimpleMap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -426,12 +426,12 @@
 
     private abstract class MediaTypeMap<T> {
 
-        private final Map<MediaType, Set<ObjectFactory<T>>>           
                                data           =
-                                                                                        
                                 new LinkedHashMap<MediaType, Set<ObjectFactory<T>>>();
-        private final Class<?>                                                    
                    rawType;
+        private final Map<MediaType, Set<ObjectFactory<T>>>           
                              data           =
+                                                                                        
                               new LinkedHashMap<MediaType, Set<ObjectFactory<T>>>();
+        private final Class<?>                                                    
                  rawType;
 
-        private final SimpleMap<Class<?>, SoftReference<SimpleMap<MediaType,
List<ObjectFactory<T>>>>> providersCache =
-                                                                                        
                                 new SimpleConcurrentMap<Class<?>, SoftReference<SimpleMap<MediaType,
List<ObjectFactory<T>>>>>(); ;
+        private final Map<Class<?>, SoftReference<ConcurrentMap<MediaType,
List<ObjectFactory<T>>>>> providersCache =
+                                                                                        
                               new ConcurrentHashMap<Class<?>, SoftReference<ConcurrentMap<MediaType,
List<ObjectFactory<T>>>>>(); ;
 
         public MediaTypeMap(Class<?> rawType) {
             super();
@@ -452,19 +452,19 @@
                 mediaType = new MediaType(type, subtype);
             }
 
-            SoftReference<SimpleMap<MediaType, List<ObjectFactory<T>>>>
mediaTypeToProvidersCacheRef =
+            SoftReference<ConcurrentMap<MediaType, List<ObjectFactory<T>>>>
mediaTypeToProvidersCacheRef =
                 providersCache.get(cls);
-            SimpleMap<MediaType, List<ObjectFactory<T>>> mediaTypeToProvidersCache
= null;
+            ConcurrentMap<MediaType, List<ObjectFactory<T>>> mediaTypeToProvidersCache
= null;
             if (mediaTypeToProvidersCacheRef != null) {
                 mediaTypeToProvidersCache = mediaTypeToProvidersCacheRef.get();
             }
             if (mediaTypeToProvidersCache == null) {
                 mediaTypeToProvidersCache =
-                    new SimpleConcurrentMap<MediaType, List<ObjectFactory<T>>>();
+                    new ConcurrentHashMap<MediaType, List<ObjectFactory<T>>>();
                 providersCache
                     .put(cls,
-                         new SoftReference<SimpleMap<MediaType, List<ObjectFactory<T>>>>(
-                                                                                        
mediaTypeToProvidersCache));
+                         new SoftReference<ConcurrentMap<MediaType, List<ObjectFactory<T>>>>(
+                                                                                        
    mediaTypeToProvidersCache));
             }
 
             List<ObjectFactory<T>> list = mediaTypeToProvidersCache.get(mediaType);



Mime
View raw message