Package javax.resource.spi

Examples of javax.resource.spi.ManagedConnectionFactory


         if (obj instanceof BlasterManagedConnection) {
            // This is one from the pool
            BlasterManagedConnection mc = (BlasterManagedConnection) obj;
               
            // Check if we even created this on
            ManagedConnectionFactory mcf =
               mc.getManagedConnectionFactory();
               
            // Only admit a connection if it has the same username as our
            // asked for creds
            if (mc.getUserName().equals(bc.name) &&
                mcf.equals(this)) {
               return mc;
            }
         }
      }
      return null;
View Full Code Here


      poolParams.backgroundInterval = backgroundValidationInterval;
   }

   protected void startService() throws Exception
   {
      ManagedConnectionFactory mcf = null;
     
      if(managedConnectionFactoryName == null)
      {
         throw new org.jboss.deployers.spi.DeploymentException("ManagedConnectionFactory is not set.");         
     
View Full Code Here

   public static final String MANAGED_CONNECTION_FACTORY = "MANAGED_CONNECTION_FACTORY";
  
   public Object invoke(Invocation invocation) throws Throwable
   {
      ConnectionManager cm = (ConnectionManager) invocation.getMetaData(CONNECTION_FACTORY, CONNECTION_MANAGER);
      ManagedConnectionFactory mcf = (ManagedConnectionFactory) invocation.getMetaData(CONNECTION_MANAGER, MANAGED_CONNECTION_FACTORY);
     
      return cm.allocateConnection(mcf, null);
   }
View Full Code Here

public class DataSourceTestCase extends AbstractProxyTest
{
   public void testConnectionManager() throws Exception
   {
      ConnectionManager cm = new TestConnectionManager();
      ManagedConnectionFactory mcf = new TestManagedConnectionFactory();
      SimpleMetaData metadata = new SimpleMetaData();
     
      metadata.addMetaData(ConnectionFactoryInterceptor.CONNECTION_FACTORY, ConnectionFactoryInterceptor.CONNECTION_MANAGER, cm);
      metadata.addMetaData(ConnectionFactoryInterceptor.CONNECTION_MANAGER, ConnectionFactoryInterceptor.MANAGED_CONNECTION_FACTORY, mcf);
      DataSource ds = (DataSource) assertCreateHollowProxy(new Class[] { DataSource.class }, metadata, DataSource.class);
View Full Code Here

    * @return BaseConnectionManager2 instance
    * @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)
View Full Code Here

      super.tearDown();
   }

   private TxConnectionManager getCM(InternalManagedConnectionPool.PoolParams pp, boolean trackByTx) throws Exception
   {
      ManagedConnectionFactory mcf = new TestManagedConnectionFactory();
      ManagedConnectionPool poolingStrategy = new TestPool(mcf, pp, false, log);

      TxConnectionManager cm = new TxConnectionManager(ccm, poolingStrategy, tm);
      cm.setTrackConnectionByTx(trackByTx);
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

      return cm;
   }
  
   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

    _connectionPool.setShareable(true);
    _connectionPool.setXATransaction(_poolImpl.isXATransaction());
    _connectionPool.setLocalTransaction(_poolImpl.isLocalTransaction());

    ManagedConnectionFactory mcf = _poolImpl.getManagedConnectionFactory();
   
   
    _dataSource = (DataSource) _connectionPool.init(mcf);
    _connectionPool.start();
View Full Code Here

    private static Map<String, Object> getOptions(Map<String, Object> options, ManagedConnectionFactoryWrapper managedConnectionFactoryWrapper) {
        if (options == null) {
            options = new HashMap<String, Object>();
        }
        ManagedConnectionFactory managedConnectionFactory = managedConnectionFactoryWrapper.$getManagedConnectionFactory();
        options.put(MANAGED_CONNECTION_FACTORY_OPTION, managedConnectionFactory);
        return options;
    }
View Full Code Here

TOP

Related Classes of javax.resource.spi.ManagedConnectionFactory

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.