geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r442323 - in /geronimo/server/trunk: ./ assemblies/geronimo-boilerplate-minimal/ configs/client/ configs/j2ee-system/ configs/openejb/ configs/openejb/src/plan/ configs/rmi-naming/ modules/geronimo-connector/src/main/java/org/apache/geronim...
Date Mon, 11 Sep 2006 20:20:00 GMT
Author: kevan
Date: Mon Sep 11 13:19:59 2006
New Revision: 442323

URL: http://svn.apache.org/viewvc?view=rev&rev=442323
Log:
GERONIMO-2354 Replace concurrent with backport-concurrent-util package

Modified:
    geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml
    geronimo/server/trunk/configs/client/pom.xml
    geronimo/server/trunk/configs/j2ee-system/pom.xml
    geronimo/server/trunk/configs/openejb/pom.xml
    geronimo/server/trunk/configs/openejb/src/plan/plan.xml
    geronimo/server/trunk/configs/rmi-naming/pom.xml
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/NullWorkExecutorPool.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPool.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java
    geronimo/server/trunk/modules/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java
    geronimo/server/trunk/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/GeronimoExecutor.java
    geronimo/server/trunk/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java
    geronimo/server/trunk/modules/geronimo-security/pom.xml
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginService.java
    geronimo/server/trunk/modules/geronimo-system/pom.xml
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImpl.java
    geronimo/server/trunk/modules/geronimo-timer/pom.xml
    geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java
    geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ThreadPooledTimer.java
    geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledNonTransactionalTimer.java
    geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledTransactionalTimer.java
    geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMStoreThreadPooledNonTransactionalTimer.java
    geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMStoreThreadPooledTransactionalTimer.java
    geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMWorkerPersistence.java
    geronimo/server/trunk/modules/geronimo-timer/src/test/java/org/apache/geronimo/timer/AbstractThreadPooledTimerTest.java
    geronimo/server/trunk/pom.xml

Modified: geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml Mon Sep 11 13:19:59 2006
@@ -124,10 +124,6 @@
                                     <artifactId>backport-util-concurrent</artifactId>
                                 </artifactItem>
                                 <artifactItem>
-                                    <groupId>concurrent</groupId>
-                                    <artifactId>concurrent</artifactId>
-                                </artifactItem>
-                                <artifactItem>
                                     <groupId>cglib</groupId>
                                     <artifactId>cglib-nodep</artifactId>
                                 </artifactItem>

Modified: geronimo/server/trunk/configs/client/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/client/pom.xml?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/configs/client/pom.xml (original)
+++ geronimo/server/trunk/configs/client/pom.xml Mon Sep 11 13:19:59 2006
@@ -196,6 +196,14 @@
              concurrent, jdom -->
 
         <dependency>
