[jboss-cvs] JBossAS SVN: r85698 - trunk/connector/src/main/org/jboss/resource/connectionmanager.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 10 15:27:41 EDT 2009


Author: jesper.pedersen
Date: 2009-03-10 15:27:41 -0400 (Tue, 10 Mar 2009)
New Revision: 85698

Added:
   trunk/connector/src/main/org/jboss/resource/connectionmanager/RetryableResourceException.java
Modified:
   trunk/connector/src/main/org/jboss/resource/connectionmanager/ConnectionValidator.java
   trunk/connector/src/main/org/jboss/resource/connectionmanager/IdleRemover.java
   trunk/connector/src/main/org/jboss/resource/connectionmanager/InternalManagedConnectionPool.java
   trunk/connector/src/main/org/jboss/resource/connectionmanager/JBossManagedConnectionPool.java
   trunk/connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionPool.java
Log:
[JBAS-5929] Sub Pooling in JBossManagedConnectionPool MemoryLeak for sparse CRI coverage

Modified: trunk/connector/src/main/org/jboss/resource/connectionmanager/ConnectionValidator.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/ConnectionValidator.java	2009-03-10 18:39:00 UTC (rev 85697)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/ConnectionValidator.java	2009-03-10 19:27:41 UTC (rev 85698)
@@ -23,28 +23,25 @@
 
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.jboss.logging.Logger;
 
