[jboss-cvs] JBossAS SVN: r62492 - in projects/aop/trunk/aop/src/main/org/jboss/aop: annotation and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Apr 23 13:27:47 EDT 2007


Author: kabir.khan at jboss.com
Date: 2007-04-23 13:27:46 -0400 (Mon, 23 Apr 2007)
New Revision: 62492

Modified:
   projects/aop/trunk/aop/src/main/org/jboss/aop/Advisor.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/AspectManager.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/ClassAdvisor.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/Dispatcher.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/GeneratedClassAdvisor.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/InstanceAdvisorDelegate.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/InterceptionMarkers.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/annotation/AnnotationRepository.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/classpool/AOPClassPool.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/metadata/MethodMetaData.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/util/UnmodifiableEmptyCollections.java
Log:
[JBAOP-394] Replace EDU.oswego classes with their java.util.concurrent counterparts

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/Advisor.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/Advisor.java	2007-04-23 16:57:35 UTC (rev 62491)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/Advisor.java	2007-04-23 17:27:46 UTC (rev 62492)
@@ -37,6 +37,8 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArraySet;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import javassist.CtClass;
@@ -75,9 +77,6 @@
 import org.jboss.util.NestedRuntimeException;
 import org.jboss.util.NotImplementedException;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
-import EDU.oswego.cs.dl.util.concurrent.CopyOnWriteArraySet;
-
 /**
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
@@ -139,10 +138,10 @@
    protected boolean doesHaveAspects = false;
 
    protected String name;
-   protected ConcurrentReaderHashMap aspects = new ConcurrentReaderHashMap();
+   protected ConcurrentHashMap aspects = new ConcurrentHashMap();
    protected HashMap adviceInterceptors = new HashMap();
    protected CopyOnWriteArraySet perInstanceAspectDefinitions = UnmodifiableEmptyCollections.EMPTY_COPYONWRITE_ARRAYSET;
-   protected ConcurrentReaderHashMap perInstanceJoinpointAspectDefinitions = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP;
+   protected ConcurrentHashMap perInstanceJoinpointAspectDefinitions = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP;
 
    static Class cl = java.lang.String.class;
    protected TLongObjectHashMap advisedMethods = UnmodifiableEmptyCollections.EMPTY_TLONG_OBJECT_HASHMAP;
@@ -1261,14 +1260,14 @@
    
    protected void initPerInstanceJoinpointAspectDefinitionsMap()
    {
-      if (perInstanceJoinpointAspectDefinitions == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+      if (perInstanceJoinpointAspectDefinitions == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
       {
          lockWrite();
          try
          {
-            if (perInstanceJoinpointAspectDefinitions == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+            if (perInstanceJoinpointAspectDefinitions == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
             {
-               perInstanceJoinpointAspectDefinitions = new ConcurrentReaderHashMap();
+               perInstanceJoinpointAspectDefinitions = new ConcurrentHashMap();
             }
          }
          finally

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/AspectManager.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/AspectManager.java	2007-04-23 16:57:35 UTC (rev 62491)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/AspectManager.java	2007-04-23 17:27:46 UTC (rev 62492)
@@ -38,6 +38,7 @@
 import java.util.StringTokenizer;
 import java.util.WeakHashMap;
 import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.jboss.aop.advice.AdviceBinding;
@@ -76,7 +77,6 @@
 import org.jboss.util.collection.WeakValueHashMap;
 import org.jboss.util.loading.Translatable;
 import org.jboss.util.loading.Translator;
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
 import javassist.ClassPool;
 import javassist.CtClass;
 import javassist.scopedpool.ScopedClassPool;
@@ -130,10 +130,10 @@
    protected HashMap classMetaDataLoaders = UnmodifiableEmptyCollections.EMPTY_HASHMAP;
    protected HashMap interceptorStacks = UnmodifiableEmptyCollections.EMPTY_HASHMAP;
    protected HashMap declares = UnmodifiableEmptyCollections.EMPTY_HASHMAP;
-   protected ConcurrentReaderHashMap cflowStacks = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP;
-   protected ConcurrentReaderHashMap dynamicCFlows = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP;
-   protected ConcurrentReaderHashMap aspectDefinitions = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP;
-   protected ConcurrentReaderHashMap perVMAspects = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP;
+   protected ConcurrentHashMap cflowStacks = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP;
+   protected ConcurrentHashMap dynamicCFlows = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP;
+   protected ConcurrentHashMap aspectDefinitions = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP;
+   protected ConcurrentHashMap perVMAspects = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP;
 
    /** class name prefixes to explicitly exclude unless contained in include. Maintained by top-level AspectManager */
    protected ArrayList exclude = UnmodifiableEmptyCollections.EMPTY_ARRAYLIST;
