Package org.apache.activemq.store.amq

Examples of org.apache.activemq.store.amq.AMQPersistenceAdapter


   
    public PersistenceAdapter setPersistenceAdapter(BrokerService broker, PersistenceAdapterChoice choice) throws IOException {
        PersistenceAdapter adapter = null;
        switch (choice) {
        case AMQ:
            adapter = new AMQPersistenceAdapter();
            break;
        case JDBC:
            adapter = new JDBCPersistenceAdapter();
            break;
        case KahaDB:
View Full Code Here


    }

    protected BrokerService createBroker() throws Exception {
        BrokerService service = new BrokerService();
        service.setDeleteAllMessagesOnStartup(true);
        AMQPersistenceAdapter pa = new AMQPersistenceAdapter();
       
        JPAReferenceStoreAdapter rfa = new JPAReferenceStoreAdapter();
        Properties props = new Properties();
        props.setProperty("openjpa.ConnectionDriverName", "org.apache.derby.jdbc.EmbeddedDriver");
        props.setProperty("openjpa.ConnectionURL", "jdbc:derby:activemq-data/derby;create=true");
        props.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema");
//        props.setProperty("openjpa.Log", "DefaultLevel=WARN,SQL=TRACE");
        rfa.setEntityManagerProperties(props);
        pa.setReferenceStoreAdapter(rfa);       
       
        service.setPersistenceAdapter(pa);
        return service;
    }
View Full Code Here

        return service;
    }
   
    protected BrokerService createRestartedBroker() throws Exception {
        BrokerService service = new BrokerService();
        AMQPersistenceAdapter pa = new AMQPersistenceAdapter();
       
        JPAReferenceStoreAdapter rfa = new JPAReferenceStoreAdapter();
        Properties props = new Properties();
        props.setProperty("openjpa.ConnectionDriverName", "org.apache.derby.jdbc.EmbeddedDriver");
        props.setProperty("openjpa.ConnectionURL", "jdbc:derby:activemq-data/derby;create=true");
        props.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema");
//        props.setProperty("openjpa.Log", "DefaultLevel=WARN,SQL=TRACE");
        rfa.setEntityManagerProperties(props);
        pa.setReferenceStoreAdapter(rfa);       
       
        service.setPersistenceAdapter(pa);
        return service;
    }
View Full Code Here

public class QuickJPAStoreRecoveryBrokerTest extends RecoveryBrokerTest {

    protected BrokerService createBroker() throws Exception {
        BrokerService service = new BrokerService();
        service.setDeleteAllMessagesOnStartup(true);
        AMQPersistenceAdapter pa = new AMQPersistenceAdapter();
       
        JPAReferenceStoreAdapter rfa = new JPAReferenceStoreAdapter();
        Properties props = new Properties();
        props.setProperty("openjpa.ConnectionDriverName", "org.apache.derby.jdbc.EmbeddedDriver");
        props.setProperty("openjpa.ConnectionURL", "jdbc:derby:activemq-data/derby;create=true");
        props.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema");
//        props.setProperty("openjpa.Log", "DefaultLevel=WARN,SQL=TRACE");
        rfa.setEntityManagerProperties(props);
        pa.setReferenceStoreAdapter(rfa);       
       
        service.setPersistenceAdapter(pa);
        return service;
    }
View Full Code Here

        return service;
    }
   
    protected BrokerService createRestartedBroker() throws Exception {
        BrokerService service = new BrokerService();
        AMQPersistenceAdapter pa = new AMQPersistenceAdapter();

        JPAReferenceStoreAdapter rfa = new JPAReferenceStoreAdapter();
        Properties props = new Properties();
        props.setProperty("openjpa.ConnectionDriverName", "org.apache.derby.jdbc.EmbeddedDriver");
        props.setProperty("openjpa.ConnectionURL", "jdbc:derby:activemq-data/derby;create=true");
        props.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema");
//        props.setProperty("openjpa.Log", "DefaultLevel=WARN,SQL=TRACE");
        rfa.setEntityManagerProperties(props);
        pa.setReferenceStoreAdapter(rfa);       

        service.setPersistenceAdapter(pa);
        return service;
    }
View Full Code Here

            if (adapter instanceof KahaDBPersistenceAdapter) {
                KahaDBPersistenceAdapter kahaDB = (KahaDBPersistenceAdapter) adapter;
                maxJournalFileSize = kahaDB.getJournalMaxFileLength();
            } else if (adapter instanceof AMQPersistenceAdapter) {
                AMQPersistenceAdapter amqAdapter = (AMQPersistenceAdapter) adapter;
                maxJournalFileSize = amqAdapter.getMaxFileLength();
            }

            if (storeLimit < maxJournalFileSize) {
                LOG.error("Store limit is " + storeLimit / (1024 * 1024) +
                          " mb, whilst the max journal file size for the store is: " +
View Full Code Here

        producer.close();
    }

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

    private BrokerService createBroker(boolean deleteAllMessages, long expireMessagesPeriod) throws Exception {
        BrokerService broker = new BrokerService();
        broker.setBrokerName("localhost");
        broker.setDestinations(new ActiveMQDestination[]{destination});
        AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter();
        adaptor.setDirectory(new File("target/expiredtest-data/"));
        adaptor.setForceRecoverReferenceStore(true);
        broker.setPersistenceAdapter(adaptor);

        PolicyEntry defaultPolicy = new PolicyEntry();
        if (useVMCursor) {
            defaultPolicy.setPendingQueuePolicy(new VMPendingQueueMessageStoragePolicy());
View Full Code Here

   
    public PersistenceAdapter setPersistenceAdapter(BrokerService broker, PersistenceAdapterChoice choice) throws IOException {
        PersistenceAdapter adapter = null;
        switch (choice) {
        case AMQ:
            adapter = new AMQPersistenceAdapter();
            break;
        case JDBC:
            adapter = new JDBCPersistenceAdapter();
            break;
        case KahaDB:
View Full Code Here

            File amqData = new File("activemq-data/" + getName() + "-amq");
            if (deleteAllMessages)
                delete(amqData);

            broker.setPersistent(true);
            AMQPersistenceAdapter amq = new AMQPersistenceAdapter();
            amq.setDirectory(amqData);
            broker.setPersistenceAdapter(amq);
            break;

        case KAHA:
            File kahaData = new File("activemq-data/" + getName() + "-kaha");
View Full Code Here

TOP

Related Classes of org.apache.activemq.store.amq.AMQPersistenceAdapter

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.