[jboss-svn-commits] JBoss Common SVN: r2391 - in common-core/trunk: src/main/java/org/jboss/net/sockets and 6 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Apr 25 01:29:48 EDT 2007


Author: scott.stark at jboss.org
Date: 2007-04-25 01:29:48 -0400 (Wed, 25 Apr 2007)
New Revision: 2391

Modified:
   common-core/trunk/.classpath
   common-core/trunk/pom.xml
   common-core/trunk/src/main/java/org/jboss/net/sockets/QueuedClientSocketFactory.java
   common-core/trunk/src/main/java/org/jboss/net/sockets/TimeoutClientSocketFactory.java
   common-core/trunk/src/main/java/org/jboss/util/collection/CollectionsFactory.java
   common-core/trunk/src/main/java/org/jboss/util/file/ArchiveBrowser.java
   common-core/trunk/src/main/java/org/jboss/util/id/UID.java
   common-core/trunk/src/main/java/org/jboss/util/threadpool/BasicThreadPool.java
   common-core/trunk/src/main/java/org/jboss/util/threadpool/MinPooledExecutor.java
   common-core/trunk/src/main/java/org/jboss/util/timeout/HashedTimeoutPriorityQueueImpl.java
   common-core/trunk/src/main/java/org/jboss/util/timeout/TimeoutFactory.java
   common-core/trunk/src/main/java/org/jboss/util/xml/JBossEntityResolver.java
Log:
Create a 2.2.x codebase that has no oswego concurrent dependency.

Modified: common-core/trunk/.classpath
===================================================================
--- common-core/trunk/.classpath	2007-04-25 03:28:49 UTC (rev 2390)
+++ common-core/trunk/.classpath	2007-04-25 05:29:48 UTC (rev 2391)
@@ -6,9 +6,8 @@
 	<classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
 	<classpathentry kind="var" path="M2_REPO/apache-slide/webdavlib/2.0/webdavlib-2.0.jar"/>
 	<classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/oswego-concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/>
 	<classpathentry kind="var" path="M2_REPO/apache-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar"/>
-	<classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.8/log4j-1.2.8.jar"/>
+	<classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="/M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/common-logging-spi"/>
 	<classpathentry kind="var" path="M2_REPO/jboss/jboss-test/1.0.0.GA/jboss-test-1.0.0.GA.jar" sourcepath="/M2_REPO/jboss/jboss-test/1.0.0.GA/jboss-test-1.0.0.GA-sources.jar"/>
 	<classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-log4j/2.0.2.GA/jboss-logging-log4j-2.0.2.GA.jar"/>

Modified: common-core/trunk/pom.xml
===================================================================
--- common-core/trunk/pom.xml	2007-04-25 03:28:49 UTC (rev 2390)
+++ common-core/trunk/pom.xml	2007-04-25 05:29:48 UTC (rev 2391)
@@ -7,7 +7,7 @@
 	</parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>jboss-common-core</artifactId>
-  <version>2.0.5-SNAPSHOT</version>
+  <version>2.2.0-SNAPSHOT</version>
   <packaging>jar</packaging>
   <name>JBoss Common Classes</name>
   <url>http://www.jboss.org</url>

Modified: common-core/trunk/src/main/java/org/jboss/net/sockets/QueuedClientSocketFactory.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/net/sockets/QueuedClientSocketFactory.java	2007-04-25 03:28:49 UTC (rev 2390)
+++ common-core/trunk/src/main/java/org/jboss/net/sockets/QueuedClientSocketFactory.java	2007-04-25 05:29:48 UTC (rev 2391)
@@ -24,7 +24,8 @@
 import java.io.IOException;
 import java.rmi.server.RMIClientSocketFactory;
 import java.net.Socket;
