Package org.jboss.resource.connectionmanager

Examples of org.jboss.resource.connectionmanager.BaseConnectionManager2$GetCredentialAction


  
   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


      InternalManagedConnectionPool.PoolParams pp = new InternalManagedConnectionPool.PoolParams();
      pp.minSize = 5;
      pp.maxSize = 10;
      pp.blockingTimeout = 1000;
      pp.idleTimeout = 500;
      BaseConnectionManager2 cm = getCriCM(pp);
 
      cm.getManagedConnection(null, null);
      StatisticsReporter reporter = (StatisticsReporter) cm.getPoolingStrategy();
      Object stats = reporter.listStatistics();

      Thread.sleep(10000);
      stats = reporter.listStatistics();
     
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);
     
      if (pp.prefill)
      {
         BasePool bp = (BasePool)poolingStrategy;
View Full Code Here

      pp.minSize = 0;
      pp.maxSize = 5;
      pp.blockingTimeout = 100;
      pp.idleTimeout = 500;

      BaseConnectionManager2 cm = getCM(pp);
      try
      {
         // Get a connection
         ConnectionListener cl = cm.getManagedConnection(null, null);
         assertTrue("1: Got a null connection!", cl.getManagedConnection() != null);
         assertTrue("1: InternalManagedConnectionPool", cl.getContext() instanceof InternalManagedConnectionPool);
         InternalManagedConnectionPool imcp = (InternalManagedConnectionPool)cl.getContext();
         cm.returnManagedConnection(cl, true);

         // Shutdown the pool in order to trigger the RetryableResourceException
         imcp.shutdown();

         // Get a connection - new internal managed pool is created
         cl = cm.getManagedConnection(null, null);
         assertTrue("2: Got a null connection!", cl.getManagedConnection() != null);
         cm.returnManagedConnection(cl, true);
      }
      finally
      {
         shutdown(cm);
      }
View Full Code Here

  
   private BaseConnectionManager2 getNoTxCM(ManagedConnectionPool poolingStrategy) throws Exception
   {
      MBeanServer server = MBeanServerLocator.locateJBoss();
      CachedConnectionManager ccm = (CachedConnectionManager) server.getAttribute(CachedConnectionManagerMBean.OBJECT_NAME, "Instance");
      BaseConnectionManager2 cm = new NoTxConnectionManager(ccm, poolingStrategy);
      poolingStrategy.setConnectionListenerFactory(cm);
      return cm;
   }
View Full Code Here

  
   private BaseConnectionManager2 getTxCM(ManagedConnectionPool poolingStrategy) throws Exception
   {
      MBeanServer server = MBeanServerLocator.locateJBoss();
      CachedConnectionManager ccm = (CachedConnectionManager) server.getAttribute(CachedConnectionManagerMBean.OBJECT_NAME, "Instance");
      BaseConnectionManager2 cm = new TxConnectionManager(ccm, poolingStrategy, tm);
      poolingStrategy.setConnectionListenerFactory(cm);
      return cm;
   }
View Full Code Here

   }
   public void testOnePoolNoTx() throws Exception
   {
      ManagedConnectionPool mcp = getOnePool(1);
      BaseConnectionManager2 cm = getNoTxCM(mcp);
      try
      {
         doOnePool(cm);
      }
      finally
View Full Code Here

   }

   public void testOnePoolTx() throws Exception
   {
      ManagedConnectionPool mcp = getOnePool(1);
      BaseConnectionManager2 cm = getTxCM(mcp);
      try
      {
         // Test before a transaction
         doOnePool(cm);
         tm.begin();
View Full Code Here

   }

   public void testOnePoolTxTrack() throws Exception
   {
      ManagedConnectionPool mcp = getOnePool(1);
      BaseConnectionManager2 cm = getTxTrackCM(mcp);
      try
      {
         // Test before a transaction
         doOnePool(cm);
         tm.begin();
View Full Code Here

   }

   public void testTrackConnectionByTx() throws Exception
   {
      ManagedConnectionPool mcp = getOnePool(2);
      BaseConnectionManager2 cm = getTxTrackCM(mcp);
      try
      {
         tm.begin();
         TestConnection c1 = allocate(cm, cri1);
         TestManagedConnection mc1 = c1.getMC();
View Full Code Here

TOP

Related Classes of org.jboss.resource.connectionmanager.BaseConnectionManager2$GetCredentialAction

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.