Package org.apache.activemq.store.jdbc

Examples of org.apache.activemq.store.jdbc.JDBCPersistenceAdapter


        for (int i = 0; i < MAX_MESSAGES; i++) {
            dupChecker[i] = 0;
        }
        broker = new BrokerService();
        broker.setAdvisorySupport(false);
        broker.setPersistenceAdapter(new JDBCPersistenceAdapter());
        PolicyEntry policyEntry = new PolicyEntry();
        policyEntry.setMaxAuditDepth(2000);
        policyEntry.setMaxPageSize(150);
        policyEntry.setPrioritizedMessages(true);
        PolicyMap policyMap = new PolicyMap();
View Full Code Here


        switch (choice) {
        case AMQ:
            adapter = new AMQPersistenceAdapter();
            break;
        case JDBC:
            adapter = new JDBCPersistenceAdapter();
            break;
        case KahaDB:
            adapter = new KahaDBPersistenceAdapter();
            break;
        case MEM:
View Full Code Here

        switch (choice) {
        case AMQ:
            adapter = new AMQPersistenceAdapter();
            break;
        case JDBC:
            adapter = new JDBCPersistenceAdapter();
            break;
        case KahaDB:
            adapter = new KahaDBPersistenceAdapter();
            break;
        }
View Full Code Here

* @version $Revision: 1.1.1.1 $
*/
public class JDBCDurableSubscriptionTest extends DurableSubscriptionTestSupport {

    protected PersistenceAdapter createPersistenceAdapter() throws IOException {
        JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("derbyDb");
        dataSource.setCreateDatabase("create");
        jdbc.setDataSource(dataSource);
        jdbc.setCleanupPeriod(1000); // set up small cleanup period
        return jdbc;
    }
View Full Code Here

        PersistenceAdapter persistenceAdapter = brokerService.getPersistenceAdapter();
        assertNotNull(persistenceAdapter);
        assertTrue(persistenceAdapter instanceof JDBCPersistenceAdapter);

        JDBCPersistenceAdapter jpa = (JDBCPersistenceAdapter) persistenceAdapter;
        assertEquals("BROKER1.", jpa.getStatements().getTablePrefix());
       
    }
View Full Code Here

        producer.close();
    }

    public void initCombosForTestDelete() {
        addCombinationValues("persistenceAdapter", new Object[] {new MemoryPersistenceAdapter(), new AMQPersistenceAdapter(), new JDBCPersistenceAdapter()});
    }
View Full Code Here

            PersistenceAdapter persistenceAdapter = broker.getPersistenceAdapter();
            assertNotNull("persistenceAdapter is null", persistenceAdapter);

            assertTrue("persistenceAdapter should be an instance of JDBCPersistenceAdapter",
                    persistenceAdapter instanceof JDBCPersistenceAdapter);
            JDBCPersistenceAdapter jdbcPersistenceAdapter = (JDBCPersistenceAdapter)persistenceAdapter;

            assertSame(dataSource, jdbcPersistenceAdapter.getDataSource());
        } finally {
            stopBroker(broker);
            ActiveMQFactory.setThreadProperties(null);
        }
    }
View Full Code Here

            PersistenceAdapter persistenceAdapter = broker.getPersistenceAdapter();
            assertNotNull("persistenceAdapter is null", persistenceAdapter);

            assertTrue("persistenceAdapter should be an instance of JDBCPersistenceAdapter",
                    persistenceAdapter instanceof JDBCPersistenceAdapter);
            JDBCPersistenceAdapter jdbcPersistenceAdapter = (JDBCPersistenceAdapter)persistenceAdapter;

            assertSame(dataSource, jdbcPersistenceAdapter.getDataSource());
        } finally {
            stopBroker(broker);
            ActiveMQFactory.setThreadProperties(null);
        }
    }
View Full Code Here

        EmbeddedDataSource embeddedDataSource = (EmbeddedDataSource) DataSourceServiceSupport.createDataSource(IOHelper.getDefaultDataDirectory());
        embeddedDataSource.setCreateDatabase("create");

        //wire in a TestTransactionContext (wrapper to TransactionContext) that has an executeBatch()
        // method that can be configured to throw a SQL exception on demand
        JDBCPersistenceAdapter jdbc = new TestJDBCPersistenceAdapter();
        jdbc.setDataSource(embeddedDataSource);
        testTransactionContext = new TestTransactionContext(jdbc);

        jdbc.setLockKeepAlivePeriod(1000l);
        LeaseDatabaseLocker leaseDatabaseLocker = new LeaseDatabaseLocker();
        leaseDatabaseLocker.setLockAcquireSleepInterval(2000l);
        jdbc.setLocker(leaseDatabaseLocker);

        broker.setPersistenceAdapter(jdbc);

        broker.setIoExceptionHandler(new JDBCIOExceptionHandler());
View Full Code Here

    public PersistenceAdapter setPersistenceAdapter(BrokerService broker, PersistenceAdapterChoice choice) throws IOException {
        PersistenceAdapter adapter = null;
        switch (choice) {
            case JDBC:
                LOG.debug(">>>> setPersistenceAdapter to JDBC ");
                adapter = new JDBCPersistenceAdapter();
                break;
            case KahaDB:
                LOG.debug(">>>> setPersistenceAdapter to KahaDB ");
                adapter = new KahaDBPersistenceAdapter();
                break;
View Full Code Here

TOP

Related Classes of org.apache.activemq.store.jdbc.JDBCPersistenceAdapter

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.