Examples of ManagedConnectionPool


Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

   }

   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

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

   }
  
   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

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

      pp.maxSize = 2;
      pp.blockingTimeout = 10000;
      pp.idleTimeout = 0;
      pp.prefill = true;
      pp.backgroundInterval = 1 * 1000 * 30;
      ManagedConnectionPool mcp = new JBossManagedConnectionPool.OnePool(mcf, pp, false, log);
      NoTxConnectionManager noTxn = new NoTxConnectionManager(null, mcp);
      mcp.setConnectionListenerFactory(noTxn);

      ((PreFillPoolSupport)mcp).prefill();
     
      //Let prefiller run
      Thread.sleep(5000);
     
      ConnectionListener cl = noTxn.getManagedConnection(null, null);
      noTxn.returnManagedConnection(cl, false);
     
      assertTrue(mcp.getConnectionDestroyedCount() == 0);

     
   }
View Full Code Here

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

      pp.maxSize = 2;
      pp.blockingTimeout = 10000;
      pp.idleTimeout = 0;
      pp.prefill = true;
      pp.backgroundInterval = 1 * 1000 * 30;
      ManagedConnectionPool mcp = new JBossManagedConnectionPool.OnePool(mcf, pp, false, log);
      NoTxConnectionManager noTxn = new NoTxConnectionManager(null, mcp);
      mcp.setConnectionListenerFactory(noTxn);

      ((PreFillPoolSupport)mcp).prefill();
     
      //Let prefiller run
      Thread.sleep(5000);
     
      ConnectionListener cl = noTxn.getManagedConnection(null, null);
      noTxn.returnManagedConnection(cl, false);
     
      assertTrue(mcp.getConnectionDestroyedCount() > 0);
     
   }
View Full Code Here

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

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

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

   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

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

   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

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

   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

Examples of org.jboss.resource.connectionmanager.ManagedConnectionPool

      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
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.