-import EDU.oswego.cs.dl.util.concurrent.FIFOSemaphore;
+import java.util.concurrent.Semaphore;
+
 /**
  *
  * @author Scott.Stark at jboss.org
@@ -33,7 +34,7 @@
 public class QueuedClientSocketFactory
    implements RMIClientSocketFactory, java.io.Externalizable
 {
-   private transient FIFOSemaphore permits;
+   private transient Semaphore permits;
    private long numPermits;
    public QueuedClientSocketFactory()
    {
@@ -41,7 +42,7 @@
 
    public QueuedClientSocketFactory(long nPermits)
    {
-      permits = new FIFOSemaphore(nPermits);
+      permits = new Semaphore((int)nPermits, true);
       numPermits = nPermits;
    }
    /**
@@ -88,6 +89,6 @@
       throws IOException, ClassNotFoundException
    {
       numPermits = in.readLong();
-      permits = new FIFOSemaphore(numPermits);
+      permits = new Semaphore((int)numPermits, true);
    }
 }

Modified: common-core/trunk/src/main/java/org/jboss/net/sockets/TimeoutClientSocketFactory.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/net/sockets/TimeoutClientSocketFactory.java	2007-04-25 03:28:49 UTC (rev 2390)
+++ common-core/trunk/src/main/java/org/jboss/net/sockets/TimeoutClientSocketFactory.java	2007-04-25 05:29:48 UTC (rev 2391)
@@ -25,7 +25,6 @@
 import java.io.Serializable;
 import java.rmi.server.RMIClientSocketFactory;
 import java.net.Socket;
-import EDU.oswego.cs.dl.util.concurrent.FIFOSemaphore;
 
 /**
  * A RMIClientSocketFactory that installs a InterruptableInputStream to be

Modified: common-core/trunk/src/main/java/org/jboss/util/collection/CollectionsFactory.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/collection/CollectionsFactory.java	2007-04-25 03:28:49 UTC (rev 2390)
+++ common-core/trunk/src/main/java/org/jboss/util/collection/CollectionsFactory.java	2007-04-25 05:29:48 UTC (rev 2391)
@@ -24,15 +24,14 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CopyOnWriteArraySet;
 
 import org.jboss.util.collection.LazyList;
 import org.jboss.util.collection.LazyMap;
 import org.jboss.util.collection.LazySet;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
-import EDU.oswego.cs.dl.util.concurrent.CopyOnWriteArrayList;
-import EDU.oswego.cs.dl.util.concurrent.CopyOnWriteArraySet;
-
 /**
  * Collections factory.
  * 
@@ -70,7 +69,7 @@
     */
    public static final Map createConcurrentReaderMap()
    {
-      return new ConcurrentReaderHashMap();
+      return new ConcurrentHashMap();
    }
 
    /**

Modified: common-core/trunk/src/main/java/org/jboss/util/file/ArchiveBrowser.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/file/ArchiveBrowser.java	2007-04-25 03:28:49 UTC (rev 2390)
+++ common-core/trunk/src/main/java/org/jboss/util/file/ArchiveBrowser.java	2007-04-25 05:29:48 UTC (rev 2391)
@@ -21,13 +21,6 @@
   */
 package org.jboss.util.file;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.JarURLConnection;
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Iterator;
 import java.util.Map;
@@ -49,7 +42,7 @@
    }
 
    //use concurrent hashmap since a protocol can be added on the fly through the public attribute