-
 /**
  * A ConnectionValidator that performs background validation of managed connections for an
  * InternalManagedConnectionPool.
  * 
  * @author <a href="weston.price at jboss.com">Weston Price</a>
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision$
  */
 public class ConnectionValidator
 {
-   
    /** The log */
    private static final Logger log = Logger.getLogger(ConnectionValidator.class);
    
    /** The pools */
-   private Collection pools = new ArrayList();
+   private final CopyOnWriteArrayList<InternalManagedConnectionPool> pools = new CopyOnWriteArrayList<InternalManagedConnectionPool>();
    
    /** The interval */
    private long interval = Long.MAX_VALUE;
@@ -54,10 +51,9 @@
 
    /** The validator */
    private static final ConnectionValidator validator = new ConnectionValidator();
-   
-   
-   private ConnectionValidator(){
-      
+
+   private ConnectionValidator()
+   {
       AccessController.doPrivileged(new PrivilegedAction()
       {
          public Object run()
@@ -69,28 +65,23 @@
             return null;
          }
       });
-      
    }
    
    public static void registerPool(InternalManagedConnectionPool mcp, long interval)
    {
       validator.internalRegisterPool(mcp, interval);
-      
-      
    }
    
    public static void unRegisterPool(InternalManagedConnectionPool mcp)
    {
       validator.internalUnregisterPool(mcp);
-      
    }
    
-   
-   private void internalRegisterPool(InternalManagedConnectionPool mcp, long interval){
-      
+   private void internalRegisterPool(InternalManagedConnectionPool mcp, long interval)
+   {
       synchronized (pools)
       {
-         pools.add(mcp);
+         pools.addIfAbsent(mcp);
          
          if (interval > 1 && interval/2 < this.interval) 
          {
@@ -99,33 +90,32 @@
             if (next > maybeNext && maybeNext > 0) 
             {
                next = maybeNext;
-               log.debug("internalRegisterPool: about to notify thread: old next: " + next + ", new next: " + maybeNext);
+               if (log.isDebugEnabled())
+                  log.debug("internalRegisterPool: about to notify thread: old next: " + next + ", new next: " + maybeNext);
                pools.notify();
             }
          }
       }
-      
    }
    
-   private void internalUnregisterPool(InternalManagedConnectionPool mcp){
-      
+   private void internalUnregisterPool(InternalManagedConnectionPool mcp)
+   {
       synchronized (pools)
       {
          pools.remove(mcp);
          if (pools.size() == 0) 
          {
-            log.debug("internalUnregisterPool: setting interval to Long.MAX_VALUE");
+            if (log.isDebugEnabled())
+               log.debug("internalUnregisterPool: setting interval to Long.MAX_VALUE");
             interval = Long.MAX_VALUE;
          }
-      
       }
-      
    }
    
    private void setupContextClassLoader()
    {
       // Could be null if loaded from system classloader
-      final ClassLoader cl = IdleRemover.class.getClassLoader();
+      final ClassLoader cl = ConnectionValidator.class.getClassLoader();
       if (cl == null)
          return;
       
@@ -153,39 +143,30 @@
 
    private class ConnectionValidatorRunnable implements Runnable
    {
-      
       public void run()
       {
          setupContextClassLoader();
          
          synchronized (pools)
          {
-            
             while (true)
             {
-
                try
                {
-             
                   pools.wait(interval);
 
-                  log.debug("run: ConnectionValidator notifying pools, interval: " + interval);
+                  if (log.isDebugEnabled())
+                     log.debug("run: ConnectionValidator notifying pools, interval: " + interval);
         
-                  for(Iterator iter = pools.iterator(); iter.hasNext();)
+                  for (InternalManagedConnectionPool mcp : pools)
                   {
-                     
-                     InternalManagedConnectionPool mcp = (InternalManagedConnectionPool)iter.next();
                      mcp.validateConnections();
                   }
 
                   next = System.currentTimeMillis() + interval;
                   
-                  if(next < 0)
-                  {
+                  if (next < 0)
                      next = Long.MAX_VALUE;
-                     
-                  }
-
                }
                catch (InterruptedException e)
                {
@@ -199,15 +180,9 @@
                catch (Exception e)
                {
                   log.warn("run: ConnectionValidator ignored unexpected error", e);
-               
                }
-           
-            
             }
-            
          }
-         
       }
-      
    }
 }

Modified: trunk/connector/src/main/org/jboss/resource/connectionmanager/IdleRemover.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/IdleRemover.java	2009-03-10 18:39:00 UTC (rev 85697)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/IdleRemover.java	2009-03-10 19:27:41 UTC (rev 85698)
@@ -23,7 +23,6 @@
 
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.util.Collection;
 import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.jboss.logging.Logger;
@@ -33,14 +32,15 @@
  *
  * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
- * @author <a href="mailto:weston.price at jboss.com>Weston Price</a>
+ * @author <a href="mailto:weston.price at jboss.com">Weston Price</a>
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision$
  */
 public class IdleRemover 
 {
    private final static Logger log = Logger.getLogger(IdleRemover.class);
 
-   private final Collection<IdleConnectionRemovalSupport> pools = new CopyOnWriteArrayList<IdleConnectionRemovalSupport>();
+   private final CopyOnWriteArrayList<IdleConnectionRemovalSupport> pools = new CopyOnWriteArrayList<IdleConnectionRemovalSupport>();
 
    private long interval = Long.MAX_VALUE;
 
@@ -48,6 +48,8 @@
 
    private static final IdleRemover remover = new IdleRemover();
 
+   private final boolean trace = log.isTraceEnabled();
+
    public static void registerPool(IdleConnectionRemovalSupport mcp, long interval)
    {
       remover.internalRegisterPool(mcp, interval);
@@ -86,10 +88,12 @@
    
    private void internalRegisterPool(IdleConnectionRemovalSupport mcp, long interval)
    {
-      log.trace("internalRegisterPool: registering pool with interval " + interval + " old interval: " + this.interval);
+      if (trace)
+         log.trace("internalRegisterPool: registering pool with interval " + interval + " old interval: " + this.interval);
       synchronized (pools)
       {
-         pools.add(mcp);
+         pools.addIfAbsent(mcp);
+
          if (interval > 1 && interval/2 < this.interval) 
          {
             this.interval = interval/2;
@@ -97,7 +101,8 @@
             if (next > maybeNext && maybeNext > 0) 
             {
                next = maybeNext;
-               log.trace("internalRegisterPool: about to notify thread: old next: " + next + ", new next: " + maybeNext);
+               if (trace)
+                  log.trace("internalRegisterPool: about to notify thread: old next: " + next + ", new next: " + maybeNext);
                pools.notify();
             }
          }
@@ -111,7 +116,8 @@
          pools.remove(mcp);
          if (pools.size() == 0) 
          {
-            log.trace("internalUnregisterPool: setting interval to Long.MAX_VALUE");
+            if (trace)
+               log.trace("internalUnregisterPool: setting interval to Long.MAX_VALUE");
             interval = Long.MAX_VALUE;
          }
       }
@@ -159,17 +165,18 @@
                try 
                {
                   pools.wait(interval);
-                  log.trace("run: IdleRemover notifying pools, interval: " + interval);
+                  if (trace)
+                     log.trace("run: IdleRemover notifying pools, interval: " + interval);
                   for (IdleConnectionRemovalSupport pool : pools ) 
                      pool.removeIdleConnections();
                   next = System.currentTimeMillis() + interval;
                   if (next < 0) 
                      next = Long.MAX_VALUE;      
-                  
                }
                catch (InterruptedException ie)
                {
-                  log.debug("run: IdleRemover has been interrupted, ending");
+                  if (log.isDebugEnabled())
+                     log.debug("run: IdleRemover has been interrupted, ending");
                   return;  
                }
                catch (RuntimeException e)

Modified: trunk/connector/src/main/org/jboss/resource/connectionmanager/InternalManagedConnectionPool.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/InternalManagedConnectionPool.java	2009-03-10 18:39:00 UTC (rev 85697)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/InternalManagedConnectionPool.java	2009-03-10 19:27:41 UTC (rev 85698)
@@ -47,6 +47,7 @@
  * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
  * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
  * @author <a href="mailto:weston.price at jboss.com">Weston Price</a>
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision$
  */
 public class InternalManagedConnectionPool implements IdleConnectionRemovalSupport
@@ -66,6 +67,9 @@
    /** The pooling parameters */
    private final PoolParams poolParams;
 
+   /** The JBoss managed connection pool */
+   private final JBossManagedConnectionPool jmcp;
+
    /** Copy of the maximum size from the pooling parameters.
     * Dynamic changes to this value are not compatible with
     * the semaphore which cannot change be dynamically changed.
@@ -109,23 +113,24 @@
     * @param log the log
     */
    protected InternalManagedConnectionPool(ManagedConnectionFactory mcf, ConnectionListenerFactory clf, Subject subject,
-         ConnectionRequestInfo cri, PoolParams poolParams, Logger log)
+                                           ConnectionRequestInfo cri, PoolParams poolParams, JBossManagedConnectionPool jmcp,
+                                           Logger log)
    {
       this.mcf = mcf;
       this.clf = clf;
-      defaultSubject = subject;
-      defaultCri = cri;
+      this.defaultSubject = subject;
+      this.defaultCri = cri;
       this.poolParams = poolParams;
       this.maxSize = poolParams.maxSize;
+      this.jmcp = jmcp;
       this.log = log;
       this.trace = log.isTraceEnabled();
-      cls = new ArrayList(this.maxSize);
-      permits = new Semaphore(this.maxSize);
+      this.cls = new ArrayList(this.maxSize);
+      this.permits = new Semaphore(this.maxSize);
   
-      if(poolParams.prefill){
-         
+      if (poolParams.prefill)
+      {
          PoolFiller.fillPool(this);
-         
       }
    }
 
@@ -139,13 +144,18 @@
 
       if (poolParams.backgroundInterval > 0)
       {
-
          log.debug("Registering for background validation at interval " + poolParams.backgroundInterval);
          ConnectionValidator.registerPool(this, poolParams.backgroundInterval);
+      }
 
-      }
+      shutdown.set(false);
    }
 
+   protected boolean isRunning()
+   {
+      return !shutdown.get();
+   }
+
    public long getAvailableConnections()
    {
       return permits.availablePermits();
@@ -189,7 +199,7 @@
                   if (shutdown.get())
                   {
                      permits.release();
-                     throw new ResourceException("The pool has been shutdown");
+                     throw new RetryableResourceException("The pool has been shutdown");
                   }
 
                   if (cls.size() > 0)
@@ -476,6 +486,10 @@
          // We destroyed something, check the minimum.
          if (shutdown.get() == false && poolParams.minSize > 0)
             PoolFiller.fillPool(this);
+
+         // Empty sub-pool
+         if (jmcp != null)
+            jmcp.getPoolingStrategy().emptySubPool(this);
       }
    }
 
@@ -597,6 +611,14 @@
       }
    }
 
+   boolean isEmpty()
+   {
+      synchronized (cls)
+      {
+         return cls.size() == 0;
+      }
+   }
+
    /**
     * Create a connection event listener
     *

Modified: trunk/connector/src/main/org/jboss/resource/connectionmanager/JBossManagedConnectionPool.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/JBossManagedConnectionPool.java	2009-03-10 18:39:00 UTC (rev 85697)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/JBossManagedConnectionPool.java	2009-03-10 19:27:41 UTC (rev 85698)
@@ -27,6 +27,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 
 import javax.management.Notification;
 import javax.management.NotificationFilter;
@@ -74,6 +75,7 @@
  * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
  * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
  * @author <a href="mailto:weston.price at jboss.com">Weston Price</a>
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * 
  * @version $Revision$
  */
@@ -316,11 +318,12 @@
    {
       this.poolParams.useFastFail = useFastFail;
    }
+
    @ManagementOperation(description="Flush the connections in the pool",
          impact=Impact.WriteOnly)
    public void flush()
    {
-	   if (poolingStrategy == null)
+      if (poolingStrategy == null)
          throw new IllegalStateException("The connection pool is not started");
 
       poolingStrategy.flush();
@@ -331,7 +334,6 @@
 
          if (pfs.shouldPreFill())
             pfs.prefill(noTxSeparatePools);
-
       }
    }
 
@@ -434,13 +436,13 @@
       );
 
       if ("ByContainerAndApplication".equals(criteria))
