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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 19 10:47:03 EDT 2010


Author: jesper.pedersen
Date: 2010-10-19 10:47:02 -0400 (Tue, 19 Oct 2010)
New Revision: 108656

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/AbstractPrefillPool.java
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/api/Pool.java
   projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java
Log:
Set the pool name - default to the JNDI name

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	2010-10-19 11:47:20 UTC (rev 108655)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/AbstractPool.java	2010-10-19 14:47:02 UTC (rev 108656)
@@ -108,7 +108,7 @@
     * Sets pool name.
     * @param poolName pool name
     */
-   public void setPoolName(String poolName)
+   public void setName(String poolName)
    {
       this.poolName = poolName;
    }
@@ -117,7 +117,7 @@
     * Gets pool name.
     * @return pool name
     */
-   public String getPoolName()
+   public String getName()
    {
       return poolName;
    }

Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/AbstractPrefillPool.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/AbstractPrefillPool.java	2010-10-19 11:47:20 UTC (rev 108655)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/AbstractPrefillPool.java	2010-10-19 14:47:02 UTC (rev 108656)
@@ -76,7 +76,7 @@
       if (shouldPrefill())
       {
          if (log.isDebugEnabled())
-            log.debug("Attempting to prefill pool for pool with jndi name" + getPoolName());
+            log.debug("Attempting to prefill pool: " + getName());
 
          try
          {
@@ -89,7 +89,7 @@
          catch (Throwable t)
          {
             //No real need to throw here being that pool remains in the same state as before.
-            log.error("Unable to prefill pool with jndi name" + getPoolName(), t);
+            log.error("Unable to prefill pool: " + getName(), t);
          }
       }
    }

Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/api/Pool.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/api/Pool.java	2010-10-19 11:47:20 UTC (rev 108655)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/api/Pool.java	2010-10-19 14:47:02 UTC (rev 108656)
@@ -41,18 +41,30 @@
 public interface Pool
 {
    /**
+    * Gets pool name.
+    * @return pool name
+    */
+   public String getName();
+
+   /**
+    * Sets pool name.
+    * @param poolName pool name
+    */
+   public void setName(String poolName);
+   
+   /**
     * Retrieve the managed connection factory for this pool.
     * 
     * @return the managed connection factory
     */ 
-   ManagedConnectionFactory getManagedConnectionFactory();
+   public ManagedConnectionFactory getManagedConnectionFactory();
 
    /**
     * Set the connection listener factory.
     * 
     * @param clf the connection event listener factory
     */
-   void setConnectionListenerFactory(ConnectionListenerFactory clf);
+   public void setConnectionListenerFactory(ConnectionListenerFactory clf);
 
    /**
     * Get a connection
@@ -63,7 +75,7 @@
     * @return a connection event listener wrapping the connection
     * @throws ResourceException for any error
     */
-   ConnectionListener getConnection(Transaction trackByTransaction, Subject subject, ConnectionRequestInfo cri)
+   public ConnectionListener getConnection(Transaction trackByTransaction, Subject subject, ConnectionRequestInfo cri)
       throws ResourceException;
 
    /**
@@ -73,22 +85,22 @@
     * @param kill whether to destroy the managed connection
     * @throws ResourceException for any error
     */
-   void returnConnection(ConnectionListener cl, boolean kill) 
+   public void returnConnection(ConnectionListener cl, boolean kill) 
       throws ResourceException;
 
    /**
     * Shutdown the pool
     */
-   void shutdown();
+   public void shutdown();
 
    /**
     * Flush the pool
     */
-   void flush();
+   public void flush();
 
    /**
     * Remove the matching SubPoolContext if the pool is empty
     * @param pool the internal managed connection pool
     */
-   void emptySubPool(ManagedConnectionPool pool);
+   public void emptySubPool(ManagedConnectionPool pool);
 }

Modified: projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java	2010-10-19 11:47:20 UTC (rev 108655)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java	2010-10-19 14:47:02 UTC (rev 108656)
@@ -1010,6 +1010,17 @@
                            cfJndiNames = new String[]{jndiName};
 
                            cm.setJndiName(jndiName);
+
+                           String poolName = null;
+                           if (cdRaXml != null)
+                              poolName = cdRaXml.getPoolName();
+                           else if (ijCD != null)
+                              poolName = ijCD.getPoolName();
+ 
+                           if (poolName == null)
+                              poolName = jndiName;
+
+                           pool.setName(poolName);
                         }
                         else
                         {
@@ -1017,6 +1028,17 @@
                            cfs = new Object[]{cf};
 
                            cm.setJndiName(cfJndiNames[0]);
+
+                           String poolName = null;
+                           if (cdRaXml != null)
+                              poolName = cdRaXml.getPoolName();
+                           else if (ijCD != null)
+                              poolName = ijCD.getPoolName();
+ 
+                           if (poolName == null)
+                              poolName = cfJndiNames[0];
+
+                           pool.setName(poolName);
                         }
 
                         org.jboss.jca.core.management.ManagedConnectionFactory mgtMcf =
@@ -1266,6 +1288,17 @@
                                        cfJndiNames[cdIndex] = jndiName;
 
                                        cm.setJndiName(jndiName);
+
+                                       String poolName = null;
+                                       if (cdRaXml != null)
+                                          poolName = cdRaXml.getPoolName();
+                                       else if (ijCD != null)
+                                          poolName = ijCD.getPoolName();
+                                       
+                                       if (poolName == null)
+                                          poolName = jndiName;
+
+                                       pool.setName(poolName);
                                     }
                                     else
                                     {
@@ -1273,6 +1306,17 @@
                                        cfs = new Object[]{cf};
 
                                        cm.setJndiName(cfJndiNames[0]);
+
+                                       String poolName = null;
+                                       if (cdRaXml != null)
+                                          poolName = cdRaXml.getPoolName();
+                                       else if (ijCD != null)
+                                          poolName = ijCD.getPoolName();
+                                       
+                                       if (poolName == null)
+                                          poolName = cfJndiNames[0];
+
+                                       pool.setName(poolName);
                                     }
 
                                     org.jboss.jca.core.management.ManagedConnectionFactory mgtMcf =



More information about the jboss-cvs-commits mailing list