-   public static Map factoryFinder = new ConcurrentReaderHashMap();
+   public static Map factoryFinder = new ConcurrentHashMap();
 
    static
    {

Modified: common-core/trunk/src/main/java/org/jboss/util/id/UID.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/id/UID.java	2007-04-25 03:28:49 UTC (rev 2390)
+++ common-core/trunk/src/main/java/org/jboss/util/id/UID.java	2007-04-25 05:29:48 UTC (rev 2391)
@@ -21,7 +21,7 @@
   */
 package org.jboss.util.id;
 
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedLong;
+import java.util.concurrent.atomic.AtomicLong;
 
 /**
  * A unique identifier (uniqueness only guarantied inside of the virtual
@@ -53,7 +53,7 @@
    private static final long serialVersionUID = -8093336932569424512L;
 
    /** A counter for generating identity values */
-   protected static final SynchronizedLong COUNTER = new SynchronizedLong(0);
+   protected static final AtomicLong COUNTER = new AtomicLong(0);
 
    /** The time portion of the UID */
    protected final long time;
@@ -66,7 +66,7 @@
     */
    public UID() {
       time = System.currentTimeMillis();
-      id = COUNTER.increment();
+      id = COUNTER.incrementAndGet();
    }
 
    /**

Modified: common-core/trunk/src/main/java/org/jboss/util/threadpool/BasicThreadPool.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/threadpool/BasicThreadPool.java	2007-04-25 03:28:49 UTC (rev 2390)
+++ common-core/trunk/src/main/java/org/jboss/util/threadpool/BasicThreadPool.java	2007-04-25 05:29:48 UTC (rev 2391)
@@ -23,18 +23,21 @@
 
 import java.util.Collections;
 import java.util.Map;
+import java.util.PriorityQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
 
-import org.jboss.util.collection.WeakValueHashMap;
 import org.jboss.logging.Logger;
+import org.jboss.util.collection.WeakValueHashMap;
 
-import EDU.oswego.cs.dl.util.concurrent.BoundedLinkedQueue;
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean;
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedInt;
-import EDU.oswego.cs.dl.util.concurrent.ThreadFactory;
-import EDU.oswego.cs.dl.util.concurrent.Heap;
 
 /**
  * A basic thread pool.
+ * TODO: this port to jdk concurrent still needs to be tested.
  *
  * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
  * @author Scott.Stark at jboss.org
@@ -51,7 +54,7 @@
    private static final Map threadGroups = Collections.synchronizedMap(new WeakValueHashMap());
 
    /** The internal pool number */
-   private static final SynchronizedInt lastPoolNumber = new SynchronizedInt(0);
+   private static final AtomicInteger lastPoolNumber = new AtomicInteger(0);
 
    private static Logger log = Logger.getLogger(BasicThreadPool.class);
 
@@ -67,21 +70,21 @@
    private BlockingMode blockingMode = BlockingMode.ABORT;
 
    /** The pooled executor */
-   private MinPooledExecutor executor;
+   private ThreadPoolExecutor executor;
 
    /** The queue */
-   private BoundedLinkedQueue queue;
+   private LinkedBlockingQueue queue;
 
    /** The thread group */
    private ThreadGroup threadGroup;
 
    /** The last thread number */
-   private SynchronizedInt lastThreadNumber = new SynchronizedInt(0);
+   private AtomicInteger lastThreadNumber = new AtomicInteger(0);
 
    /** Has the pool been stopped? */
-   private SynchronizedBoolean stopped = new SynchronizedBoolean(false);
+   private AtomicBoolean stopped = new AtomicBoolean(false);
    /** The Heap<TimeoutInfo> of tasks ordered by their completion timeout */
-   private Heap tasksWithTimeouts = new Heap(13);
+   private PriorityQueue<TimeoutInfo> tasksWithTimeouts = new PriorityQueue<TimeoutInfo>(13);
    /** The task completion timeout monitor runnable */
    private TimeoutMonitor timeoutTask;
    /** The trace level logging flag */
@@ -122,15 +125,14 @@
       trace = log.isTraceEnabled();
       ThreadFactory factory = new ThreadPoolThreadFactory();
 
-      queue = new BoundedLinkedQueue(1024);
+      queue = new LinkedBlockingQueue(1024);
 
-      executor = new MinPooledExecutor(queue, 100);
-      executor.setMinimumPoolSize(4);
-      executor.setKeepAliveTime(60 * 1000);
+      
+      executor = new ThreadPoolExecutor(4, 4, 60, TimeUnit.SECONDS, queue);
       executor.setThreadFactory(factory);
-      executor.abortWhenBlocked();
+      executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
 
-      poolNumber = lastPoolNumber.increment();
+      poolNumber = lastPoolNumber.incrementAndGet();
       setName(name);
       this.threadGroup = threadGroup;
    }
@@ -146,16 +148,16 @@
       if (immediate)
          executor.shutdownNow();
       else
-         executor.shutdownAfterProcessingCurrentlyQueuedTasks();
+         executor.shutdown();
    }
 
    public void waitForTasks() throws InterruptedException
    {
-      executor.awaitTerminationAfterShutdown();
+      executor.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
    }
    public void waitForTasks(long maxWaitTime) throws InterruptedException
    {
-      executor.awaitTerminationAfterShutdown(maxWaitTime);
+      executor.awaitTermination(maxWaitTime, TimeUnit.MILLISECONDS);
    }
 
    public void runTaskWrapper(TaskWrapper wrapper)
@@ -177,7 +179,7 @@
          checkTimeoutMonitor();
          // Install the task in the
          info = new TimeoutInfo(wrapper, completionTimeout);
-         tasksWithTimeouts.insert(info);
+         tasksWithTimeouts.add(info);
       }
       int waitType = wrapper.getTaskWaitType();
       switch (waitType)
@@ -261,12 +263,12 @@
 
    public int getMaximumQueueSize()
    {
-      return queue.capacity();
+      return queue.remainingCapacity();
    }
 
    public void setMaximumQueueSize(int size)
    {
-      queue.setCapacity(size);
+      //
    }
 
    public int getPoolSize()
