[jboss-cvs] JBossAS SVN: r111108 - in projects/jboss-jca/trunk/core: src/main/java/org/jboss/jca/core/api/connectionmanager/pool and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 6 11:03:08 EDT 2011


Author: jesper.pedersen
Date: 2011-04-06 11:03:07 -0400 (Wed, 06 Apr 2011)
New Revision: 111108

Added:
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/api/connectionmanager/pool/PoolStatistics.java
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/SubPoolStatistics.java
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ManagedConnectionPoolStatistics.java
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ManagedConnectionPoolStatisticsImpl.java
   projects/jboss-jca/trunk/core/src/main/resources/poolstatistics.properties
Modified:
   projects/jboss-jca/trunk/core/build.xml
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/api/connectionmanager/pool/Pool.java
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/AbstractPool.java
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ArrayBlockingQueueManagedConnectionPool.java
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ManagedConnectionPool.java
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/SemaphoreArrayListManagedConnectionPool.java
Log:
[JBJCA-542] Statistics support (Part 2)

Modified: projects/jboss-jca/trunk/core/build.xml
===================================================================
--- projects/jboss-jca/trunk/core/build.xml	2011-04-06 04:39:04 UTC (rev 111107)
+++ projects/jboss-jca/trunk/core/build.xml	2011-04-06 15:03:07 UTC (rev 111108)
@@ -66,6 +66,11 @@
        Target: jars 
        ================================= -->
   <target name="jars" depends="compile">
+    <copy todir="${build.core.dir}/impl">
+      <fileset dir="src/main/resources"
+               includes="**/*.properties"/>
+    </copy>
+
     <jar destfile="${target.dir}/${name}-core-api.jar"
          basedir="${build.core.dir}/impl"
          index="true"

Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/api/connectionmanager/pool/Pool.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/api/connectionmanager/pool/Pool.java	2011-04-06 04:39:04 UTC (rev 111107)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/api/connectionmanager/pool/Pool.java	2011-04-06 15:03:07 UTC (rev 111108)
@@ -33,4 +33,10 @@
     * @return pool name
     */
    public String getName();
+
+   /**
+    * Get the statistics
+    * @return The value
+    */
+   public PoolStatistics getStatistics();
 }

Added: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/api/connectionmanager/pool/PoolStatistics.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/api/connectionmanager/pool/PoolStatistics.java	                        (rev 0)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/api/connectionmanager/pool/PoolStatistics.java	2011-04-06 15:03:07 UTC (rev 111108)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.jca.core.api.connectionmanager.pool;
+
+import org.jboss.jca.core.spi.statistics.StatisticsPlugin;
+
+/**
+ * The pool statistics
+ *
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public interface PoolStatistics extends StatisticsPlugin
+{
+}

Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/AbstractPool.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/AbstractPool.java	2011-04-06 04:39:04 UTC (rev 111107)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/AbstractPool.java	2011-04-06 15:03:07 UTC (rev 111108)
@@ -24,6 +24,7 @@
 
 import org.jboss.jca.common.JBossResourceException;
 import org.jboss.jca.core.api.connectionmanager.pool.PoolConfiguration;
+import org.jboss.jca.core.api.connectionmanager.pool.PoolStatistics;
 import org.jboss.jca.core.connectionmanager.listener.ConnectionListener;
 import org.jboss.jca.core.connectionmanager.listener.ConnectionListenerFactory;
 import org.jboss.jca.core.connectionmanager.pool.api.Pool;
@@ -82,6 +83,9 @@
    /** The poolName */
    private String poolName;
 