-         poolingStrategy = new PoolBySubjectAndCri(mcf, poolParams, noTxSeparatePools, log);
+         poolingStrategy = new PoolBySubjectAndCri(mcf, poolParams, noTxSeparatePools, this, log);
       else if ("ByContainer".equals(criteria))
-         poolingStrategy = new PoolBySubject(mcf, poolParams, noTxSeparatePools, log);
+         poolingStrategy = new PoolBySubject(mcf, poolParams, noTxSeparatePools, this, log);
       else if ("ByApplication".equals(criteria))
-         poolingStrategy = new PoolByCri(mcf, poolParams, noTxSeparatePools, log);
+         poolingStrategy = new PoolByCri(mcf, poolParams, noTxSeparatePools, this, log);
       else if ("ByNothing".equals(criteria))
-         poolingStrategy = new OnePool(mcf, poolParams, noTxSeparatePools, log);
+         poolingStrategy = new OnePool(mcf, poolParams, noTxSeparatePools, this, log);
       else
          throw new DeploymentException("Unknown pooling criteria: " + criteria); 
          
@@ -464,6 +466,11 @@
       flush();
    }
 
+   ManagedConnectionPool getPoolingStrategy()
+   {
+      return poolingStrategy;
+   }
+
    public static class SubPoolContext
    {
       /** The subpool */
@@ -481,12 +488,13 @@
        * @param subject the subject
        * @param cri the connection request info
        * @param poolParams the pool parameters
+       * @param jmcp the JBoss managed connection pool reference
        * @param log the log
        */
       public SubPoolContext(TransactionManager tm, ManagedConnectionFactory mcf, ConnectionListenerFactory clf, Subject subject,
-            ConnectionRequestInfo cri, PoolParams poolParams, Logger log)
+                            ConnectionRequestInfo cri, PoolParams poolParams, JBossManagedConnectionPool jmcp, Logger log)
       {
-         subPool = new InternalManagedConnectionPool(mcf, clf, subject, cri, poolParams, log);
+         subPool = new InternalManagedConnectionPool(mcf, clf, subject, cri, poolParams, jmcp, log);
          if (tm != null)
             trackByTx = new TransactionLocal(tm);
       }