@@ -276,18 +278,17 @@
 
    public int getMinimumPoolSize()
    {
-      return executor.getMinimumPoolSize();
+      return executor.getCorePoolSize();
    }
 
    public void setMinimumPoolSize(int size)
    {
       synchronized (executor)
       {
-         executor.setKeepAliveSize(size);
          // Don't let the min size > max size
          if (executor.getMaximumPoolSize() < size)
          {
-            executor.setMinimumPoolSize(size);
+            executor.setCorePoolSize(size);
             executor.setMaximumPoolSize(size);
          }
       }
@@ -302,22 +303,19 @@
    {
       synchronized (executor)
       {
-         executor.setMinimumPoolSize(size);
+         executor.setCorePoolSize(size);
          executor.setMaximumPoolSize(size);
-         // Don't let the min size > max size
-         if (executor.getKeepAliveSize() > size)
-            executor.setKeepAliveSize(size);
       }
    }
 
    public long getKeepAliveTime()
    {
-      return executor.getKeepAliveTime();
+      return executor.getKeepAliveTime(TimeUnit.MILLISECONDS);
    }
 
    public void setKeepAliveTime(long time)
    {
-      executor.setKeepAliveTime(time);
+      executor.setKeepAliveTime(time, TimeUnit.MILLISECONDS);
    }
 
    public BlockingMode getBlockingMode()
@@ -331,23 +329,23 @@
       
       if( blockingMode == BlockingMode.RUN )
       {
-         executor.runWhenBlocked();
+         executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
       }
       else if( blockingMode == BlockingMode.WAIT )
       {
-         executor.waitWhenBlocked();
+         executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
       }
       else if( blockingMode == BlockingMode.DISCARD )
       {
-         executor.discardWhenBlocked();
+         executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy());
       }
       else if( blockingMode == BlockingMode.DISCARD_OLDEST )
       {
-         executor.discardOldestWhenBlocked();
+         executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardOldestPolicy());
       }
       else if( blockingMode == BlockingMode.ABORT )
       {
-         executor.abortWhenBlocked();
+         executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
       }
       else
       {
@@ -451,7 +449,7 @@
    }
    protected TimeoutInfo getNextTimeout()
    {
-      TimeoutInfo info = (TimeoutInfo) this.tasksWithTimeouts.extract();
+      TimeoutInfo info = (TimeoutInfo) this.tasksWithTimeouts.remove();
       return info;
    }
 
