Package javax.resource.spi

Examples of javax.resource.spi.ConnectionManager


        }
    }

    public void testCreateConnectionFactoryCM() throws Exception {
        ManagedConnectionFactoryImplTester mcit = new ManagedConnectionFactoryImplTester();
        ConnectionManager connManager = EasyMock.createMock(ConnectionManager.class);
        assertTrue("We get a CF back",
                   mcit.createConnectionFactory(connManager) instanceof CXFConnectionFactory);
        assertEquals("init was called once", 1, mcit.initCalledCount);
    }
View Full Code Here


            }

        } else if (object instanceof ConnectorReference) {
            final ConnectorReference cr = (ConnectorReference) object;
            try {
                final ConnectionManager cm = cr.getConnectionManager();
                if (cm != null && cm instanceof AbstractConnectionManager) {
                    ((AbstractConnectionManager) cm).doStop();
                }
            } catch (final Exception e) {
                logger.debug("Not processing resource on destroy: " + className, e);
View Full Code Here

            connectionManagerRecipe.setProperty("classLoader", classLoader);

            logger.getChildLogger("service").info("createResource.createConnectionManager", serviceInfo.id, service.getClass().getName());

            // create the connection manager
            final ConnectionManager connectionManager = (ConnectionManager) connectionManagerRecipe.create();
            if (connectionManager == null) {
                throw new OpenEJBRuntimeException(messages.format("assembler.invalidConnectionManager", serviceInfo.id));
            }

            final Map<String, Object> unsetA = serviceRecipe.getUnsetProperties();
View Full Code Here

    }

    @Test
    public void testCreateConnectionFactoryCM() throws Exception {
        ManagedConnectionFactoryImplTester mcit = new ManagedConnectionFactoryImplTester();
        ConnectionManager connManager = EasyMock.createMock(ConnectionManager.class);
        assertTrue("We get a CF back",
                   mcit.createConnectionFactory(connManager) instanceof CXFConnectionFactory);
        assertEquals("init was called once", 1, mcit.initCalledCount);
    }
View Full Code Here

        // Create an embedded database for testing tx results when commit / rollback
        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);
View Full Code Here

        // Create an embedded database for testing tx results when commit / rollback
        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);
View Full Code Here

        // Create an embedded database for testing tx results when commit / rollback
        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);
       
        connection = dataSource.getConnection();
       
View Full Code Here

            }

        } else if (object instanceof ConnectorReference) {
            final ConnectorReference cr = (ConnectorReference) object;
            try {
                final ConnectionManager cm = cr.getConnectionManager();
                if (cm != null && cm instanceof AbstractConnectionManager) {
                    ((AbstractConnectionManager) cm).doStop();
                }
            } catch (final Exception e) {
                logger.debug("Not processing resource on destroy: " + className, e);
View Full Code Here

            connectionManagerRecipe.setProperty("classLoader", classLoader);

            logger.getChildLogger("service").info("createResource.createConnectionManager", serviceInfo.id, service.getClass().getName());

            // create the connection manager
            final ConnectionManager connectionManager = (ConnectionManager) connectionManagerRecipe.create();
            if (connectionManager == null) {
                throw new OpenEJBRuntimeException(messages.format("assembler.invalidConnectionManager", serviceInfo.id));
            }

            final Map<String, Object> unsetA = serviceRecipe.getUnsetProperties();
View Full Code Here

  }

  @Test
  public void testCreatesManagedConnectionFactoryIfAConnectionManagerHasBeenConfigured() throws Exception {
    ManagedConnectionFactory managedConnectionFactory = mock(ManagedConnectionFactory.class);
    ConnectionManager connectionManager = mock(ConnectionManager.class);
    LocalConnectionFactoryBean factory = new LocalConnectionFactoryBean();
    factory.setManagedConnectionFactory(managedConnectionFactory);
    factory.setConnectionManager(connectionManager);
    factory.afterPropertiesSet();
    verify(managedConnectionFactory).createConnectionFactory(connectionManager);
View Full Code Here

TOP

Related Classes of javax.resource.spi.ConnectionManager

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.