incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r528727 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal: el/ image/cache/ skin/ ui/ ui/composite/ ui/data/bean/ util/
Date Sat, 14 Apr 2007 00:58:32 GMT
Author: awiner
Date: Fri Apr 13 17:58:31 2007
New Revision: 528727

URL: http://svn.apache.org/viewvc?view=rev&rev=528727
Log:
ADFFACES-140: Use ConcurrentHashMap instead of home-grown OptimisticHashMap

Removed:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/util/OptimisticHashMap.java
Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/el/OracleHelpProvider.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/Cache.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/FileSystemImageCache.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/RendererFactoryImpl.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/composite/ContextPoppingUINode.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/composite/RootAttributeBoundValue.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/data/bean/BeanAdapterUtils.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/el/OracleHelpProvider.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/el/OracleHelpProvider.java?view=diff&rev=528727&r1=528726&r2=528727
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/el/OracleHelpProvider.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/el/OracleHelpProvider.java
Fri Apr 13 17:58:31 2007
@@ -20,7 +20,7 @@
 
 import javax.faces.context.FacesContext;
 
-import org.apache.myfaces.trinidadinternal.util.OptimisticHashMap;
+import java.util.concurrent.ConcurrentHashMap;
 
 import java.util.Locale;
 
@@ -69,7 +69,7 @@
     }
 
     _defaultOHWServletLocation = ohwServletLocation;