@@ -466,7 +464,7 @@
    {
       public Thread newThread(Runnable runnable)
       {
-         String threadName = BasicThreadPool.this.toString() + "-" + lastThreadNumber.increment();
+         String threadName = BasicThreadPool.this.toString() + "-" + lastThreadNumber.incrementAndGet();
          Thread thread = new Thread(threadGroup, runnable, threadName);
          thread.setDaemon(true);
          return thread;
@@ -593,7 +591,7 @@
                      {
                         // Requeue the TimeoutInfo to see that the task exits run
                         info.setTimeout(1000);
-                        tasksWithTimeouts.insert(info);
+                        tasksWithTimeouts.add(info);
                         if( trace )
                            log.trace("Rescheduled completion check for wrapper="+wrapper);
                      }

Modified: common-core/trunk/src/main/java/org/jboss/util/threadpool/MinPooledExecutor.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/threadpool/MinPooledExecutor.java	2007-04-25 03:28:49 UTC (rev 2390)
+++ common-core/trunk/src/main/java/org/jboss/util/threadpool/MinPooledExecutor.java	2007-04-25 05:29:48 UTC (rev 2391)
@@ -21,8 +21,10 @@
   */
 package org.jboss.util.threadpool;
 
-import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
-import EDU.oswego.cs.dl.util.concurrent.Channel;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
 
 /** A pooled executor where the minimum pool size threads are kept alive. This
 is needed in order for the waitWhenBlocked option to work because of a
@@ -46,7 +48,7 @@
 @author adrian at jboss.org
 @version $Revision$
  */
-public class MinPooledExecutor extends PooledExecutor
+public class MinPooledExecutor extends ThreadPoolExecutor
 {
    // Constants -----------------------------------------------------
 
@@ -67,18 +69,18 @@
     */
    public MinPooledExecutor(int poolSize)
    {
-      super(poolSize);
+      super(poolSize, 2*poolSize, 60, TimeUnit.SECONDS, new LinkedBlockingQueue(1024));
    }
-   
+
    /**
     * Construct a new executor
     * 
     * @param channel the queue for any requests
     * @param poolSize the maximum pool size
     */
-   public MinPooledExecutor(Channel channel, int poolSize)
+   public MinPooledExecutor(BlockingQueue queue, int poolSize)
    {
-      super(channel, poolSize);
+      super(poolSize, 2*poolSize, 60, TimeUnit.SECONDS, queue);
    }
 
    // Public --------------------------------------------------------
@@ -99,36 +101,10 @@
       this.keepAliveSize = keepAliveSize;
    }
 
-   // PooledExecutor overrides --------------------------------------
-   
-   protected Runnable getTask() throws InterruptedException
-   {
-      Runnable task = super.getTask();
-      while (task == null && keepAlive())
-      {
-         task = super.getTask();
-      }
-      return task;
-   }
-
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------
 
-   /**
-    * We keep alive unless we are told to shutdown
-    * or there are more than keepAliveSize threads in the pool
-    *
-    * @return whether to keep alive
-    */
-   protected synchronized boolean keepAlive()
-   {
-      if (shutdown_)
-         return false;
-
-      return poolSize_ <= keepAliveSize;
-   }
-
    // Private -------------------------------------------------------
 
    // Inner classes -------------------------------------------------

Modified: common-core/trunk/src/main/java/org/jboss/util/timeout/HashedTimeoutPriorityQueueImpl.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/timeout/HashedTimeoutPriorityQueueImpl.java	2007-04-25 03:28:49 UTC (rev 2390)
+++ common-core/trunk/src/main/java/org/jboss/util/timeout/HashedTimeoutPriorityQueueImpl.java	2007-04-25 05:29:48 UTC (rev 2391)
@@ -21,10 +21,10 @@
  */
 package org.jboss.util.timeout;
 
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import org.jboss.util.JBossStringBuilder;
 
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean;
-
 /**
  * HashedTimeoutPriorityQueueImpl.
  *
@@ -186,7 +186,7 @@
    /** The hashed queues */
    private InternalPriorityQueue[] queues;
 
-   private SynchronizedBoolean cancelled = new SynchronizedBoolean(false);
+   private AtomicBoolean cancelled = new AtomicBoolean(false);
    
    /**
     * Create a new TimeoutPriorityQueueImpl.

Modified: common-core/trunk/src/main/java/org/jboss/util/timeout/TimeoutFactory.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/timeout/TimeoutFactory.java	2007-04-25 03:28:49 UTC (rev 2390)
+++ common-core/trunk/src/main/java/org/jboss/util/timeout/TimeoutFactory.java	2007-04-25 05:29:48 UTC (rev 2391)
@@ -21,14 +21,14 @@
  */
 package org.jboss.util.timeout;
 
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import org.jboss.util.NestedRuntimeException;
 import org.jboss.util.ThrowableHandler;
 import org.jboss.util.threadpool.BasicThreadPool;
 import org.jboss.util.threadpool.BlockingMode;
 import org.jboss.util.threadpool.ThreadPool;
 
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean;
-
 /**
  * The timeout factory.
  *
@@ -83,7 +83,7 @@
    }
 
    /** Used for graceful exiting */
-   private SynchronizedBoolean cancelled = new SynchronizedBoolean(false);
+   private AtomicBoolean cancelled = new AtomicBoolean(false);
    
    /** The daemon thread that dequeues timeouts tasks and issues
        them for execution to the thread pool */ 
@@ -189,7 +189,7 @@
       // be cancelled since its reference is not accessible
       
       // let the worker thread cleanup
-      if (cancelled.set(true) == false);
+      if (cancelled.getAndSet(true) == false)
       {
          // Cancel the priority queue
          queue.cancel();

Modified: common-core/trunk/src/main/java/org/jboss/util/xml/JBossEntityResolver.java
===================================================================
--- common-core/trunk/src/main/java/org/jboss/util/xml/JBossEntityResolver.java	2007-04-25 03:28:49 UTC (rev 2390)
+++ common-core/trunk/src/main/java/org/jboss/util/xml/JBossEntityResolver.java	2007-04-25 05:29:48 UTC (rev 2391)
@@ -31,14 +31,13 @@
 import java.security.PrivilegedAction;
 import java.util.Collections;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.jboss.logging.Logger;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
-
 /**
  * Local entity resolver to handle standard J2EE DTDs and Schemas as well as JBoss
  * specific DTDs.
@@ -56,7 +55,7 @@
    private static final Logger log = Logger.getLogger(JBossEntityResolver.class);
 
    /** A class wide Map<String, String> of publicId/systemId to dtd/xsd file */
-   private static Map entities = new ConcurrentReaderHashMap();
+   private static Map entities = new ConcurrentHashMap ();
    /** A class flag indicating whether an attempt to resolve a systemID as a
     non-file URL should produce a warning rather than a trace level log msg.
     */
@@ -218,7 +217,7 @@
    public synchronized void registerLocalEntity(String id, String dtdOrSchema)
    {
       if( localEntities == null )
-         localEntities = new ConcurrentReaderHashMap();
+         localEntities = new ConcurrentHashMap();
       localEntities.put(id, dtdOrSchema);
    }
 




More information about the jboss-svn-commits mailing list