+   /** Statistics */
+   private SubPoolStatistics statistics;
+
    /**
     * Create a new base pool.
     *
@@ -102,6 +106,7 @@
       this.poolConfiguration = pc;
       this.noTxSeparatePools = noTxSeparatePools;
       this.trace = log.isTraceEnabled();
+      this.statistics = new SubPoolStatistics(subPools);
    }
 
    /**
@@ -303,10 +308,7 @@
          //Get connection from imcp
          cl = imcp.getConnection(subject, cri);
 
-         if (trace)
-         {
-            dump("Got connection from pool : " + cl);
-         }
+         log.tracef("Got connection from pool: %s", cl);
 
          return cl;
 
@@ -327,9 +329,9 @@
 
             //Getting connection from pool
             cl = imcp.getConnection(subject, cri);
-            if (trace)
-               dump("Got connection from pool (retried) " + cl);
 
+            log.tracef("Got connection from pool (retried): %s", cl);
+
             return cl;
          }
          else
@@ -370,10 +372,7 @@
          cl = (ConnectionListener) trackByTx.get(trackByTransaction);
          if (cl != null)
          {
-            if (trace)
-            {
-               dump("Previous connection tracked by transaction " + cl + " tx=" + trackByTransaction);
-            }
+            log.tracef("Previous connection tracked by transaction=%s tx=%s", cl, trackByTransaction);
 
             return cl;
          }
@@ -411,10 +410,7 @@
       // Instead we do a double check after we got the transaction to see
       // whether another thread beat us to the punch.
       cl = mcp.getConnection(subject, cri);
-      if (trace)
-      {
-         dump("Got connection from pool tracked by transaction " + cl + " tx=" + trackByTransaction);
-      }
+      log.tracef("Got connection from pool tracked by transaction=%s tx=%s", cl, trackByTransaction);
 
       // Relock and check/set status
       try
@@ -424,11 +420,8 @@
       catch (Throwable t)
       {
          mcp.returnConnection(cl, false);
-         if (trace)
-         {
-            dump("Had to return connection tracked by transaction " + cl + " tx=" +
-                  trackByTransaction + " error=" + t.getMessage());
-         }
+         log.tracef("Had to return connection tracked by transaction=%s tx=%s error=%s",
+                    cl, trackByTransaction, t.getMessage());
 
          JBossResourceException.rethrowAsResourceException("Unable to get connection from the pool for tx="
                + trackByTransaction, t);
@@ -440,12 +433,10 @@
          if (other != null)
          {
             mcp.returnConnection(cl, false);
-            if (trace)
-            {
-               dump("Another thread already got a connection tracked by transaction " +
-                     other + " tx=" + trackByTransaction);
-            }
 
+            log.tracef("Another thread already got a connection tracked by transaction=%s tx=%s",
+                       other, trackByTransaction);
+
             cl = other;
          }
 
@@ -453,11 +444,7 @@
          cl.setTrackByTx(true);
          trackByTx.set(cl);
 
-         if (trace)
-         {
-            dump("Using connection from pool tracked by transaction " + cl + " tx=" + trackByTransaction);
-         }
-
+         log.tracef("Using connection from pool tracked by transaction=%s tx=%s", cl, trackByTransaction);
       }
       finally
       {
@@ -487,10 +474,7 @@
       //Return connection to the pool
       mcp.returnConnection(cl, kill);
 
-      if (trace)
-      {
-         dump("Returning connection to pool " + cl);
-      }
+      log.tracef("Returning connection to pool %s", cl);
    }
 
    /**
@@ -510,24 +494,11 @@
    }
 
    /**
-    * Dump the stats to the trace log
-    * @param info some context
+    * {@inheritDoc}
     */