@@ -526,7 +534,7 @@
    public abstract static class BasePool implements ManagedConnectionPool, StatisticsReporter, PreFillPoolSupport
    {
       /** The subpools */
-      private final Map subPools = new ConcurrentHashMap();
+      private final ConcurrentMap<Object, SubPoolContext> subPools = new ConcurrentHashMap<Object, SubPoolContext>();
 
       /** The managed connection factory */
       private final ManagedConnectionFactory mcf;
@@ -542,6 +550,10 @@
 
       /** The poolName */
       private String poolName;
+
+      /** The JBoss managed connection pool */
+      private final JBossManagedConnectionPool jmcp;
+
       /** The logger */
       private final Logger log;
 
@@ -556,11 +568,12 @@
        * @param log the log
        */
       public BasePool(final ManagedConnectionFactory mcf, final InternalManagedConnectionPool.PoolParams poolParams,
-                      final boolean noTxSeparatePools, final Logger log)
+                      final boolean noTxSeparatePools, final JBossManagedConnectionPool jmcp, final Logger log)
       {
          this.mcf = mcf;
          this.poolParams = poolParams;
          this.noTxSeparatePools = noTxSeparatePools;
+         this.jmcp = jmcp;
          this.log = log;
          this.traceEnabled = log.isTraceEnabled();
       }
