Package org.jboss.jca.core.connectionmanager.pool.mcp

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


      log.debug(poolName + ": shutdown");

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

      mcpPools.clear();
   }
View Full Code Here

         {
            separateNoTx = clf.isTransactional();
         }

         Object key = getKey(subject, cri, separateNoTx);
         ManagedConnectionPool mcp = getManagedConnectionPool(key, subject, cri);

         if (!mcp.isFull())
         {
            cl = mcp.getConnection(subject, cri);
            result = true;
         }
      }
      catch (Throwable ignored)
      {
View Full Code Here

            if (!isInterleaving())
            {
               cl.setTrackByTx(true);

               ManagedConnectionPool mcp = (ManagedConnectionPool)cl.getContext();
               Transaction tx = transactionManager.getTransaction();

               // The lock may need to be initialized if we are in the first lazy enlistment
               Lock lock = getLock();
View Full Code Here

      Iterator<SubPoolContext> itSubPoolContexts = subPools.values().iterator();
      SubPoolContext subPoolContext = null;
      while (itSubPoolContexts.hasNext())
      {
         subPoolContext = itSubPoolContexts.next();
         ManagedConnectionPool mcp = subPoolContext.getSubPool();

         mcp.flush(kill);

         if (mcp.isEmpty())
            clearSubPools.add(subPoolContext);
      }

      if (clearSubPools.size() > 0)
      {
         for (SubPoolContext spc : clearSubPools)
         {
            ManagedConnectionPool mcp = spc.getSubPool();
            mcp.shutdown();

            subPools.values().remove(spc);
         }
      }
   }
View Full Code Here

      //Find sub-pool related with key
      SubPoolContext subPoolContext = getSubPool(key, subject, cri);

      //Sub-pool internal managed connection pool
      ManagedConnectionPool imcp = subPoolContext.getSubPool();

      // Are we doing track by transaction?
      TransactionLocal trackByTx = subPoolContext.getTrackByTx()// TODO - Use TSR

      if (trackByTransaction == null || trackByTx == null)
View Full Code Here

   private ConnectionListener getSimpleConnection(final Subject subject, final ConnectionRequestInfo cri,
         final SubPoolContext subPoolContext)
      throws ResourceException
   {
      ConnectionListener cl = null;
      ManagedConnectionPool imcp = null;

      try
      {
         //Find internal managed pool
         imcp = subPoolContext.getSubPool();

         //Get connection from imcp
         cl = imcp.getConnection(subject, cri);

         log.tracef("Got connection from pool: %s", cl);

         return cl;

      }
      catch (ResourceException re)
      {
         if (re instanceof RetryableException)
         {
            if (log.isDebugEnabled())
               log.debug("Got a RetryableException - trying to reinitialize the pool");

            // The IMCP is down - retry
            imcp = subPoolContext.getSubPool();

            // Make sure that IMCP is running
            if (!imcp.isRunning())
               imcp.reenable();

            //Getting connection from pool
            cl = imcp.getConnection(subject, cri);

            log.tracef("Got connection from pool (retried): %s", cl);

            return cl;
         }
View Full Code Here

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

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

            cl.enlist();

            if (!isInterleaving())
            {
               cl.setTrackByTx(true);
               ManagedConnectionPool mcp = (ManagedConnectionPool)cl.getContext();
               SubPoolContext subPool = mcp.getSubPool();
               TransactionLocal trackByTx = subPool.getTrackByTx();
               try
               {
                  trackByTx.lock();
               }
View Full Code Here

   protected ManagedConnectionPool getManagedConnectionPool(Object key, Subject subject, ConnectionRequestInfo cri)
      throws ResourceException
   {
      try
      {
         ManagedConnectionPool mcp = mcpPools.get(key);
         if (mcp == null)
         {
            ManagedConnectionPoolFactory mcpf = new ManagedConnectionPoolFactory();
            ManagedConnectionPool newMcp = mcpf.create(mcf, clf, subject, cri, poolConfiguration, this);

            mcp = mcpPools.putIfAbsent(key, newMcp);
            if (mcp == null)
            {
               mcp = newMcp;
View Full Code Here

TOP

Related Classes of org.jboss.jca.core.connectionmanager.pool.mcp.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.