Examples of ManagedConnectionFactory


Examples of javax.resource.spi.ManagedConnectionFactory

         Object obj = connections.next();

         if (obj instanceof HornetQRAManagedConnection)
         {
            HornetQRAManagedConnection mc = (HornetQRAManagedConnection)obj;
            ManagedConnectionFactory mcf = mc.getManagedConnectionFactory();

            if ((mc.getUserName() == null || mc.getUserName() != null && mc.getUserName()
                                                                           .equals(credential.getUserName())) && mcf.equals(this))
            {
               if (cri.equals(mc.getCRI()))
               {
                  if (HornetQRAManagedConnectionFactory.trace)
                  {
View Full Code Here

Examples of javax.resource.spi.ManagedConnectionFactory

        ConnectionManagerFactoryBean factory = new ConnectionManagerFactoryBean();
        factory.setTransactionManager(tm);
        factory.setTransaction("xa");
        factory.afterPropertiesSet();
        ConnectionManager cm = (ConnectionManager) factory.getObject();
        ManagedConnectionFactory mcf = new DerbyDataSourceMCF("target/testdb");
        dataSource = (DataSource) mcf.createConnectionFactory(cm);

        JdbcStoreFactory storeFactory = new JdbcStoreFactory();
        storeFactory.setDataSource(dataSource);
        storeFactory.setTransactional(true);
        store = storeFactory.open("store");
View Full Code Here

Examples of javax.resource.spi.ManagedConnectionFactory

        ConnectionManagerFactoryBean cmFactory = new ConnectionManagerFactoryBean();
        cmFactory.setTransactionManager(tm);
        cmFactory.setTransaction("xa");
        cmFactory.afterPropertiesSet();
        ConnectionManager cm = (ConnectionManager) cmFactory.getObject();
        ManagedConnectionFactory mcf = new DerbyDataSourceMCF("target/testdb");
        dataSource = (DataSource) mcf.createConnectionFactory(cm);
        JdbcStoreFactory f = new JdbcStoreFactory();
        f.setTransactional(true);
        f.setDataSource(dataSource);
        factory = f;
    }
View Full Code Here

Examples of javax.resource.spi.ManagedConnectionFactory

    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

Examples of javax.resource.spi.ManagedConnectionFactory

    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

Examples of javax.resource.spi.ManagedConnectionFactory

        String dsName = dataSourceDescription.getName();
        String dsClass = dataSourceDescription.getClassName();
       
        TransactionSupport transactionSupport;
        PoolingSupport pooling;
        ManagedConnectionFactory mcf;
      
        Object instance = createDataSource();
       
        if (instance instanceof XADataSource) {
            mcf = new XADataSourceMCF((XADataSource) instance);
View Full Code Here

Examples of javax.resource.spi.ManagedConnectionFactory

            Map<String, Object> unset = serviceRecipe.getUnsetProperties();
            unset.remove("threadPoolSize");
            logUnusedProperties(unset, serviceInfo);
        } else if (service instanceof ManagedConnectionFactory) {
            ManagedConnectionFactory managedConnectionFactory = (ManagedConnectionFactory) service;

            // connection manager is constructed via a recipe so we automatically expose all cmf properties
            ObjectRecipe connectionManagerRecipe = new ObjectRecipe(GeronimoConnectionManagerFactory.class, "create");
            connectionManagerRecipe.allow(Option.CASE_INSENSITIVE_PROPERTIES);
            connectionManagerRecipe.allow(Option.IGNORE_MISSING_PROPERTIES);
View Full Code Here

Examples of javax.resource.spi.ManagedConnectionFactory

                resourceAdapter.start(bootstrapContext);
            } catch (ResourceAdapterInternalException e) {
                throw new OpenEJBException(e);
            }           
        } else if (service instanceof ManagedConnectionFactory) {
            ManagedConnectionFactory managedConnectionFactory = (ManagedConnectionFactory) service;

            // get the connection manager
            ConnectionManager connectionManager;
            if ((ManagedConnectionFactory) service instanceof JdbcManagedConnectionFactory) {
                connectionManager = SystemInstance.get().getComponent(ConnectionManager.class);
View Full Code Here

Examples of javax.resource.spi.ManagedConnectionFactory

        GeronimoConnectionManagerFactory connectionManagerFactory = new GeronimoConnectionManagerFactory();
        connectionManagerFactory.setTransactionManager(transactionManager);
        ConnectionManager connectionManager = connectionManagerFactory.create();

        ManagedConnectionFactory managedConnectionFactory = new JdbcManagedConnectionFactory("org.hsqldb.jdbcDriver",
                "jdbc:hsqldb:mem",
                "sa",
                "",
                true);

        DataSource dataSource = (DataSource) managedConnectionFactory.createConnectionFactory(connectionManager);

        // todo... conections are not being released
        // for (int i = 0; i < 100; i++) {
        //     System.out.println("Connection " + i);
            verifyDatasource(dataSource);
View Full Code Here

Examples of javax.resource.spi.ManagedConnectionFactory

public class SharedLocalConnectionManagerTest extends TestCase {
    public void test() throws Exception {
        TransactionManager transactionManager = new GeronimoTransactionManager();
        ConnectionManager connectionManager = new SharedLocalConnectionManager(transactionManager);

        ManagedConnectionFactory managedConnectionFactory = new JdbcManagedConnectionFactory("org.hsqldb.jdbcDriver",
                "jdbc:hsqldb:mem",
                "sa",
                "",
                true);

        DataSource dataSource = (DataSource) managedConnectionFactory.createConnectionFactory(connectionManager);

        for (int i = 0; i < 100; i++) {
            verifyDatasource(dataSource);
        }
    }
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.