Examples of ManagedConnectionPool


Examples of org.jboss.jca.core.connectionmanager.pool.mcp.ManagedConnectionPool

      Set<ManagedConnectionPool> clearMcpPools = new HashSet<ManagedConnectionPool>();

      Iterator<ManagedConnectionPool> it = mcpPools.values().iterator();
      while (it.hasNext())
      {
         ManagedConnectionPool mcp = it.next();
         mcp.flush(kill);

         if (mcp.isEmpty())
            clearMcpPools.add(mcp);
      }

      if (clearMcpPools.size() > 0)
      {
         for (ManagedConnectionPool mcp : clearMcpPools)
         {
            mcp.shutdown();
            mcpPools.values().remove(mcp);
         }
      }
   }
View Full Code Here

Examples of org.jboss.jca.core.connectionmanager.pool.mcp.ManagedConnectionPool

      // Get specific managed connection pool key
      Object key = getKey(subject, cri, separateNoTx);

      // Get managed connection pool
      ManagedConnectionPool mcp = getManagedConnectionPool(key, subject, cri);

      // Are we doing track by transaction ?
      TransactionSynchronizationRegistry tsr = getTransactionSynchronizationRegistry();
      Object transactionKey = tsr != null ? tsr.getTransactionKey() : null;
View Full Code Here

Examples of org.jboss.jca.core.connectionmanager.pool.mcp.ManagedConnectionPool

    */
   public void returnConnection(ConnectionListener cl, boolean kill) throws ResourceException
   {
      cl.setTrackByTx(false);
      //Get connection listener pool
      ManagedConnectionPool mcp = (ManagedConnectionPool) cl.getContext();

      //Return connection to the pool
      mcp.returnConnection(cl, kill);

      if (trace)
         log.tracef("Returning connection to pool %s", cl);
   }
View Full Code Here

Examples of org.jboss.jca.core.connectionmanager.pool.mcp.ManagedConnectionPool

      shutdown.set(true);

      Iterator<ManagedConnectionPool> it = mcpPools.values().iterator();
      while (it.hasNext())
      {
         ManagedConnectionPool mcp = it.next();
         mcp.shutdown();
      }

      mcpPools.clear();
   }
View Full Code Here

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

      mcf = new TestManagedConnectionFactory();

      InternalManagedConnectionPool.PoolParams pp = new InternalManagedConnectionPool.PoolParams();

      ManagedConnectionPool poolingStrategy = new JBossManagedConnectionPool.OnePool(mcf, pp, false, log);

      cm = new TxConnectionManager(ccm, poolingStrategy, tm);

      poolingStrategy.setConnectionListenerFactory(cm);

      MBeanServer server = MBeanServerLocator.locateJBoss();
      ObjectName onCE = new ObjectName("jboss.jta:name=CoordinatorEnvironmentBean");
      txTimeout = ((Integer)server.getAttribute(onCE, "DefaultTimeout")).intValue();
   }
View Full Code Here

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

  
   public static ManagedConnectionPool getManagedConnectionPool(PoolType type, ManagedConnectionFactory mcf,
         boolean noTxnSeperatePool, InternalManagedConnectionPool.PoolParams pp, Logger log)
   {

      ManagedConnectionPool mcp = null;

      if (type.equals(PoolType.ONE_POOL))
      {

         mcp = new JBossManagedConnectionPool.OnePool(mcf, pp, noTxnSeperatePool, null, log);
View Full Code Here

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

    * @exception Exception Thrown if an error occurs
    */
   private BaseConnectionManager2 getCM(InternalManagedConnectionPool.PoolParams pp) throws Exception
   {
      ManagedConnectionFactory mcf = new TestManagedConnectionFactory();
      ManagedConnectionPool poolingStrategy = new JBossManagedConnectionPool.OnePool(mcf, pp, false, log);
      BaseConnectionManager2 cm = new NoTxConnectionManager(ccm, poolingStrategy);
      poolingStrategy.setConnectionListenerFactory(cm);
     
      if (pp.prefill)
      {
         BasePool bp = (BasePool)poolingStrategy;
         bp.prefill(null, null, false);
View Full Code Here

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

    * Shutdown the BaseConnectionManager2
    * @param cm The instance
    */
   private void shutdown(BaseConnectionManager2 cm)
   {
      ManagedConnectionPool pool = cm.getPoolingStrategy();
      pool.shutdown();
   }
View Full Code Here

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

      pp.prefill = false;

      BaseConnectionManager2 cm = getCM(pp);
      try
      {
         ManagedConnectionPool ps = cm.getPoolingStrategy();

         assertTrue("0: Initial check", ps.getConnectionCount() == 0);

         // Get a connection
         ConnectionListener cl = cm.getManagedConnection(null, null);
         assertTrue("1: Got a null connection!", cl.getManagedConnection() != null);
         assertTrue("1: One connection", ps.getConnectionCount() == 1);

         // Get another connection
         ConnectionListener cl2 = cm.getManagedConnection(null, null);
         assertTrue("2: Got a null connection!", cl2.getManagedConnection() != null);
         assertTrue("2: Two connections", ps.getConnectionCount() == 2);

         // Return first
         cm.returnManagedConnection(cl, true);
         assertTrue("3: One connection", ps.getConnectionCount() == 1);

         // Return second
         cm.returnManagedConnection(cl2, true);
         assertTrue("4: Zero connections", ps.getConnectionCount() == 0);
      }
      finally
      {
         shutdown(cm);
      }
View Full Code Here

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

   }

   private TxConnectionManager getCM(InternalManagedConnectionPool.PoolParams pp, boolean trackByTx) throws Exception
   {
      ManagedConnectionFactory mcf = new TestManagedConnectionFactory();
      ManagedConnectionPool poolingStrategy = new TestPool(mcf, pp, false, log);

      TxConnectionManager cm = new TxConnectionManager(ccm, poolingStrategy, tm);
      cm.setTrackConnectionByTx(trackByTx);

      poolingStrategy.setConnectionListenerFactory(cm);
      return cm;
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.