Package org.apache.activemq.store

Examples of org.apache.activemq.store.PersistenceAdapter


        }
    }

    @Test
    public void TestOptimizedDispatchCME() throws Exception {
        final PersistenceAdapter persistenceAdapter = broker.getPersistenceAdapter();
        final MessageStore queueMessageStore =
            persistenceAdapter.createQueueMessageStore(destination);
        final ConnectionContext contextNotInTx = new ConnectionContext();
        contextNotInTx.setConnection(new Connection() {

            @Override
            public void stop() throws Exception {
View Full Code Here


         kahaDBPersistenceAdapter.setRewriteOnRedelivery(true);
    }

    @Override
    public PersistenceAdapter setDefaultPersistenceAdapter(BrokerService broker) throws IOException {
        PersistenceAdapter persistenceAdapter = super.setDefaultPersistenceAdapter(broker);
        configurePersistenceAdapter(broker);
        return persistenceAdapter;
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public void testFailoverConnectionSendReplyLost() throws Exception {

        broker = createBroker(true);
        PersistenceAdapter store = setDefaultPersistenceAdapter(broker);
        if (store instanceof KahaDBPersistenceAdapter) {
            // duplicate checker not updated on canceled tasks, even it
            // it was, recovery of the audit would fail as the message is
            // not recorded in the store and the audit may not be up to date.
            // So if duplicate messages are a absolute no no after restarts,
View Full Code Here

            if (!isPersistent()) {
                return null;
            }

            try {
                PersistenceAdapter pa = getPersistenceAdapter();
                if( pa!=null && pa instanceof PListStore) {
                    return (PListStore) pa;
                }
            } catch (IOException e) {
                throw new RuntimeException(e);
View Full Code Here

                      " mb) is more than the maximum available for the JVM: " +
                      jvmLimit / (1024 * 1024) + " mb");
        }

        if (getPersistenceAdapter() != null) {
            PersistenceAdapter adapter = getPersistenceAdapter();
            File dir = adapter.getDirectory();

            if (dir != null) {
                String dirPath = dir.getAbsolutePath();
                if (!dir.isAbsolute()) {
                    dir = new File(dirPath);
View Full Code Here

            if (fac != null) {
                return fac.createPersistenceAdapter();
            } else {
                try {
                    String clazz = "org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter";
                    PersistenceAdapter adaptor = (PersistenceAdapter)getClass().getClassLoader().loadClass(clazz).newInstance();
                    File dir = new File(getBrokerDataDirectory(),"KahaDB");
                    adaptor.setDirectory(dir);
                    return adaptor;
                } catch (Throwable e) {
                    throw IOExceptionSupport.create(e);
                }
            }
View Full Code Here

        return 0;
    }

    public void setBrokerService(BrokerService brokerService) {
        this.brokerService = brokerService;
        PersistenceAdapter pa = getLongTermPersistence();
        if( pa instanceof BrokerServiceAware ) {
            ((BrokerServiceAware)pa).setBrokerService(brokerService);
        }
    }
View Full Code Here

    protected BrokerService brokerService;

    public void testConfiguredCorrectly() throws Exception {

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

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

        BrokerService broker;
        broker = createBroker(new FileSystemResource(CONF_ROOT + "jdbc-example.xml"));
        try {
            assertEquals("Broker Config Error (brokerName)", "brokerJdbcConfigTest", broker.getBrokerName());

            PersistenceAdapter adapter = broker.getPersistenceAdapter();

            assertTrue("Should have created a jdbc persistence adapter", adapter instanceof JDBCPersistenceAdapter);
            assertEquals("JDBC Adapter Config Error (cleanupPeriod)", 60000, ((JDBCPersistenceAdapter) adapter).getCleanupPeriod());
            assertTrue("Should have created an EmbeddedDataSource", ((JDBCPersistenceAdapter) adapter).getDataSource() instanceof EmbeddedDataSource);
            assertTrue("Should have created a DefaultWireFormat", ((JDBCPersistenceAdapter) adapter).getWireFormat() instanceof ObjectStreamWireFormat);
View Full Code Here

        BrokerService broker;
        broker = createBroker(new FileSystemResource(CONF_ROOT + "journaledjdbc-example.xml"));
        try {
            assertEquals("Broker Config Error (brokerName)", "brokerJournaledJDBCConfigTest", broker.getBrokerName());

            PersistenceAdapter adapter = broker.getPersistenceAdapter();

            assertTrue("Should have created a journal persistence adapter", adapter instanceof JournalPersistenceAdapter);
            assertTrue("Should have created a derby directory at " + derbyFile.getAbsolutePath(), derbyFile.exists());
            assertTrue("Should have created a journal directory at " + journalFile.getAbsolutePath(), journalFile.exists());
View Full Code Here

TOP

Related Classes of org.apache.activemq.store.PersistenceAdapter

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.