+            <groupId>backport-util-concurrent</groupId>
+            <artifactId>backport-util-concurrent</artifactId>
+        </dependency>
+
+        <!--
+        NOTE: Used by dependencies... :-(
+        -->
+        <dependency>
             <groupId>concurrent</groupId>
             <artifactId>concurrent</artifactId>
         </dependency>

Modified: geronimo/server/trunk/configs/j2ee-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/j2ee-system/pom.xml?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/configs/j2ee-system/pom.xml (original)
+++ geronimo/server/trunk/configs/j2ee-system/pom.xml Mon Sep 11 13:19:59 2006
@@ -135,10 +135,6 @@
                             <artifactId>backport-util-concurrent</artifactId>
                         </element>
                         <element>
-                            <groupId>concurrent</groupId>
-                            <artifactId>concurrent</artifactId>
-                        </element>
-                        <element>
                             <groupId>xerces</groupId>
                             <artifactId>xercesImpl</artifactId>
                             <classpathPrefix>../lib/endorsed</classpathPrefix>

Modified: geronimo/server/trunk/configs/openejb/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/openejb/pom.xml?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/configs/openejb/pom.xml (original)
+++ geronimo/server/trunk/configs/openejb/pom.xml Mon Sep 11 13:19:59 2006
@@ -33,21 +33,21 @@
     <packaging>car</packaging>
     
     <dependencies>
-    
+
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>j2ee-server</artifactId>
             <version>${pom.version}</version>
             <type>car</type>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>axis</artifactId>
             <version>${pom.version}</version>
             <type>car</type>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>system-database</artifactId>
@@ -60,6 +60,11 @@
             <artifactId>openejb-core</artifactId>
         </dependency>
         
+        <dependency>
+            <groupId>concurrent</groupId>
+            <artifactId>concurrent</artifactId>
+        </dependency>
+
     </dependencies>
     
 </project>

Modified: geronimo/server/trunk/configs/openejb/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/openejb/src/plan/plan.xml?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/configs/openejb/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/openejb/src/plan/plan.xml Mon Sep 11 13:19:59 2006
@@ -100,7 +100,13 @@
         </reference>
         <attribute name="doAsCurrentCaller">true</attribute>
     </gbean>
-
+    
+    <gbean name="DefaultThreadPoolExecutorAdapter" class="org.openejb.util.BackportExecutorAdapter">
+        <reference name="TargetExecutor">
+            <name>DefaultThreadPool</name>
+        </reference>
+    </gbean>
+    
     <gbean name="EJBNetworkService" class="org.activeio.xnet.StandardServiceStackGBean">
         <attribute name="name">EJB</attribute>
         <attribute name="port">${PlanOpenEJBPort}</attribute>
@@ -109,7 +115,7 @@
         <attribute name="logOnSuccess">HOST,NAME,THREADID,USERID</attribute>
         <attribute name="logOnFailure">HOST,NAME</attribute>
         <reference name="Executor">
-            <name>DefaultThreadPool</name>
+            <name>DefaultThreadPoolExecutorAdapter</name>
         </reference>
         <reference name="Server">
             <name>EJBServer</name>

Modified: geronimo/server/trunk/configs/rmi-naming/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/rmi-naming/pom.xml?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/configs/rmi-naming/pom.xml (original)
+++ geronimo/server/trunk/configs/rmi-naming/pom.xml Mon Sep 11 13:19:59 2006
@@ -184,6 +184,11 @@
             <artifactId>activeio</artifactId>
         </dependency>
         
+        <dependency>
+            <groupId>concurrent</groupId>
+            <artifactId>concurrent</artifactId>
+        </dependency>
+        
     </dependencies>
     
 </project>

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java Mon Sep 11 13:19:59 2006
@@ -20,16 +20,18 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Timer;
+
 import javax.resource.spi.ManagedConnectionFactory;
 import javax.resource.spi.ConnectionRequestInfo;
 import javax.resource.ResourceException;
 import javax.security.auth.Subject;
 
-import EDU.oswego.cs.dl.util.concurrent.FIFOSemaphore;
-import EDU.oswego.cs.dl.util.concurrent.ReadWriteLock;
-import EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import edu.emory.mathcs.backport.java.util.concurrent.locks.ReadWriteLock;
+import edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantReadWriteLock;
+import edu.emory.mathcs.backport.java.util.concurrent.Semaphore;
+import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
 
 /**
  * @version $Rev$ $Date$
@@ -37,8 +39,8 @@
 public abstract class AbstractSinglePoolConnectionInterceptor implements ConnectionInterceptor, PoolingAttributes {
     protected static Log log = LogFactory.getLog(SinglePoolConnectionInterceptor.class.getName());
     protected final ConnectionInterceptor next;
-    private final ReadWriteLock resizeLock = new WriterPreferenceReadWriteLock();
-    protected FIFOSemaphore permits;
+    private final ReadWriteLock resizeLock = new ReentrantReadWriteLock();
+    protected Semaphore permits;
     protected int blockingTimeoutMilliseconds;
     protected int connectionCount = 0;
     private long idleTimeoutMilliseconds;
@@ -59,7 +61,7 @@
         this.minSize = minSize;
         this.blockingTimeoutMilliseconds = blockingTimeoutMilliseconds;
         setIdleTimeoutMinutes(idleTimeoutMinutes);
-        permits = new FIFOSemaphore(maxSize);
+        permits = new Semaphore(maxSize, true);
     }
 
     public void getConnection(ConnectionInfo connectionInfo) throws ResourceException {
@@ -67,9 +69,9 @@
             return;
         }
         try {
-            resizeLock.readLock().acquire();
+            resizeLock.readLock().lock();
             try {
-                if (permits.attempt(blockingTimeoutMilliseconds)) {
+                if (permits.tryAcquire(blockingTimeoutMilliseconds, TimeUnit.MILLISECONDS)) {
                     internalGetConnection(connectionInfo);
                 } else {
                     throw new ResourceException("No ManagedConnections available "
@@ -79,7 +81,7 @@
 
                 }
             } finally {
-                resizeLock.readLock().release();
+                resizeLock.readLock().unlock();
             }
 
         } catch (InterruptedException ie) {
@@ -100,16 +102,12 @@
             try {
                 connectionInfo.getManagedConnectionInfo().getManagedConnection().destroy();
             } catch (ResourceException re) {
+                // empty
             }
             return;
         }
 
-        try {
-            resizeLock.readLock().acquire();
-        } catch (InterruptedException e) {
-            //TODO figure out something better to do here!!!
-            throw new RuntimeException("Interrupted before returning connection! Pool is now in an invalid state!");
-        }
+        resizeLock.readLock().lock();
         try {
             ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo();
             if (connectionReturnAction == ConnectionReturnAction.RETURN_HANDLE && mci.hasConnectionHandles()) {
@@ -122,7 +120,7 @@
                 permits.release();
             }
         } finally {
-            resizeLock.readLock().release();
+            resizeLock.readLock().unlock();
         }
     }
 
@@ -150,12 +148,12 @@
             throw new IllegalArgumentException("Max size must be positive, not " + newMaxSize);
         }
         if (newMaxSize != getPartitionMaxSize()) {
-            resizeLock.writeLock().acquire();
+            resizeLock.writeLock().lock();
             try {
-                ResizeInfo resizeInfo = new ResizeInfo(this.minSize, (int)permits.permits(), connectionCount, newMaxSize);
+                ResizeInfo resizeInfo = new ResizeInfo(this.minSize, permits.availablePermits(), connectionCount, newMaxSize);
                 this.shrinkLater = resizeInfo.getShrinkLater();
 
-                permits = new FIFOSemaphore(newMaxSize);
+                permits = new Semaphore(newMaxSize, true);
                 //pre-acquire permits for the existing checked out connections that will not be closed when they are returned.
                 for (int i = 0; i < resizeInfo.getTransferCheckedOut(); i++) {
                     permits.acquire();
@@ -164,7 +162,7 @@
                 transferConnections(newMaxSize, resizeInfo.getShrinkNow());
                 this.minSize = resizeInfo.getNewMinSize();
             } finally {
-                resizeLock.writeLock().release();
+                resizeLock.writeLock().unlock();
             }
         }
     }
@@ -288,11 +286,8 @@
             AbstractSinglePoolConnectionInterceptor interceptor = parent;
             if (interceptor == null)
                 return;
-            try {
-                interceptor.resizeLock.readLock().acquire();
-            } catch (InterruptedException e) {
-                return;
-            }
+
+            interceptor.resizeLock.readLock().lock();
             try {
                 long threshold = System.currentTimeMillis() - interceptor.idleTimeoutMilliseconds;
                 ArrayList killList = new ArrayList(interceptor.getPartitionMaxSize());
@@ -304,7 +299,7 @@
                 }
                 interceptor.permits.release(killList.size());
             } finally {
-                interceptor.resizeLock.readLock().release();
+                interceptor.resizeLock.readLock().unlock();
             }
         }
 
@@ -324,11 +319,7 @@
         }
 
         public void run() {
-            try {
-                resizeLock.readLock().acquire();
-            } catch (InterruptedException e) {
-                return;
-            }
+            resizeLock.readLock().lock();
             try {
                 while (connectionCount < minSize) {
                     ManagedConnectionInfo mci = new ManagedConnectionInfo(managedConnectionFactory, cri);
@@ -339,15 +330,14 @@
                     } catch (ResourceException e) {
                         return;
                     }
-                    boolean added = false;
-                    added = addToPool(mci);
+                    boolean added = addToPool(mci);
                     if (!added) {
                         internalReturn(ci, ConnectionReturnAction.DESTROY);
                         return;
                     }
                 }
             } finally {
-                resizeLock.readLock().release();
+                resizeLock.readLock().unlock();
             }
         }
 

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java Mon Sep 11 13:19:59 2006
@@ -17,8 +17,6 @@
 
 package org.apache.geronimo.connector.outbound;
 
-//import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
-
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Iterator;

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java Mon Sep 11 13:19:59 2006
@@ -24,7 +24,8 @@
 import javax.resource.spi.work.WorkListener;
 import javax.resource.spi.work.WorkManager;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+
 import org.apache.geronimo.connector.work.pool.ScheduleWorkExecutor;
 import org.apache.geronimo.connector.work.pool.StartWorkExecutor;
 import org.apache.geronimo.connector.work.pool.SyncWorkExecutor;

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java Mon Sep 11 13:19:59 2006
@@ -22,7 +22,8 @@
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.transaction.manager.XAWork;
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
 
 /**
  * 

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/WorkerContext.java Mon Sep 11 13:19:59 2006
@@ -30,11 +30,12 @@
 import javax.transaction.InvalidTransactionException;
 import javax.transaction.SystemException;
 
-import EDU.oswego.cs.dl.util.concurrent.Latch;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+
 import org.apache.geronimo.transaction.manager.ImportedTransactionActiveException;
 import org.apache.geronimo.transaction.manager.XAWork;
+import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
 
 /**
  * Work wrapper providing an execution context to a Work instance.
@@ -111,12 +112,12 @@
     /**
      * A latch, which is released when the work is started.
      */
-    private Latch startLatch = new Latch();
+    private CountDownLatch startLatch = new CountDownLatch(1);
 
     /**
      * A latch, which is released when the work is completed.
      */
-    private Latch endLatch = new Latch();
+    private CountDownLatch endLatch = new CountDownLatch(1);
 
     /**
      * Create a WorkWrapper.
@@ -142,10 +143,10 @@
      *                      Work processing events (work accepted, work rejected, work started,
      */
     public WorkerContext(Work aWork,
-            long aStartTimeout,
-            ExecutionContext execContext,
-            XAWork xaWork,
-            WorkListener workListener) {
+                         long aStartTimeout,
+                         ExecutionContext execContext,
+                         XAWork xaWork,
+                         WorkListener workListener) {
         adaptee = aWork;
         startTimeOut = aStartTimeout;
         executionContext = execContext;
@@ -273,15 +274,15 @@
         if (isTimedOut()) {
             // In case of a time out, one releases the start and end latches
             // to prevent a dead-lock.
-            startLatch.release();
-            endLatch.release();
+            startLatch.countDown();
+            endLatch.countDown();
             return;
         }
         // Implementation note: the work listener is notified prior to release
         // the start lock. This behavior is intentional and seems to be the
         // more conservative.
         workListener.workStarted(new WorkEvent(this, WorkEvent.WORK_STARTED, adaptee, null));
-        startLatch.release();
+        startLatch.countDown();
         //Implementation note: we assume this is being called without an interesting TransactionContext,
         //and ignore/replace whatever is associated with the current thread.
         try {
@@ -314,7 +315,7 @@
             workListener.workCompleted(new WorkEvent(this, WorkEvent.WORK_REJECTED, adaptee,
                     workException));
         } finally {
-            endLatch.release();
+            endLatch.countDown();
         }
     }
 
@@ -325,7 +326,7 @@
      * @return Latch that a caller can acquire to wait for the start of a
      *         work execution.
      */
-    public synchronized Latch provideStartLatch() {
+    public synchronized CountDownLatch provideStartLatch() {
         return startLatch;
     }
 
@@ -336,7 +337,7 @@
      * @return Latch that a caller can acquire to wait for the end of a
      *         work execution.
      */
-    public synchronized Latch provideEndLatch() {
+    public synchronized CountDownLatch provideEndLatch() {
         return endLatch;
     }
 

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/NullWorkExecutorPool.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/NullWorkExecutorPool.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/NullWorkExecutorPool.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/NullWorkExecutorPool.java Mon Sep 11 13:19:59 2006
@@ -51,7 +51,7 @@
         return this;
     }
 
-    public void execute(Runnable command) throws InterruptedException {
+    public void execute(Runnable command) {
         throw new IllegalStateException("Stopped");
     }
 }

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java Mon Sep 11 13:19:59 2006
@@ -19,8 +19,9 @@
 
 import javax.resource.spi.work.WorkException;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
 import org.apache.geronimo.connector.work.WorkerContext;
+
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
 
 /**
  *

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java Mon Sep 11 13:19:59 2006
@@ -18,10 +18,11 @@
 package org.apache.geronimo.connector.work.pool;
 
 import javax.resource.spi.work.WorkException;
-import EDU.oswego.cs.dl.util.concurrent.Latch;
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+
 import org.apache.geronimo.connector.work.WorkerContext;
-import org.apache.geronimo.pool.GeronimoExecutor;
+
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
 
 /**
  *
@@ -33,8 +34,8 @@
 
     public void doExecute(WorkerContext work, Executor executor)
             throws WorkException, InterruptedException {
-        Latch latch = work.provideStartLatch();
+        CountDownLatch latch = work.provideStartLatch();
         executor.execute(new NamedRunnable("A J2EE Connector", work));
-        latch.acquire();
+        latch.await();
     }
 }

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java Mon Sep 11 13:19:59 2006
@@ -18,10 +18,11 @@
 package org.apache.geronimo.connector.work.pool;
 
 import javax.resource.spi.work.WorkException;
-import EDU.oswego.cs.dl.util.concurrent.Latch;
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+
 import org.apache.geronimo.connector.work.WorkerContext;
-import org.apache.geronimo.pool.GeronimoExecutor;
+
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
 
 /**
  *
@@ -33,9 +34,9 @@
 
     public void doExecute(WorkerContext work, Executor executor)
             throws WorkException, InterruptedException {
-        Latch latch = work.provideEndLatch();
+        CountDownLatch latch = work.provideEndLatch();
         executor.execute(new NamedRunnable("A J2EE Connector", work));
-        latch.acquire();
+        latch.await();
     }
 
 }

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java Mon Sep 11 13:19:59 2006
@@ -2,7 +2,8 @@
 
 import javax.resource.spi.work.WorkException;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+
 import org.apache.geronimo.connector.work.WorkerContext;
 
 /**

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPool.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPool.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPool.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPool.java Mon Sep 11 13:19:59 2006
@@ -17,10 +17,7 @@
 
 package org.apache.geronimo.connector.work.pool;
 
-import javax.resource.spi.work.WorkException;
-
-import org.apache.geronimo.connector.work.WorkerContext;
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
 
 /**
  * Defines the operations that a pool in charge of the execution of Work

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java Mon Sep 11 13:19:59 2006
@@ -17,13 +17,9 @@
 
 package org.apache.geronimo.connector.work.pool;
 
-import javax.resource.spi.work.WorkCompletedException;
-import javax.resource.spi.work.WorkException;
-
-import EDU.oswego.cs.dl.util.concurrent.Channel;
-import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
-import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
-import org.apache.geronimo.connector.work.WorkerContext;
+import edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor;
+import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
+import edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue;
 
 /**
  * Based class for WorkExecutorPool. Sub-classes define the synchronization
@@ -37,7 +33,7 @@
     /**
      * A timed out pooled executor.
      */
-    private PooledExecutor pooledExecutor;
+    private ThreadPoolExecutor pooledExecutor;
 
     /**
      * Creates a pool with the specified minimum and maximum sizes. The Channel
@@ -47,35 +43,20 @@
      * @param maxSize Maximum size of the work executor pool.
      */
     public WorkExecutorPoolImpl(int maxSize) {
-        pooledExecutor = new PooledExecutor(new LinkedQueue(), maxSize);
-        pooledExecutor.setMinimumPoolSize(maxSize);
-        pooledExecutor.waitWhenBlocked();
-    }
+        pooledExecutor = new ThreadPoolExecutor(1, maxSize, 1, TimeUnit.MINUTES, new LinkedBlockingQueue());
+        /*
 
-    /**
-     * Creates a pool with the specified minimum and maximum sizes and using the
-     * specified Channel to enqueue the submitted Work instances.
-     *
-     * @param channel Queue to be used as the queueing facility of this pool.
-     * @param maxSize Maximum size of the work executor pool.
-     */
-    public WorkExecutorPoolImpl(
-            Channel channel,
-            int maxSize) {
-        pooledExecutor = new PooledExecutor(channel, maxSize);
-        pooledExecutor.setMinimumPoolSize(maxSize);
+        FIXME: How to do this with concurrent.util ?
         pooledExecutor.waitWhenBlocked();
+        */
     }
-
+    
     /**
      * Execute the specified Work.
      *
      * @param work Work to be executed.
-     *
-     * @exception InterruptedException Indicates that the Work execution has been
-     * unsuccessful.
      */
-    public void execute(Runnable work) throws InterruptedException {
+    public void execute(Runnable work) {
         pooledExecutor.execute(work);
     }
 
@@ -111,7 +92,7 @@
      */
     public WorkExecutorPool stop() {
         int maxSize = getMaximumPoolSize();
-        pooledExecutor.shutdownAfterProcessingCurrentlyQueuedTasks();
+        pooledExecutor.shutdown();
         return new NullWorkExecutorPool(maxSize);
     }
 

Modified: geronimo/server/trunk/modules/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/test/java/org/apache/geronimo/connector/work/PooledWorkManagerTest.java Mon Sep 11 13:19:59 2006
@@ -42,9 +42,11 @@
 
     protected void setUp() throws Exception {
         super.setUp();
+        
         XAWork xaWork = new GeronimoTransactionManager();
         ThreadPool pool = new ThreadPool(1, "Connector Test", 30000, ThreadPool.class.getClassLoader(), "foo:test=bar");
         pool.setWaitWhenBlocked(true);
+        
         workManager = new GeronimoWorkManager(pool, pool, pool, xaWork);
         workManager.doStart();
     }

Modified: geronimo/server/trunk/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/GeronimoExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/GeronimoExecutor.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/GeronimoExecutor.java (original)
+++ geronimo/server/trunk/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/GeronimoExecutor.java Mon Sep 11 13:19:59 2006
@@ -16,7 +16,7 @@
  */
 package org.apache.geronimo.pool;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
 
 /**
  * A Geronimo-specific extension that contributes a little extra manageability

Modified: geronimo/server/trunk/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java (original)
+++ geronimo/server/trunk/modules/geronimo-core/src/main/java/org/apache/geronimo/pool/ThreadPool.java Mon Sep 11 13:19:59 2006
@@ -21,16 +21,24 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.management.j2ee.statistics.BoundedRangeStatistic;
 import javax.management.j2ee.statistics.CountStatistic;
 import javax.management.j2ee.statistics.Stats;
-import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
-import EDU.oswego.cs.dl.util.concurrent.ThreadFactory;
+
+import edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor;
+import edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionHandler;
+import edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionException;
+import edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory;
+import edu.emory.mathcs.backport.java.util.concurrent.SynchronousQueue;
+import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
+
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+
 import org.apache.geronimo.management.J2EEManagedObject;
 import org.apache.geronimo.management.StatisticsProvider;
 import org.apache.geronimo.management.geronimo.stats.ThreadPoolStats;
@@ -42,23 +50,26 @@
  * @version $Rev$ $Date$
  */
 public class ThreadPool implements GeronimoExecutor, GBeanLifecycle, J2EEManagedObject, StatisticsProvider {
-    private PooledExecutor executor;
+    private ThreadPoolExecutor executor;
     private ClassLoader classLoader;
     private ObjectName objectName;
     private boolean waitWhenBlocked;
-
+    
     // Statistics-related fields follow
     private boolean statsActive = true;
     private PoolStatsImpl stats = new PoolStatsImpl();
     private Map clients = new HashMap();
 
-
     public ThreadPool(int poolSize, String poolName, long keepAliveTime, ClassLoader classLoader, String objectName) {
-        PooledExecutor p = new PooledExecutor(poolSize);
-        p.abortWhenBlocked();
-        p.setKeepAliveTime(keepAliveTime);
-        p.setMinimumPoolSize(poolSize);
+        ThreadPoolExecutor p = new ThreadPoolExecutor(
+            poolSize, // core size
+            poolSize, // max size
+            keepAliveTime, TimeUnit.MILLISECONDS,
+            new SynchronousQueue());
+
+        p.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
         p.setThreadFactory(new ThreadPoolThreadFactory(poolName, classLoader));
+        
         try {
             this.objectName = ObjectName.getInstance(objectName);
         } catch (MalformedObjectNameException e) {
@@ -158,11 +169,11 @@
         return executor.getMaximumPoolSize();
     }
 
-    public void execute(Runnable command) throws InterruptedException {
+    public void execute(Runnable command) {
         execute("Unknown", command);
     }
 
-    public void execute(final String consumerName, final Runnable runnable) throws InterruptedException {
+    public void execute(final String consumerName, final Runnable runnable) {
         Runnable command;
         if (statsActive) {
             command = new Runnable() {
@@ -179,7 +190,7 @@
             command = runnable;
         }
 
-        PooledExecutor p;
+        ThreadPoolExecutor p;
         synchronized (this) {
             p = executor;
         }
@@ -207,13 +218,26 @@
             clients.put(consumerName, new Integer(test.intValue() - 1));
         }
     }
-
+    
+    private static class WaitWhenBlockedPolicy
+        implements RejectedExecutionHandler
+    {
+        public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) throws RejectedExecutionException {
+            try {
+                executor.getQueue().put(r);
+            }
+            catch (InterruptedException e) {
+                throw new RejectedExecutionException(e);
+            }
+        }
+    }
+    
     public void setWaitWhenBlocked(boolean wait) {
         waitWhenBlocked = wait;
         if(wait) {
-            executor.waitWhenBlocked();
+            executor.setRejectedExecutionHandler(new WaitWhenBlockedPolicy());
         } else {
-            executor.abortWhenBlocked();
+            executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
         }
     }
 
@@ -225,7 +249,7 @@
     }
 
     public void doStop() throws Exception {
-        PooledExecutor p;
+        ThreadPoolExecutor p;
         synchronized (this) {
             p = executor;
             executor = null;

Modified: geronimo/server/trunk/modules/geronimo-security/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security/pom.xml?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-security/pom.xml Mon Sep 11 13:19:59 2006
@@ -73,6 +73,15 @@
             <artifactId>activeio</artifactId>
         </dependency>
         
+        <!--
+        Required by activeio:activeio
+        -->
+        <dependency>
+            <groupId>concurrent</groupId>
+            <artifactId>concurrent</artifactId>
+            <scope>test</scope>
+        </dependency>
+        
         <dependency>
             <groupId>regexp</groupId>
             <artifactId>regexp</artifactId>

Modified: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginService.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginService.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginService.java (original)
+++ geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginService.java Mon Sep 11 13:19:59 2006
@@ -14,10 +14,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
+
 package org.apache.geronimo.security.jaas.server;
 
-import EDU.oswego.cs.dl.util.concurrent.ClockDaemon;
-import EDU.oswego.cs.dl.util.concurrent.ThreadFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.GeronimoSecurityException;
@@ -34,6 +33,7 @@
 import javax.crypto.Mac;
 import javax.crypto.SecretKey;
 import javax.crypto.spec.SecretKeySpec;
+
 import javax.security.auth.Subject;
 import javax.security.auth.callback.Callback;
 import javax.security.auth.login.LoginException;
@@ -41,6 +41,7 @@
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
 import java.security.Principal;
+
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Hashtable;
@@ -49,7 +50,8 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
+import java.util.Timer;
+import java.util.TimerTask;
 
 /**
  * The single point of contact for Geronimo JAAS realms.  Instead of attempting
@@ -63,10 +65,9 @@
     public static final Log log = LogFactory.getLog(JaasLoginService.class);
     private final static int DEFAULT_EXPIRED_LOGIN_SCAN_INTERVAL = 300000; // 5 mins
     private final static int DEFAULT_MAX_LOGIN_DURATION = 1000 * 3600 * 24; // 1 day
-    private final static ClockDaemon clockDaemon;
+    private final static Timer clockDaemon = new Timer(/* Name requires JDK 1.5 "LoginService login modules monitor", */ true);
     private static long nextLoginModuleId = System.currentTimeMillis();
     private Collection realms;
-    private Object expiredLoginScanIdentifier;
     private final String objectName;
     private final SecretKey key;
     private final String algorithm;
@@ -74,7 +75,7 @@
     private final Map activeLogins = new Hashtable();
     private int expiredLoginScanIntervalMillis = DEFAULT_EXPIRED_LOGIN_SCAN_INTERVAL;
     private int maxLoginDurationMillis = DEFAULT_MAX_LOGIN_DURATION;
-
+    private ExpirationMonitor expirationMonitor;
 
     public JaasLoginService(String algorithm, String password, ClassLoader classLoader, String objectName) {
         this.classLoader = classLoader;
@@ -137,11 +138,18 @@
     }
 
     public void doStart() throws Exception {
-        expiredLoginScanIdentifier = clockDaemon.executePeriodically(expiredLoginScanIntervalMillis, new ExpirationMonitor(), true);
+        expirationMonitor = new ExpirationMonitor();
+
+        clockDaemon.scheduleAtFixedRate(
+                expirationMonitor, expiredLoginScanIntervalMillis, expiredLoginScanIntervalMillis);
     }
 
     public void doStop() throws Exception {
-        ClockDaemon.cancel(expiredLoginScanIdentifier);
+        if (expirationMonitor != null) {
+            expirationMonitor.cancel();
+            expirationMonitor = null;
+        }
+
         //todo: shut down all logins
     }
 
@@ -389,20 +397,7 @@
         return null;
     }
 
-
-    // This stuff takes care of whacking old logins
-    static {
-        clockDaemon = new ClockDaemon();
-        clockDaemon.setThreadFactory(new ThreadFactory() {
-            public Thread newThread(Runnable r) {
-                Thread t = new Thread(r, "LoginService login modules monitor");
-                t.setDaemon(true);
-                return t;
-            }
-        });
-    }
-
-    private class ExpirationMonitor implements Runnable { //todo: different timeouts per realm?
+    private class ExpirationMonitor extends TimerTask { //todo: different timeouts per realm?
 
         public void run() {
             long now = System.currentTimeMillis();

Modified: geronimo/server/trunk/modules/geronimo-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/pom.xml?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-system/pom.xml Mon Sep 11 13:19:59 2006
@@ -52,8 +52,8 @@
         </dependency>
         
         <dependency>
-            <groupId>concurrent</groupId>
-            <artifactId>concurrent</artifactId>
+            <groupId>backport-util-concurrent</groupId>
+            <artifactId>backport-util-concurrent</artifactId>
         </dependency>
         
         <!--

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImpl.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImpl.java (original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImpl.java Mon Sep 11 13:19:59 2006
@@ -26,7 +26,8 @@
 
 import java.rmi.server.RMIClassLoader;
 import java.rmi.server.RMIClassLoaderSpi;
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
+
+import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
 
 /**
  * An implementation of {@link RMIClassLoaderSpi} which provides normilzation
@@ -40,7 +41,7 @@
     private RMIClassLoaderSpi delegate = RMIClassLoader.getDefaultProviderInstance();
 
     //TODO: Not sure of the best initial size.  Starting with 100 which should be reasonable.
-    private ConcurrentReaderHashMap cachedCodebases = new ConcurrentReaderHashMap(100, 0.75F);
+    private ConcurrentHashMap cachedCodebases = new ConcurrentHashMap(100, 0.75F);
 
 
     public Class loadClass(String codebase, String name, ClassLoader defaultLoader)

Modified: geronimo/server/trunk/modules/geronimo-timer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-timer/pom.xml?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-timer/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-timer/pom.xml Mon Sep 11 13:19:59 2006
@@ -38,7 +38,10 @@
                
                https://issues.apache.org/jira/browse/GERONIMO-2183
         -->
+        <!-- 
+        TEMP: Testing concurrent changes...
         <maven.test.skip>true</maven.test.skip>
+        -->
     </properties>
     
     <dependencies>
@@ -87,10 +90,10 @@
             <groupId>org.apache.derby</groupId>
             <artifactId>derby</artifactId>
         </dependency>
-
+        
         <dependency>
-            <groupId>concurrent</groupId>
-            <artifactId>concurrent</artifactId>
+            <groupId>backport-util-concurrent</groupId>
+            <artifactId>backport-util-concurrent</artifactId>
         </dependency>
         
     </dependencies>

Modified: geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java (original)
+++ geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java Mon Sep 11 13:19:59 2006
@@ -47,11 +47,7 @@
     }
 
     public void run() {
-        try {
-            threadPooledTimer.getExecutor().execute(workInfo.getExecutorTask());
-        } catch (InterruptedException e) {
-            log.warn("Exception running task", e);
-        }
+        threadPooledTimer.getExecutor().execute(workInfo.getExecutorTask());
     }
 
     public boolean cancel() {

Modified: geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ThreadPooledTimer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ThreadPooledTimer.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ThreadPooledTimer.java (original)
+++ geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ThreadPooledTimer.java Mon Sep 11 13:19:59 2006
@@ -33,7 +33,8 @@
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanLifecycle;

Modified: geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledNonTransactionalTimer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledNonTransactionalTimer.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledNonTransactionalTimer.java (original)
+++ geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledNonTransactionalTimer.java Mon Sep 11 13:19:59 2006
@@ -21,7 +21,8 @@
 import javax.sql.DataSource;
 import javax.transaction.TransactionManager;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+
 import org.apache.geronimo.connector.outbound.ConnectionFactorySource;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;

Modified: geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledTransactionalTimer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledTransactionalTimer.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledTransactionalTimer.java (original)
+++ geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledTransactionalTimer.java Mon Sep 11 13:19:59 2006
@@ -21,7 +21,8 @@
 import javax.sql.DataSource;
 import javax.transaction.TransactionManager;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+
 import org.apache.geronimo.connector.outbound.ConnectionFactorySource;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;

Modified: geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMStoreThreadPooledNonTransactionalTimer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMStoreThreadPooledNonTransactionalTimer.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMStoreThreadPooledNonTransactionalTimer.java (original)
+++ geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMStoreThreadPooledNonTransactionalTimer.java Mon Sep 11 13:19:59 2006
@@ -19,7 +19,8 @@
 
 import javax.transaction.TransactionManager;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;

Modified: geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMStoreThreadPooledTransactionalTimer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMStoreThreadPooledTransactionalTimer.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMStoreThreadPooledTransactionalTimer.java (original)
+++ geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMStoreThreadPooledTransactionalTimer.java Mon Sep 11 13:19:59 2006
@@ -19,7 +19,8 @@
 
 import javax.transaction.TransactionManager;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;

Modified: geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMWorkerPersistence.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMWorkerPersistence.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMWorkerPersistence.java (original)
+++ geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/vm/VMWorkerPersistence.java Mon Sep 11 13:19:59 2006
@@ -24,7 +24,8 @@
 import java.util.Collection;
 import java.util.ArrayList;
 
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedLong;
+import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicLong;
+
 import org.apache.geronimo.timer.PersistenceException;
 import org.apache.geronimo.timer.Playback;
 import org.apache.geronimo.timer.WorkInfo;
@@ -40,10 +41,10 @@
 
     private final Map tasks = Collections.synchronizedMap(new LinkedHashMap());
 
-    private final SynchronizedLong counter = new SynchronizedLong(0);
+    private final AtomicLong counter = new AtomicLong(0);
 
     public void save(WorkInfo workInfo) throws PersistenceException {
-        long id = counter.increment();
+        long id = counter.incrementAndGet();
         workInfo.setId(id);
         tasks.put(new Long(id), workInfo);
     }

Modified: geronimo/server/trunk/modules/geronimo-timer/src/test/java/org/apache/geronimo/timer/AbstractThreadPooledTimerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-timer/src/test/java/org/apache/geronimo/timer/AbstractThreadPooledTimerTest.java?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/modules/geronimo-timer/src/test/java/org/apache/geronimo/timer/AbstractThreadPooledTimerTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-timer/src/test/java/org/apache/geronimo/timer/AbstractThreadPooledTimerTest.java Mon Sep 11 13:19:59 2006
@@ -19,8 +19,10 @@
 
 import javax.transaction.TransactionManager;
 
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedInt;
+import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger;
+
 import junit.framework.TestCase;
+
 import org.apache.geronimo.pool.ThreadPool;
 import org.apache.geronimo.timer.vm.VMWorkerPersistence;
 
@@ -41,7 +43,7 @@
     private ThreadPool threadPool;
     private ThreadPooledTimer timer;
 
-    private SynchronizedInt counter = new SynchronizedInt(0);
+    private AtomicInteger counter = new AtomicInteger(0);
     protected TransactionManager transactionManager;
     protected ExecutorTaskFactory executableWorkFactory;
     protected UserTaskFactory userTaskFactory;
@@ -177,7 +179,7 @@
         public Runnable newTask(long id) {
             return new Runnable() {
                 public void run() {
-                    counter.increment();
+                    counter.incrementAndGet();
                 }
 
             };

Modified: geronimo/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/pom.xml?view=diff&rev=442323&r1=442322&r2=442323
==============================================================================
--- geronimo/server/trunk/pom.xml (original)
+++ geronimo/server/trunk/pom.xml Mon Sep 11 13:19:59 2006
@@ -202,7 +202,13 @@
             <dependency>
                 <groupId>backport-util-concurrent</groupId>
                 <artifactId>backport-util-concurrent</artifactId>
-                <version>2.0_01_pd</version>
+                <version>2.2</version>
+            </dependency>
+
+            <dependency>
+                <groupId>concurrent</groupId>
+                <artifactId>concurrent</artifactId>
+                <version>1.3.4</version>
             </dependency>
 
             <dependency>
@@ -228,13 +234,7 @@
                 <artifactId>commons-logging</artifactId>
                 <version>1.0.4</version>
             </dependency>
-
-            <dependency>
-                <groupId>concurrent</groupId>
-                <artifactId>concurrent</artifactId>
-                <version>1.3.4</version>
-            </dependency>
-
+            
             <dependency>
                 <groupId>org.objectweb.howl</groupId>
                 <artifactId>howl</artifactId>



Mime
View raw message