Package org.jboss.resource.connectionmanager

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool


      pp.maxSize = 2;
      pp.blockingTimeout = 10000;
      pp.idleTimeout = 0;
      pp.prefill = false;
      pp.backgroundInterval = 2000;
      ManagedConnectionPool mcp = new JBossManagedConnectionPool.OnePool(mcf, pp, false, log);
      NoTxConnectionManager noTxn = new NoTxConnectionManager(null, mcp);
      mcp.setConnectionListenerFactory(noTxn);
     
      ConnectionListener cl = noTxn.getManagedConnection(null, null);
      noTxn.returnManagedConnection(cl, false);
     
      Thread.sleep(pp.backgroundInterval);
      assertTrue(mcp.getConnectionDestroyedCount() == 0);
     
   }
View Full Code Here


      pp.maxSize = 2;
      pp.blockingTimeout = 10000;
      pp.idleTimeout = 0;
      pp.prefill = false;
      pp.backgroundInterval = 2000;
      ManagedConnectionPool mcp = new JBossManagedConnectionPool.OnePool(mcf, pp, false, log);
      NoTxConnectionManager noTxn = new NoTxConnectionManager(null, mcp);
      mcp.setConnectionListenerFactory(noTxn);
     
      ConnectionListener cl = noTxn.getManagedConnection(null, null);
      noTxn.returnManagedConnection(cl, false);
     
      Thread.sleep(pp.backgroundInterval);
      assertTrue(mcp.getConnectionDestroyedCount() > 0);
     
   }
View Full Code Here

   public void testNonPreFillSupportingPoolPreFill() throws Exception{
     
      int minSize = 3;
      int maxSize = 5;
     
      ManagedConnectionPool mcp = getOnePoolPrefill(minSize, maxSize, true);
      BaseConnectionManager2 cm = getNoTxCM(mcp);     
      PreFillPoolSupport support = (PreFillPoolSupport)mcp;
      support.prefill(null, null, false);
     
      //Let pool fill
      Thread.sleep(5000);
     
      int currentSize = mcp.getConnectionCount();
      assertTrue(currentSize == minSize);
     
     
   }
View Full Code Here

   public void testNoPreFillSupportingPool() throws Exception{
  
      int minSize = 3;
      int maxSize = 5;
     
      ManagedConnectionPool mcp = getOnePoolPrefill(minSize, maxSize, false);
      BaseConnectionManager2 cm = getNoTxCM(mcp);     
      PreFillPoolSupport support = (PreFillPoolSupport)mcp;
      support.prefill(null, null, false);
     
      //Let pool fill
      Thread.sleep(5000);
     
      int currentSize = mcp.getConnectionCount();
      assertTrue(currentSize == 0);
      assertTrue(currentSize != minSize);
     
     
   }
View Full Code Here

   public void testPreFillSupportingPool() throws Exception{
  
      int minSize = 3;
      int maxSize = 5;
     
      ManagedConnectionPool mcp = getOnePoolPrefill(minSize, maxSize, true);
      BaseConnectionManager2 cm = getNoTxCM(mcp);     
      PreFillPoolSupport support = (PreFillPoolSupport)mcp;
      support.prefill(null, null, false);
     
      //Let pool fill
      Thread.sleep(5000);
     
      int currentSize = mcp.getConnectionCount();
      assertTrue(currentSize == minSize);
     
   }
View Full Code Here

      pp.maxSize = maxSize;
      pp.blockingTimeout = 10000;
      pp.idleTimeout = 0;
      pp.prefill = prefill;
      ManagedConnectionFactory mcf = new TestManagedConnectionFactory();
      ManagedConnectionPool poolingStrategy = new JBossManagedConnectionPool.OnePool(mcf, pp, false, log);
      return poolingStrategy;
     
   }
View Full Code Here

   }

   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);

      return cm;
   }
View Full Code Here

   }
  
   private BaseConnectionManager2 getCriCM(InternalManagedConnectionPool.PoolParams pp){
     
      ManagedConnectionFactory mcf = new TestManagedConnectionFactory();
      ManagedConnectionPool poolingStrategy = new JBossManagedConnectionPool.PoolByCri(mcf, pp, true, null, log);
      BaseConnectionManager2 cm = new NoTxConnectionManager(ccm, poolingStrategy);
      poolingStrategy.setConnectionListenerFactory(cm);
      return cm;
   }
View Full Code Here

    * @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

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

TOP

Related Classes of org.jboss.resource.connectionmanager.ManagedConnectionPool

Copyright © 2018 www.massapicom. 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.