@@ -2309,14 +2309,14 @@
    
    protected void initCflowStacksMap()
    {
-      if (cflowStacks == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+      if (cflowStacks == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
       {
          lockWrite();
          try
          {
-            if (cflowStacks == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+            if (cflowStacks == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
             {
-               cflowStacks = new ConcurrentReaderHashMap();
+               cflowStacks = new ConcurrentHashMap();
             }
          }
          finally
@@ -2328,14 +2328,14 @@
    
    protected void initDynamicCflowsMap()
    {
-      if (dynamicCFlows == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+      if (dynamicCFlows == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
       {
          lockWrite();
          try
          {
-            if (dynamicCFlows == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+            if (dynamicCFlows == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
             {
-               dynamicCFlows = new ConcurrentReaderHashMap();
+               dynamicCFlows = new ConcurrentHashMap();
             }
          }
          finally
@@ -2347,14 +2347,14 @@
    
    protected void initAspectDefintitionsMap()
    {
-      if (aspectDefinitions == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+      if (aspectDefinitions == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
       {
          lockWrite();
          try
          {
-            if (aspectDefinitions == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+            if (aspectDefinitions == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
             {
-               aspectDefinitions = new ConcurrentReaderHashMap();
+               aspectDefinitions = new ConcurrentHashMap();
             }
          }
          finally
@@ -2366,14 +2366,14 @@
    
    protected void initPerVMAspectsMap()
    {
-      if (perVMAspects == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+      if (perVMAspects == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
       {
          lockWrite();
          try
          {
-            if (perVMAspects == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+            if (perVMAspects == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
             {
-               perVMAspects = new ConcurrentReaderHashMap();
+               perVMAspects = new ConcurrentHashMap();
             }
          }
          finally

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/ClassAdvisor.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/ClassAdvisor.java	2007-04-23 16:57:35 UTC (rev 62491)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/ClassAdvisor.java	2007-04-23 17:27:46 UTC (rev 62492)
@@ -96,10 +96,6 @@
 
    //Information about con by method caller pointcuts, lazy initialized when needed
    private volatile ConByMethodData conByMethodData;
-//   // constructor caller pointcut support for methods calling constructors only
-//   protected TLongObjectHashMap conCalledByMethodBindings = new TLongObjectHashMap();
-//   protected HashMap backrefConCalledByMethodBindings = new HashMap();
-//   protected TLongObjectHashMap conCalledByMethodInterceptors = new TLongObjectHashMap();
 
    // caller pointcut support for constructors calling methods
    protected HashMap[] methodCalledByConBindings;

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/Dispatcher.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/Dispatcher.java	2007-04-23 16:57:35 UTC (rev 62491)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/Dispatcher.java	2007-04-23 17:27:46 UTC (rev 62492)
@@ -25,6 +25,8 @@
 import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
 import org.jboss.aop.joinpoint.Invocation;
 import org.jboss.aop.joinpoint.InvocationResponse;
 import org.jboss.aop.joinpoint.MethodInvocation;
@@ -33,8 +35,6 @@
 import org.jboss.aop.proxy.Proxy;
 import org.jboss.aop.util.reference.MethodPersistentReference;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
-
 /**
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
@@ -46,7 +46,7 @@
    public static final String OID = "OID";
    public static final Dispatcher singleton = new Dispatcher();
 
-   Map targetMap = new ConcurrentReaderHashMap();
+   Map targetMap = new ConcurrentHashMap();
 
 
    public boolean isRegistered(Object oid)

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/GeneratedClassAdvisor.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/GeneratedClassAdvisor.java	2007-04-23 16:57:35 UTC (rev 62491)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/GeneratedClassAdvisor.java	2007-04-23 17:27:46 UTC (rev 62492)
@@ -28,6 +28,7 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.jboss.aop.advice.AdviceBinding;
 import org.jboss.aop.advice.AspectDefinition;
@@ -49,8 +50,6 @@
 import org.jboss.aop.joinpoint.MethodJoinpoint;
 import org.jboss.aop.pointcut.PointcutMethodMatch;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
-
 import gnu.trove.TLongObjectHashMap;
 
 /**
@@ -78,15 +77,15 @@
 
    //TODO These are only needed for the class advisor really
    //All joinpoint generators apart from field reads and constructions go in here
-   private ConcurrentReaderHashMap joinPoinGenerators = new ConcurrentReaderHashMap();
+   private ConcurrentHashMap joinPoinGenerators = new ConcurrentHashMap();
    //Needs its own map to avoid crashing with the field write generators
-   private ConcurrentReaderHashMap fieldReadJoinPoinGenerators = new ConcurrentReaderHashMap();
+   private ConcurrentHashMap fieldReadJoinPoinGenerators = new ConcurrentHashMap();
    //Needs its own map to avoid crashing with the constructor generators
-   private ConcurrentReaderHashMap constructionJoinPointGenerators = new ConcurrentReaderHashMap();
+   private ConcurrentHashMap constructionJoinPointGenerators = new ConcurrentHashMap();
    
-   ConcurrentReaderHashMap oldInfos = new ConcurrentReaderHashMap();
-   ConcurrentReaderHashMap oldFieldReadInfos = new ConcurrentReaderHashMap();
-   ConcurrentReaderHashMap oldConstructionInfos = new ConcurrentReaderHashMap();
+   ConcurrentHashMap oldInfos = new ConcurrentHashMap();
+   ConcurrentHashMap oldFieldReadInfos = new ConcurrentHashMap();
+   ConcurrentHashMap oldConstructionInfos = new ConcurrentHashMap();
 
    boolean initialisedSuperClasses; 
 
@@ -694,12 +693,12 @@
    {
       //An extra level of indirection since we distinguish between callers of method depending on
       //where the called method is defined (sub/super interfaces)
-      ConcurrentReaderHashMap map = (ConcurrentReaderHashMap)joinPoinGenerators.get(info.getJoinpoint());
+      ConcurrentHashMap map = (ConcurrentHashMap)joinPoinGenerators.get(info.getJoinpoint());
       if (map == null)
       {
-         map = new ConcurrentReaderHashMap();
+         map = new ConcurrentHashMap();
          joinPoinGenerators.put(info.getJoinpoint(), map);
-         map = (ConcurrentReaderHashMap)joinPoinGenerators.get(info.getJoinpoint());
+         map = (ConcurrentHashMap)joinPoinGenerators.get(info.getJoinpoint());
       }
 
       MethodByConJoinPointGenerator generator = getJoinPointGenerator(info);
@@ -862,7 +861,7 @@
     * Generated ClassAdvisors and InstanceAdvisors will be different instances,
     * so keep track of what per_class_joinpoint aspects have been added where
     */
-   ConcurrentReaderHashMap perClassJoinpointAspectDefinitions = new ConcurrentReaderHashMap();
+   ConcurrentHashMap perClassJoinpointAspectDefinitions = new ConcurrentHashMap();
 
 
    public Object getPerClassJoinpointAspect(AspectDefinition def, Joinpoint joinpoint)
@@ -875,7 +874,7 @@
       Map joinpoints = (Map)perClassJoinpointAspectDefinitions.get(def);
       if (joinpoints == null)
       {
-         joinpoints = new ConcurrentReaderHashMap();
+         joinpoints = new ConcurrentHashMap();
          perClassJoinpointAspectDefinitions.put(def, joinpoints);
       }
 
@@ -1164,12 +1163,12 @@
       {
          //An extra level of indirection since we distinguish between callers of method depending on
          //where the called method is defined (sub/super interfaces)
-         ConcurrentReaderHashMap map = (ConcurrentReaderHashMap)joinPoinGenerators.get(info.getJoinpoint());
+         ConcurrentHashMap map = (ConcurrentHashMap)joinPoinGenerators.get(info.getJoinpoint());
          if (map == null)
          {
-            map = new ConcurrentReaderHashMap();
+            map = new ConcurrentHashMap();
             joinPoinGenerators.put(info.getJoinpoint(), map);
-            map = (ConcurrentReaderHashMap)joinPoinGenerators.get(info.getJoinpoint());
+            map = (ConcurrentHashMap)joinPoinGenerators.get(info.getJoinpoint());
          }
 
          MethodByMethodJoinPointGenerator generator = (MethodByMethodJoinPointGenerator)map.get(info.getCalledClass());
@@ -1209,12 +1208,12 @@
       {
          //An extra level of indirection since we distinguish between callers of method depending on
          //where the called method is defined (sub/super interfaces)
-         ConcurrentReaderHashMap map = (ConcurrentReaderHashMap)joinPoinGenerators.get(info.getJoinpoint());
+         ConcurrentHashMap map = (ConcurrentHashMap)joinPoinGenerators.get(info.getJoinpoint());
          if (map == null)
          {
-            map = new ConcurrentReaderHashMap();
+            map = new ConcurrentHashMap();
             joinPoinGenerators.put(info.getJoinpoint(), map);
-            map = (ConcurrentReaderHashMap)joinPoinGenerators.get(info.getJoinpoint());
+            map = (ConcurrentHashMap)joinPoinGenerators.get(info.getJoinpoint());
          }
 
          MethodByConJoinPointGenerator generator = (MethodByConJoinPointGenerator)map.get(info.getCalledClass());

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/InstanceAdvisorDelegate.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/InstanceAdvisorDelegate.java	2007-04-23 16:57:35 UTC (rev 62491)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/InstanceAdvisorDelegate.java	2007-04-23 17:27:46 UTC (rev 62492)
@@ -27,13 +27,12 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.WeakHashMap;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.jboss.aop.advice.AspectDefinition;
 import org.jboss.aop.joinpoint.Joinpoint;
 import org.jboss.aop.metadata.SimpleMetaData;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
-
 /**
  * Initialisation and getting of instance and joinpoint aspects needed by the various kinds of
  * InstanceAdvisor implementations
@@ -122,7 +121,7 @@
          while (it.hasNext())
          {
             AspectDefinition def = (AspectDefinition) it.next();
-            ConcurrentReaderHashMap joins = new ConcurrentReaderHashMap();
+            ConcurrentHashMap joins = new ConcurrentHashMap();
             joinpointAspects.put(def, joins);
             Set joinpoints = (Set) jpAspects.get(def);
             Iterator jps = joinpoints.iterator();
@@ -198,7 +197,7 @@
                Map map = (Map) copy.get(def);
                if (map == null)
                {
-                  map = new ConcurrentReaderHashMap();
+                  map = new ConcurrentHashMap();
                }
                map.put(joinpoint, aspect);
                joinpointAspects = copy;

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/InterceptionMarkers.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/InterceptionMarkers.java	2007-04-23 16:57:35 UTC (rev 62491)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/InterceptionMarkers.java	2007-04-23 17:27:46 UTC (rev 62492)
@@ -21,7 +21,7 @@
 */ 
 package org.jboss.aop;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * 
@@ -30,13 +30,13 @@
  */
 public class InterceptionMarkers
 {
-   protected final ConcurrentReaderHashMap convertableReference = new ConcurrentReaderHashMap();
-   protected final ConcurrentReaderHashMap hasFieldInterception = new ConcurrentReaderHashMap();
-   protected final ConcurrentReaderHashMap hasConstructorInterception = new ConcurrentReaderHashMap();
+   protected final ConcurrentHashMap convertableReference = new ConcurrentHashMap();
+   protected final ConcurrentHashMap hasFieldInterception = new ConcurrentHashMap();
+   protected final ConcurrentHashMap hasConstructorInterception = new ConcurrentHashMap();
 
-   protected final ConcurrentReaderHashMap skipConvertableReference = new ConcurrentReaderHashMap();
-   protected final ConcurrentReaderHashMap skipFieldInterception = new ConcurrentReaderHashMap();
-   protected final ConcurrentReaderHashMap skipConstructorInterception = new ConcurrentReaderHashMap();
+   protected final ConcurrentHashMap skipConvertableReference = new ConcurrentHashMap();
+   protected final ConcurrentHashMap skipFieldInterception = new ConcurrentHashMap();
+   protected final ConcurrentHashMap skipConstructorInterception = new ConcurrentHashMap();
 
    public void addConstructionInterceptionMarker(String classname)
    {

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/annotation/AnnotationRepository.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/annotation/AnnotationRepository.java	2007-04-23 16:57:35 UTC (rev 62491)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/annotation/AnnotationRepository.java	2007-04-23 17:27:46 UTC (rev 62492)
@@ -29,12 +29,12 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.jboss.aop.annotation.factory.duplicate.AnnotationCreator;
 import org.jboss.aop.util.UnmodifiableEmptyCollections;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
 import javassist.CtMember;
 
 /**
@@ -50,9 +50,9 @@
    /** Read/Write lock to be used when lazy creating the collections */
    protected ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
 
-   Map annotations = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP;
-   Map classAnnotations = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP;
-   Map disabledAnnotations = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP;
+   Map annotations = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP;
+   Map classAnnotations = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP;
+   Map disabledAnnotations = UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP;
    
    public Map getAnnotations()
    {
@@ -285,14 +285,14 @@
 
    protected void initAnnotationsMap()
    {
-      if (annotations == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+      if (annotations == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
       {
          lockWrite();
          try
          {
-            if (annotations == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+            if (annotations == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
             {
-               annotations = new ConcurrentReaderHashMap();;
+               annotations = new ConcurrentHashMap();;
             }
          }
          finally
@@ -304,14 +304,14 @@
 
    protected void initClassAnnotationsMap()
    {
-      if (classAnnotations == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+      if (classAnnotations == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
       {
          lockWrite();
          try
          {
-            if (classAnnotations == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+            if (classAnnotations == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
             {
-               classAnnotations = new ConcurrentReaderHashMap();;
+               classAnnotations = new ConcurrentHashMap();;
             }
          }
          finally
@@ -323,14 +323,14 @@
 
    protected void initDisabledAnnotationsMap()
    {
-      if (disabledAnnotations == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+      if (disabledAnnotations == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
       {
          lockWrite();
          try
          {
-            if (disabledAnnotations == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_READER_HASHMAP)
+            if (disabledAnnotations == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_HASHMAP)
             {
-               disabledAnnotations = new ConcurrentReaderHashMap();;
+               disabledAnnotations = new ConcurrentHashMap();;
             }
          }
          finally

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/classpool/AOPClassPool.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/classpool/AOPClassPool.java	2007-04-23 16:57:35 UTC (rev 62491)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/classpool/AOPClassPool.java	2007-04-23 17:27:46 UTC (rev 62492)
@@ -24,10 +24,10 @@
 import java.lang.ref.WeakReference;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.jboss.aop.AspectManager;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
 import javassist.ClassPool;
 import javassist.CtClass;
 import javassist.NotFoundException;
@@ -41,9 +41,9 @@
 public class AOPClassPool extends ScopedClassPool
 {
    /** Classnames of classes that will be created - we do not want to look for these in other pools */
-   protected ConcurrentReaderHashMap generatedClasses = new ConcurrentReaderHashMap();
+   protected ConcurrentHashMap generatedClasses = new ConcurrentHashMap();
    
-   protected ConcurrentReaderHashMap localResources = new ConcurrentReaderHashMap();
+   protected ConcurrentHashMap localResources = new ConcurrentHashMap();
 
    static 
    {

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/metadata/MethodMetaData.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/metadata/MethodMetaData.java	2007-04-23 16:57:35 UTC (rev 62491)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/metadata/MethodMetaData.java	2007-04-23 17:27:46 UTC (rev 62492)
@@ -25,12 +25,11 @@
 import org.jboss.aop.joinpoint.MethodInvocation;
 import org.jboss.aop.util.PayloadKey;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
-
 import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 /**
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
@@ -39,7 +38,7 @@
  */
 public class MethodMetaData implements MetaDataResolver
 {
-   Map methodMetaData = new ConcurrentReaderHashMap();
+   Map methodMetaData = new ConcurrentHashMap();
    HashMap inexactMatches;
 
    public boolean hasTag(String group)

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/util/UnmodifiableEmptyCollections.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/util/UnmodifiableEmptyCollections.java	2007-04-23 16:57:35 UTC (rev 62491)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/util/UnmodifiableEmptyCollections.java	2007-04-23 17:27:46 UTC (rev 62492)
@@ -29,13 +29,12 @@
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.WeakHashMap;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArraySet;
 
 import org.jboss.util.collection.WeakValueHashMap;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
-import EDU.oswego.cs.dl.util.concurrent.CopyOnWriteArraySet;
 
-
 /**
  * Implementation of different types of maps, lists etc. that do not support modification.
  * Collections.unmodifiableMap() returns an instanceof Collections$UnmodifiableMap
@@ -47,13 +46,13 @@
 public class UnmodifiableEmptyCollections
 {
    public static final LinkedHashMap EMPTY_LINKED_HASHMAP = new LockedLinkedHashMap();
-   public static final ConcurrentReaderHashMap EMPTY_CONCURRENT_READER_HASHMAP = new LockedConcurrentReaderHashMap();
    public static final HashMap EMPTY_HASHMAP = new LockedHashMap();
    public static final WeakHashMap EMPTY_WEAK_HASHMAP = new LockedWeakHashMap();
    public static final WeakValueHashMap EMPTY_WEAK_VALUE_HASHMAP = new LockedWeakValueHashMap();
    public static final ArrayList EMPTY_ARRAYLIST = new LockedArrayList();
    public static final CopyOnWriteArraySet EMPTY_COPYONWRITE_ARRAYSET = new LockedCopyOnWriteArraySet();
    public static final TLongObjectHashMap EMPTY_TLONG_OBJECT_HASHMAP = new LockedTLongObjectHashMap();
+   public static final ConcurrentHashMap EMPTY_CONCURRENT_HASHMAP = new LockedConcurrentHashMap();
 
    private static class LockedHashMap<K,V> extends HashMap<K,V>
    {
@@ -87,22 +86,6 @@
       }
    }
 
-   private static class LockedConcurrentReaderHashMap extends ConcurrentReaderHashMap
-   {
-      private static final long serialVersionUID = 1L;
-
-      @Override
-      public Object put(Object arg0, Object arg1)
-      {
-         return super.put(arg0, arg1);
-      }
-      @Override
-      public synchronized void putAll(Map arg0)
-      {
-         super.putAll(arg0);
-      }
-   }
-   
    private static class LockedWeakHashMap<K,V> extends WeakHashMap<K,V>
    {
       private static final long serialVersionUID = 1L;
@@ -154,23 +137,22 @@
       }
    }
    
-   private static class LockedCopyOnWriteArraySet extends CopyOnWriteArraySet
+   private static class LockedCopyOnWriteArraySet<E> extends CopyOnWriteArraySet<E>
    {
       private static final long serialVersionUID = 1L;
 
       @Override
-      public boolean add(Object arg0)
+      public boolean add(E arg0)
       {
-         return super.add(arg0);
+         throw new UnsupportedOperationException();
       }
 
       @Override
-      public boolean addAll(Collection arg0)
+      public boolean addAll(Collection<? extends E> arg0)
       {
-         return super.addAll(arg0);
+         throw new UnsupportedOperationException();
       }
    }
-
    
    private static class LockedTLongObjectHashMap extends TLongObjectHashMap
    {
@@ -181,4 +163,21 @@
          throw new UnsupportedOperationException();
       }
    }
+   
+   private static class LockedConcurrentHashMap<K, V> extends ConcurrentHashMap<K, V>
+   {
+      private static final long serialVersionUID = 1L;
+
+      @Override
+      public V put(K key, V value) 
+      {
+         throw new UnsupportedOperationException();
+      }
+      @Override
+      public void putAll(Map<? extends K, ? extends V> t) 
+      {
+         throw new UnsupportedOperationException();
+      }
+   }
+   
 }




More information about the jboss-cvs-commits mailing list