commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1088064 - /commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/EnvironmentCache.java
Date Sat, 02 Apr 2011 16:58:45 GMT
Author: simonetripodi
Date: Sat Apr  2 16:58:45 2011
New Revision: 1088064

URL: http://svn.apache.org/viewvc?rev=1088064&view=rev
Log:
environment cache is a map of classloader,map

Modified:
    commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/EnvironmentCache.java

Modified: commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/EnvironmentCache.java
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/EnvironmentCache.java?rev=1088064&r1=1088063&r2=1088064&view=diff
==============================================================================
--- commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/EnvironmentCache.java
(original)
+++ commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/EnvironmentCache.java
Sat Apr  2 16:58:45 2011
@@ -17,6 +17,7 @@
 package org.apache.commons.discovery.tools;
 
 import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.commons.discovery.jdk.JDKHooks;
 
@@ -48,7 +49,7 @@ public class EnvironmentCache {
      * as HashMap (unsynchronized).
      * 
      */
-    private static final HashMap root_cache = new HashMap();
+    private static final Map<ClassLoader, Map<String, Object>> root_cache = new
HashMap<ClassLoader, Map<String, Object>>();
 
     /**
      * Initial hash size for SPI's, default just seem TO big today..
@@ -58,7 +59,7 @@ public class EnvironmentCache {
     /**
      * Get object keyed by classLoader.
      */
-    public static synchronized Object get(ClassLoader classLoader)
+    public static synchronized Map<String, Object> get(ClassLoader classLoader)
     {
         /**
          * 'null' (bootstrap/system class loader) thread context class loader
@@ -70,14 +71,14 @@ public class EnvironmentCache {
     /**
      * Put service keyed by spi & classLoader.
      */
-    public static synchronized void put(ClassLoader classLoader, Object object)
+    public static synchronized void put(ClassLoader classLoader, Map<String, Object>
spis)
     {
         /**
          * 'null' (bootstrap/system class loader) thread context class loader
          * is ok...  Until we learn otherwise.
          */
-        if (object != null) {
-            root_cache.put(classLoader, object);
+        if (spis != null) {
+            root_cache.put(classLoader, spis);
         }
     }
 



Mime
View raw message