@@ -604,10 +617,32 @@
          // Simple case
          if (trackByTransaction == null || trackByTx == null)
          {
-            ConnectionListener cl = mcp.getConnection(subject, cri);
-            if (traceEnabled)
-               dump("Got connection from pool " + cl);
-            return cl;
+            try
+            {
+               ConnectionListener cl = mcp.getConnection(subject, cri);
+               if (traceEnabled)
+                  dump("Got connection from pool " + cl);
+               return cl;
+            }
+            catch (RetryableResourceException rre)
+            {
+               if (log.isDebugEnabled())
+                  log.debug("Got a RetryableResourceException - trying to reinitialize the pool");
+
+               // The IMCP is down - retry
+               subPool = getSubPool(key, subject, cri);
+               mcp = subPool.getSubPool();
+
+               // Make sure that IMCP is running
+               if (!mcp.isRunning())
+                  mcp.initialize();
+
+               ConnectionListener cl = mcp.getConnection(subject, cri);
+               if (traceEnabled)
+                  dump("Got connection from pool (retried) " + cl);
+
+               return cl;
+            }
          }
 
          // Track by transaction
@@ -861,6 +896,31 @@
       }
 
       /**
+       * Remove the matching SubPoolContext if the pool is empty
+       * @param pool The internal managed connection pool
+       */
+      public void emptySubPool(InternalManagedConnectionPool pool)
+      {
+         if (pool != null)
+         {
+            synchronized (subPools)
+            {
+               for (Iterator i = subPools.values().iterator(); i.hasNext(); )
+               {
+                  SubPoolContext subPoolContext = (SubPoolContext) i.next();
+                  InternalManagedConnectionPool other = subPoolContext.getSubPool();
+                  if (other == pool && pool.isEmpty())
+                  {
+                     pool.shutdown();
+                     i.remove();
+                     break;
+                  }
+               }
+            }
+         }
+      }
+
+      /**
        * For testing
        */
       protected void shutdownWithoutClear()
@@ -900,22 +960,18 @@
        */
       protected SubPoolContext getSubPool(Object key, Subject subject, ConnectionRequestInfo cri) throws ResourceException
       {
-         SubPoolContext subPool = (SubPoolContext) subPools.get(key);
+         SubPoolContext subPool = (SubPoolContext)subPools.get(key);
          if (subPool == null)
          {
-            TransactionManager tm = getTransactionManager();
-            subPool = new SubPoolContext(tm, mcf, clf, subject, cri, poolParams, log);
-            synchronized (subPools)
+            SubPoolContext newSubPool = new SubPoolContext(getTransactionManager(), mcf, clf, subject, cri, poolParams, jmcp, log);
+            subPool = subPools.putIfAbsent(key, newSubPool);
+            if (subPool == null)
             {
-               if (subPools.containsKey(key))
-                  subPool = (SubPoolContext) subPools.get(key);
-               else
-               {
-                  subPool.initialize();
-                  subPools.put(key, subPool);
-               }
+               subPool = newSubPool;
+               subPool.initialize();
             }
          }
+
          return subPool;
       }
 
