Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source.
   * Copyright 2006, Red Hat Middleware LLC, and individual contributors
   * as indicated by the @author tags. See the copyright.txt file in the
   * distribution for a full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
 package org.jboss.resource.connectionmanager;
 
 
The NoTxConnectionManager is an simple extension class of the BaseConnectionManager2 for use with jca adapters with no transaction support. It includes functionality to obtain managed connections from a ManagedConnectionPool mbean, find the Subject from a SubjectSecurityDomain, and interact with the CachedConnectionManager for connections held over transaction and method boundaries. Important mbean references are to a ManagedConnectionPool supplier (typically a JBossManagedConnectionPool), and a RARDeployment representing the ManagedConnectionFactory.

Author(s):
David Jencks
Adrian Brock
Version:
$Revision: 77961 $
 
 public class NoTxConnectionManager  extends BaseConnectionManager2
 {
    public NoTxConnectionManager()
    {
    }

   
Creates a new NoTxConnectionManager instance. for TESTING ONLY! not a managed operation.

Parameters:
ccm a CachedConnectionManager value
poolingStrategy a ManagedConnectionPool value
 
                                 ManagedConnectionPool poolingStrategy)
    {
       super(ccmpoolingStrategy);
    }
 
    {
       ConnectionListener cli = new NoTxConnectionEventListener(mccontext);
       mc.addConnectionEventListener(cli);
       return cli;
    }
 
    {
       //if there are no more handles, we can return to pool.
       if (cl.isManagedConnectionFree())
          returnManagedConnection(clfalse);
    }
 
    {
       private NoTxConnectionEventListener(final ManagedConnection mcfinal ManagedConnectionPool mcpfinal Object contextLogger log)
       {
          super(mcmcpcontextlog);
       }
 
       public void connectionClosed(ConnectionEvent ce)
       {
          try
          {
          }
          catch (Throwable t)
          {
             .info("Throwable from unregisterConnection"t);
          }
 
          unregisterAssociation(thisce.getConnectionHandle());
          if (isManagedConnectionFree())
          {
            returnManagedConnection(thisfalse);
          }
      }
      public void localTransactionStarted(ConnectionEvent ce)
      {
         //nothing to do.
      }
      public void localTransactionCommitted(ConnectionEvent ce)
      {
         //nothing to do.
      }
      public void localTransactionRolledback(ConnectionEvent ce)
      {
         //nothing to do.
      }
   }
New to GrepCode? Check out our FAQ X