-    _localeSpecificServlets = new OptimisticHashMap<Locale, String>(13);
+    _localeSpecificServlets = new ConcurrentHashMap<Locale, String>(13);
   }
 
   /**
@@ -201,6 +201,6 @@
   private static final String _TOPIC_PARAM = "topic";
   private static final String _LOCALE_PARAM = "locale";
   private String _defaultOHWServletLocation = null;
-  private OptimisticHashMap<Locale, String> _localeSpecificServlets = null;
+  private ConcurrentHashMap<Locale, String> _localeSpecificServlets = null;
 }
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/Cache.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/Cache.java?view=diff&rev=528727&r1=528726&r2=528727
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/Cache.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/Cache.java
Fri Apr 13 17:58:31 2007
@@ -22,7 +22,7 @@
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
-import org.apache.myfaces.trinidadinternal.util.OptimisticHashMap;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.myfaces.trinidadinternal.agent.TrinidadAgent;
 
@@ -38,7 +38,7 @@
 {
   public Cache()
   {
-    _cache = new OptimisticHashMap<Object, CacheEntry>(_CACHE_SIZE);
+    _cache = new ConcurrentHashMap<Object, CacheEntry>(_CACHE_SIZE);
   }
 
   public CacheEntry get(ImageContext context, Object key)
@@ -313,7 +313,7 @@
   }
 
   // Hashtable of CacheKeys to CacheEntrys
-  private OptimisticHashMap<Object, CacheEntry> _cache;
+  private ConcurrentHashMap<Object, CacheEntry> _cache;
 
   // List of base names.
   // =-=ags We use a Hashtable so that lookups are quick.  However,

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/FileSystemImageCache.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/FileSystemImageCache.java?view=diff&rev=528727&r1=528726&r2=528727
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/FileSystemImageCache.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/FileSystemImageCache.java
Fri Apr 13 17:58:31 2007
@@ -41,6 +41,7 @@
 import java.util.Hashtable;
 import java.util.Locale;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
@@ -65,7 +66,6 @@
 import org.apache.myfaces.trinidadinternal.share.xml.XMLProvider;
 import org.apache.myfaces.trinidadinternal.share.xml.XMLUtils;
 import org.apache.myfaces.trinidadinternal.style.util.GraphicsUtils;
-import org.apache.myfaces.trinidadinternal.util.OptimisticHashMap;
 import org.apache.myfaces.trinidadinternal.util.nls.LocaleUtils;
 
 import org.xml.sax.InputSource;
@@ -156,7 +156,7 @@
     // Initialize our table of per-Locale caches.  Note on table size:
     // We don't expect a single FileSystemImageCache to be serving up images
     // for a huge number of different locales - using a small table size.
-     _caches = new OptimisticHashMap<String, Cache>(19);
+     _caches = new ConcurrentHashMap<String, Cache>(19);
   }
 
   /**
@@ -1732,7 +1732,7 @@
   // Hashtable containing caches (ie. Hashtables) hashed by Locale.
   // Each cache stores mappings from PropertiesKeys to the "base name"
   // of the image/metadata/map.
-  private OptimisticHashMap<String, Cache> _caches;
+  private ConcurrentHashMap<String, Cache> _caches;
 
   // The locale-independent cache
   private Cache _globalCache;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java?view=diff&rev=528727&r1=528726&r2=528727
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java
Fri Apr 13 17:58:31 2007
@@ -27,6 +27,7 @@
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 import java.util.Stack;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.faces.context.FacesContext;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
@@ -36,7 +37,6 @@
 import org.apache.myfaces.trinidad.skin.Icon;
 
 import org.apache.myfaces.trinidadinternal.skin.icon.ReferenceIcon;
-import org.apache.myfaces.trinidadinternal.util.OptimisticHashMap;
 
 import org.apache.myfaces.trinidadinternal.style.StyleContext;
 import org.apache.myfaces.trinidadinternal.style.xml.StyleSheetDocumentUtils;
@@ -450,7 +450,7 @@
     {
       // If we didn't previously have any translations for this
       // Locale, create storage for translations now...
-      localeTranslations = new OptimisticHashMap<String, Object>();
+      localeTranslations = new ConcurrentHashMap<String, Object>();
       _translations.put(locale, localeTranslations);
     }
 
@@ -651,8 +651,8 @@
   //
   // This HashMap hashes Locales -> HashMaps.
   // The HashMaps map translation key to message.
-  private OptimisticHashMap<Locale, Map<String, Object>> _translations =
-    new OptimisticHashMap<Locale, Map<String, Object>>(13);
+  private ConcurrentHashMap<Locale, Map<String, Object>> _translations =
+    new ConcurrentHashMap<Locale, Map<String, Object>>(13);
 
   // The StyleSheetDocument for the base LookAndFeel's style sheet
   private StyleSheetDocument _baseStyleSheetDocument;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java?view=diff&rev=528727&r1=528726&r2=528727
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java
Fri Apr 13 17:58:31 2007
@@ -25,6 +25,8 @@
 import java.util.MissingResourceException;
 import java.util.Stack;
 
+import java.util.concurrent.ConcurrentHashMap;
+
 import javax.faces.context.ExternalContext;
 
 import javax.faces.context.FacesContext;
@@ -46,7 +48,6 @@
 import org.apache.myfaces.trinidadinternal.style.xml.parse.StyleSheetDocument;
 import org.apache.myfaces.trinidadinternal.ui.laf.xml.parse.IconNode;
 import org.apache.myfaces.trinidadinternal.ui.laf.xml.parse.SkinPropertyNode;
-import org.apache.myfaces.trinidadinternal.util.OptimisticHashMap;
 
 /**
  * Defines the components (icons, styles, etc)
@@ -429,7 +430,7 @@
     )
   {
     if (_properties == null)
-      _properties = new OptimisticHashMap<Object, Object>();
+      _properties = new ConcurrentHashMap<Object, Object>();
 
     _properties.put(key, value);
   }
@@ -625,7 +626,7 @@
   }
 
   // HashMap that maps icon name to Icons
-  private OptimisticHashMap<String, Icon> _icons = new OptimisticHashMap<String,
Icon>();
+  private ConcurrentHashMap<String, Icon> _icons = new ConcurrentHashMap<String,
Icon>();
 
   // The StyleSheetDocument which contains all of the styles
   // for this Skin - including styles contributed by UIExtensions.
@@ -643,7 +644,7 @@
   private StyleSheetEntry[] _extensionStyleSheets;
 
   // HashMap of Skin properties
-  private OptimisticHashMap<Object, Object> _properties;
+  private ConcurrentHashMap<Object, Object> _properties;
 
   // Map of property to class type
   private static final Map<String, Class<?>> _PROPERTY_CLASS_TYPE_MAP;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/RendererFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/RendererFactoryImpl.java?view=diff&rev=528727&r1=528726&r2=528727
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/RendererFactoryImpl.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/RendererFactoryImpl.java
Fri Apr 13 17:58:31 2007
@@ -18,7 +18,7 @@
  */
 package org.apache.myfaces.trinidadinternal.ui;
 