@@ -1011,10 +1067,10 @@
       public PoolBySubjectAndCri(final ManagedConnectionFactory mcf,
                                  final InternalManagedConnectionPool.PoolParams poolParams,
                                  final boolean noTxSeparatePools, 
+                                 final JBossManagedConnectionPool jmcp, 
                                  final Logger log)
       {
-         super(mcf, poolParams, noTxSeparatePools, log);
-      
+         super(mcf, poolParams, noTxSeparatePools, jmcp, log);
       }
 
       protected Object getKey(final Subject subject, final ConnectionRequestInfo cri, final boolean separateNoTx) throws ResourceException
@@ -1111,9 +1167,10 @@
       public PoolBySubject(final ManagedConnectionFactory mcf,
                            final InternalManagedConnectionPool.PoolParams poolParams,
                            final boolean noTxSeparatePools, 
+                           final JBossManagedConnectionPool jmcp, 
                            final Logger log)
       {
-         super(mcf, poolParams, noTxSeparatePools, log);
+         super(mcf, poolParams, noTxSeparatePools, jmcp, log);
       }
 
       protected Object getKey(final Subject subject, final ConnectionRequestInfo cri, boolean separateNoTx)
@@ -1201,9 +1258,10 @@
       public PoolByCri(final ManagedConnectionFactory mcf,
                        final InternalManagedConnectionPool.PoolParams poolParams,
                        final boolean noTxSeparatePools, 
+                       final JBossManagedConnectionPool jmcp, 
                        final Logger log)
       {
-         super(mcf, poolParams, noTxSeparatePools, log);
+         super(mcf, poolParams, noTxSeparatePools, jmcp, log);
       }
 
       protected Object getKey(final Subject subject, final ConnectionRequestInfo cri, boolean separateNoTx)
@@ -1292,9 +1350,18 @@
                      final boolean noTxSeparatePools, 
                      final Logger log)
       {
-         super(mcf, poolParams, noTxSeparatePools, log);
+         super(mcf, poolParams, noTxSeparatePools, null, log);
       }
 
+      public OnePool(final ManagedConnectionFactory mcf,
+                     final InternalManagedConnectionPool.PoolParams poolParams,
+                     final boolean noTxSeparatePools, 
+                     final JBossManagedConnectionPool jmcp, 
+                     final Logger log)
+      {
+         super(mcf, poolParams, noTxSeparatePools, jmcp, log);
+      }
+
       protected Object getKey(final Subject subject, final ConnectionRequestInfo cri, boolean separateNoTx)
       {
          if (separateNoTx)
@@ -1321,6 +1388,10 @@
          }
          
       }
+
+      public void emptySubPool(InternalManagedConnectionPool pool)
+      {
+      }
    }
 
    private static class SubjectActions implements PrivilegedAction

Modified: trunk/connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionPool.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionPool.java	2009-03-10 18:39:00 UTC (rev 85697)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionPool.java	2009-03-10 19:27:41 UTC (rev 85698)
@@ -31,6 +31,7 @@
  * A managed connection pool
  *
  * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision$
  */
 public interface ManagedConnectionPool
@@ -112,6 +113,12 @@
    void flush();
 
    /**
+    * empty the sub pool
+    * @param imcp the internal managed connection pool
+    */
+   void emptySubPool(InternalManagedConnectionPool pool);
+
+   /**
     *  @return the native connection statistics of underlying 
     *  connection.
     */

Added: trunk/connector/src/main/org/jboss/resource/connectionmanager/RetryableResourceException.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/RetryableResourceException.java	                        (rev 0)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/RetryableResourceException.java	2009-03-10 19:27:41 UTC (rev 85698)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resource.connectionmanager;
+
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
+import javax.resource.ResourceException;
+
+/**
+ * RetryableResourceException
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: 71554 $
+ */
+public class RetryableResourceException extends ResourceException
+{
+   static final long serialVersionUID = -7865510613151405764L;
+
+   public RetryableResourceException()
+   {
+      super();
+   }
+
+   public RetryableResourceException(String message)
+   {
+      super(message);
+   }
+
+   public RetryableResourceException(String message, String errorCode)
+   {
+      super(message, errorCode);
+   }
+
+   public RetryableResourceException(String message, Throwable t)
+   {
+      super(message, t);
+   }
+
+   public RetryableResourceException(Throwable t)
+   {
+      super(t);
+   }
+}




More information about the jboss-cvs-commits mailing list