Package org.apache.activemq.store.amq

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


            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


        master.addConnector(brokerUrl);
        master.start();
    }
   
    private void configureSharedPersistenceAdapter(BrokerService broker) throws Exception {
       AMQPersistenceAdapter adapter = new AMQPersistenceAdapter();
       adapter.setDirectory(new File("shared"));
       broker.setPersistenceAdapter(adapter);
    }
View Full Code Here

    }

  private BrokerService createBroker(boolean deleteAllMessages, long expireMessagesPeriod) throws Exception {
      BrokerService broker = new BrokerService();
        broker.setBrokerName("localhost");
        AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter();
        adaptor.setDirectory(new File("data/"));
        adaptor.setForceRecoverReferenceStore(true);
        broker.setPersistenceAdapter(adaptor);
       
        PolicyEntry defaultPolicy = new PolicyEntry();
        if (useVMCursor) {
            defaultPolicy.setPendingQueuePolicy(new VMPendingQueueMessageStoragePolicy());
View Full Code Here

public class AMQStoreDurableSubscriptionTest extends DurableSubscriptionTestSupport {

    protected PersistenceAdapter createPersistenceAdapter() throws IOException {
        File dataDir = new File("target/test-data/durableAmq");
        AMQPersistenceAdapter adapter = new AMQPersistenceAdapter();
        adapter.setDirectory(dataDir);
        return adapter;
    }
View Full Code Here

public class ThreeBrokerVirtualTopicNetworkAMQPATest extends ThreeBrokerVirtualTopicNetworkTest {
   
     protected void configurePersistenceAdapter(BrokerService broker) throws IOException {
        File dataFileDir = new File("target/test-amq-data/amq/" + broker.getBrokerName());
        AMQPersistenceAdapter adapter = new AMQPersistenceAdapter();
        adapter.setDirectory(dataFileDir);
        broker.setPersistenceAdapter(adapter);
    }
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 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

    }

    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

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.