-import org.apache.myfaces.trinidadinternal.util.OptimisticHashMap;
+import java.util.concurrent.ConcurrentHashMap;
 
 
 /**
@@ -129,6 +129,6 @@
   }
 
 
-  private OptimisticHashMap<String, Object> _renderers = 
-    new OptimisticHashMap<String, Object>(101);
+  private ConcurrentHashMap<String, Object> _renderers = 
+    new ConcurrentHashMap<String, Object>(101);
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/composite/ContextPoppingUINode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/composite/ContextPoppingUINode.java?view=diff&rev=528727&r1=528726&r2=528727
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/composite/ContextPoppingUINode.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/composite/ContextPoppingUINode.java
Fri Apr 13 17:58:31 2007
@@ -20,7 +20,7 @@
 
 import java.io.IOException;
 
-import org.apache.myfaces.trinidadinternal.util.OptimisticHashMap;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.myfaces.trinidadinternal.ui.AttributeKey;
 import org.apache.myfaces.trinidadinternal.ui.BaseUINode;
@@ -257,8 +257,8 @@
 
   private static final Renderer _RENDERER = new ContextPoppingRenderer();
 
-  private static OptimisticHashMap<Object, ContextPoppingUINode> _sContextPoppers =

-    new OptimisticHashMap<Object, ContextPoppingUINode>(203);
+  private static ConcurrentHashMap<Object, ContextPoppingUINode> _sContextPoppers =

+    new ConcurrentHashMap<Object, ContextPoppingUINode>(203);
 
   private String _childName;
   private int    _childIndex;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/composite/RootAttributeBoundValue.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/composite/RootAttributeBoundValue.java?view=diff&rev=528727&r1=528726&r2=528727
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/composite/RootAttributeBoundValue.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/composite/RootAttributeBoundValue.java
Fri Apr 13 17:58:31 2007
@@ -18,7 +18,7 @@
  */
 package org.apache.myfaces.trinidadinternal.ui.composite;
 
-import org.apache.myfaces.trinidadinternal.util.OptimisticHashMap;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.myfaces.trinidadinternal.ui.AttributeKey;
 import org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext;
@@ -103,8 +103,8 @@
     return null;
   }
 
-  private static OptimisticHashMap<AttributeKey, RootAttributeBoundValue> _boundValues
= 
-    new OptimisticHashMap<AttributeKey, RootAttributeBoundValue>();
+  private static ConcurrentHashMap<AttributeKey, RootAttributeBoundValue> _boundValues
= 
+    new ConcurrentHashMap<AttributeKey, RootAttributeBoundValue>();
 
   private AttributeKey _attrKey;
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/data/bean/BeanAdapterUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/data/bean/BeanAdapterUtils.java?view=diff&rev=528727&r1=528726&r2=528727
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/data/bean/BeanAdapterUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/data/bean/BeanAdapterUtils.java
Fri Apr 13 17:58:31 2007
@@ -20,8 +20,7 @@
 
 import java.util.Collection;
 import java.util.Map;
-
-import org.apache.myfaces.trinidadinternal.util.OptimisticHashMap;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
@@ -207,7 +206,7 @@
     private final Map<Object, Object> _map;
   }
 
-  static private final OptimisticHashMap<Class<?>, Class<?>> _sAdapters
=
-    new OptimisticHashMap<Class<?>, Class<?>>(101);
+  static private final ConcurrentHashMap<Class<?>, Class<?>> _sAdapters
=
+    new ConcurrentHashMap<Class<?>, Class<?>>(101);
   private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(BeanAdapterUtils.class);
 }



Mime
View raw message