Package org.apache.activemq.store.jdbc

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


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


    @Override
    protected BrokerService createBroker() throws Exception {
        BrokerService answer = super.createBroker();
        answer.setKeepDurableSubsActive(keepDurableSubsActive);
        answer.setPersistenceAdapter(new JDBCPersistenceAdapter());
        return answer;
    }
View Full Code Here

                } catch (NamingException e) {
                    throw new IllegalArgumentException("Unknown datasource " + resouceId);
                }
            }

            JDBCPersistenceAdapter persistenceAdapter = new JDBCPersistenceAdapter();
            persistenceAdapter.setDataSource(dataSource);
            broker.setPersistenceAdapter(persistenceAdapter);
        } else {
            MemoryPersistenceAdapter persistenceAdapter = new MemoryPersistenceAdapter();
            broker.setPersistenceAdapter(persistenceAdapter);
        }
View Full Code Here

        master = new BrokerService();
        master.addConnector(MASTER_URL);
        master.setUseJmx(false);
        master.setPersistent(true);
        master.setDeleteAllMessagesOnStartup(true);
        JDBCPersistenceAdapter persistenceAdapter = new JDBCPersistenceAdapter();
        persistenceAdapter.setDataSource(getExistingDataSource());
        persistenceAdapter.setLockKeepAlivePeriod(500);
        persistenceAdapter.setLockAcquireSleepInterval(500);
        master.setPersistenceAdapter(persistenceAdapter);
        master.start();
    }
View Full Code Here

                    broker.addConnector(SLAVE_URL);
                    // no need for broker.setMasterConnectorURI(masterConnectorURI)
                    // as the db lock provides the slave/master initialisation
                    broker.setUseJmx(false);
                    broker.setPersistent(true);
                    JDBCPersistenceAdapter persistenceAdapter = new JDBCPersistenceAdapter();
                    persistenceAdapter.setDataSource(getExistingDataSource());
                    persistenceAdapter.setCreateTablesOnStartup(false);
                    broker.setPersistenceAdapter(persistenceAdapter);
                    broker.start();
                    slave.set(broker);
                    slaveStarted.countDown();
                } catch (Exception e) {
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);
            OpenEjbBrokerFactory.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);
            OpenEjbBrokerFactory.setThreadProperties(null);
        }
    }
View Full Code Here

        producer.close();
    }

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

                        } catch (NamingException e) {
                            throw new IllegalArgumentException("Unknown datasource " + resouceId);
                        }
                    }

                    JDBCPersistenceAdapter persistenceAdapter = new JDBCPersistenceAdapter();

                    if (properties.containsKey("usedatabaselock")) {
                        //This must be false for hsqldb
                        persistenceAdapter.setUseDatabaseLock(Boolean.parseBoolean(properties.getProperty("usedatabaselock", "true")));
                    }

                    persistenceAdapter.setDataSource(dataSource);
                    broker.setPersistenceAdapter(persistenceAdapter);
                } else {
                    MemoryPersistenceAdapter persistenceAdapter = new MemoryPersistenceAdapter();
                    broker.setPersistenceAdapter(persistenceAdapter);
                }
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

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.