-   private void dump(String info)
+   public PoolStatistics getStatistics()
    {
-      if (trace)
-      {
-         StringBuffer toLog = new StringBuffer(100);
-         toLog.append(info);
-         /*
-           .append(" [InUse/Available/Max]: [");
-           toLog.append(getInUseConnectionCount()).append("/");
-           toLog.append(getAvailableConnectionCount()).append("/");
-           toLog.append(poolConfiguration.getMaxSize());
-           toLog.append("]");
-         */
-         log.trace(toLog);
-      }
+      return statistics;
    }
 
    /**

Added: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/SubPoolStatistics.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/SubPoolStatistics.java	                        (rev 0)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/SubPoolStatistics.java	2011-04-06 15:03:07 UTC (rev 111108)
@@ -0,0 +1,159 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.jca.core.connectionmanager.pool;
+
+import org.jboss.jca.core.api.connectionmanager.pool.PoolStatistics;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.Set;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * Sub pool statistics.
+ *
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class SubPoolStatistics implements PoolStatistics
+{
+   private ConcurrentMap<Object, SubPoolContext> subPools;
+   private Set<String> names;
+   private Map<String, Class> types;
+   private AtomicBoolean enabled;
+   private Map<Locale, ResourceBundle> rbs;
+
+   /**
+    * Constructor
+    * @param subPools The sub pool map
+    */
+   public SubPoolStatistics(ConcurrentMap<Object, SubPoolContext> subPools)
+   {
+      this.subPools = subPools;
+
+      Set<String> n = new HashSet<String>();
+      Map<String, Class> t = new HashMap<String, Class>();
+
+      this.names = Collections.unmodifiableSet(n);
+      this.types = Collections.unmodifiableMap(t);
+      this.enabled = new AtomicBoolean(true);
+      
+      ResourceBundle defaultResourceBundle = 
+         ResourceBundle.getBundle("poolstatistics", Locale.US, SubPoolStatistics.class.getClassLoader());
+      this.rbs = new HashMap<Locale, ResourceBundle>(1);
+      this.rbs.put(Locale.US, defaultResourceBundle);
+
+      clear();
+   }
+
+
+   /**
+    * {@inheritDoc}
+    */
+   public Set<String> getNames()
+   {
+      return names;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Class getType(String name)
+   {
+      return types.get(name);
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public String getDescription(String name)
+   {
+      return getDescription(name, Locale.US);
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public String getDescription(String name, Locale locale)
+   {
+      ResourceBundle rb = rbs.get(locale);
+
+      if (rb == null)
+      {
+         ResourceBundle newResourceBundle =
+            ResourceBundle.getBundle("poolstatistics", locale, SubPoolStatistics.class.getClassLoader());
+
+         if (newResourceBundle != null)
+            rbs.put(locale, newResourceBundle);
+      }
+
+      if (rb == null)
+         rb = rbs.get(Locale.US);
+
+      if (rb != null)
+         return rb.getString(name);
+
+      return "";
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public Object getValue(String name)
+   {
+      return null;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public boolean isEnabled()
+   {
+      return enabled.get();
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public void setEnabled(boolean v)
+   {
+      for (SubPoolContext spc : subPools.values())
+      {
+         spc.getSubPool().getStatistics().setEnabled(v);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void clear()
+   {
+      // Do nothing
+   }
+}

Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ArrayBlockingQueueManagedConnectionPool.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ArrayBlockingQueueManagedConnectionPool.java	2011-04-06 04:39:04 UTC (rev 111107)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ArrayBlockingQueueManagedConnectionPool.java	2011-04-06 15:03:07 UTC (rev 111108)
@@ -114,6 +114,9 @@
    /** the max connections ever checked out **/
    private AtomicInteger maxUsedConnections = new AtomicInteger(0);
 
+   /** Statistics */
+   private ManagedConnectionPoolStatisticsImpl statistics;
+
    /**
     * Constructor
     */
@@ -140,6 +143,7 @@
       this.trace = log.isTraceEnabled();
       this.cls = new ArrayBlockingQueue<ConnectionListener>(this.maxSize, true);
       this.permits = new ConcurrentHashMap<ConnectionListener, ConnectionListener>(this.maxSize);
+      this.statistics = new ManagedConnectionPoolStatisticsImpl();
   
       if (pc.isPrefill())
       {
@@ -644,6 +648,15 @@
    }
 
    /**
+    * Get statistics
+    * @return The module
+    */
+   public ManagedConnectionPoolStatistics getStatistics()
+   {
+      return statistics;
+   }
+
+   /**
     * Create a connection event listener
     *
     * @param subject the subject

Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ManagedConnectionPool.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ManagedConnectionPool.java	2011-04-06 04:39:04 UTC (rev 111107)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ManagedConnectionPool.java	2011-04-06 15:03:07 UTC (rev 111108)
@@ -118,4 +118,10 @@
     * @throws Exception for exception
     */
    public void validateConnections() throws Exception;
+
+   /**
+    * Get statistics
+    * @return The module
+    */
+   public ManagedConnectionPoolStatistics getStatistics();
 }

Added: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ManagedConnectionPoolStatistics.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ManagedConnectionPoolStatistics.java	                        (rev 0)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ManagedConnectionPoolStatistics.java	2011-04-06 15:03:07 UTC (rev 111108)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jca.core.connectionmanager.pool.mcp;
+
+import org.jboss.jca.core.api.connectionmanager.pool.PoolStatistics;
+
+/**
+ * Statistics for a managed connection pool
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public interface ManagedConnectionPoolStatistics extends PoolStatistics
+{   
+}

Added: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ManagedConnectionPoolStatisticsImpl.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ManagedConnectionPoolStatisticsImpl.java	                        (rev 0)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/ManagedConnectionPoolStatisticsImpl.java	2011-04-06 15:03:07 UTC (rev 111108)
@@ -0,0 +1,148 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.jca.core.connectionmanager.pool.mcp;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * Core statistics.
+ *
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class ManagedConnectionPoolStatisticsImpl implements ManagedConnectionPoolStatistics
+{
+   private Set<String> names;
+   private Map<String, Class> types;
+   private AtomicBoolean enabled;
+   private Map<Locale, ResourceBundle> rbs;
+
+   /**
+    * Constructor
+    */
+   public ManagedConnectionPoolStatisticsImpl()
+   {
+      Set<String> n = new HashSet<String>();
+      Map<String, Class> t = new HashMap<String, Class>();
+
+      this.names = Collections.unmodifiableSet(n);
+      this.types = Collections.unmodifiableMap(t);
+      this.enabled = new AtomicBoolean(true);
+      
+      ResourceBundle defaultResourceBundle = 
+         ResourceBundle.getBundle("poolstatistics", Locale.US, 
+                                  ManagedConnectionPoolStatisticsImpl.class.getClassLoader());
+      this.rbs = new HashMap<Locale, ResourceBundle>(1);
+      this.rbs.put(Locale.US, defaultResourceBundle);
+
+      clear();
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Set<String> getNames()
+   {
+      return names;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Class getType(String name)
+   {
+      return types.get(name);
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public String getDescription(String name)
+   {
+      return getDescription(name, Locale.US);
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public String getDescription(String name, Locale locale)
+   {
+      ResourceBundle rb = rbs.get(locale);
+
+      if (rb == null)
+      {
+         ResourceBundle newResourceBundle =
+            ResourceBundle.getBundle("poolstatistics", locale, 
+                                     ManagedConnectionPoolStatisticsImpl.class.getClassLoader());
+
+         if (newResourceBundle != null)
+            rbs.put(locale, newResourceBundle);
+      }
+
+      if (rb == null)
+         rb = rbs.get(Locale.US);
+
+      if (rb != null)
+         return rb.getString(name);
+
+      return "";
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Object getValue(String name)
+   {
+      return null;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public boolean isEnabled()
+   {
+      return enabled.get();
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setEnabled(boolean v)
+   {
+      enabled.set(v);
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void clear()
+   {
+      // Do nothing
+   }
+}

Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/SemaphoreArrayListManagedConnectionPool.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/SemaphoreArrayListManagedConnectionPool.java	2011-04-06 04:39:04 UTC (rev 111107)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/SemaphoreArrayListManagedConnectionPool.java	2011-04-06 15:03:07 UTC (rev 111108)
@@ -121,6 +121,9 @@
    /** the max connections ever checked out **/
    private volatile int maxUsedConnections = 0;
 
+   /** Statistics */
+   private ManagedConnectionPoolStatisticsImpl statistics;
+
    /**
     * Constructor
     */
@@ -147,7 +150,8 @@
       this.trace = log.isTraceEnabled();
       this.cls = new ArrayList<ConnectionListener>(this.maxSize);
       this.permits = new Semaphore(this.maxSize, true);
-  
+      this.statistics = new ManagedConnectionPoolStatisticsImpl();
+
       if (pc.isPrefill())
       {
          PoolFiller.fillPool(this);
@@ -640,6 +644,15 @@
    }
 
    /**
+    * Get statistics
+    * @return The module
+    */
+   public ManagedConnectionPoolStatistics getStatistics()
+   {
+      return statistics;
+   }
+
+   /**
     * Create a connection event listener
     *
     * @param subject the subject

Added: projects/jboss-jca/trunk/core/src/main/resources/poolstatistics.properties
===================================================================


More information about the jboss-cvs-commits mailing list