Package org.apache.activemq.kaha

Examples of org.apache.activemq.kaha.MapContainer


    public TransactionStore createTransactionStore() throws IOException {
        if (transactionStore == null) {
            while (true) {
                try {
                    Store store = getStore();
                    MapContainer container = store
                        .getMapContainer(PREPARED_TRANSACTIONS_NAME, "transactions");
                    container.setKeyMarshaller(new CommandMarshaller(wireFormat));
                    container.setValueMarshaller(new TransactionMarshaller(wireFormat));
                    container.load();
                    transactionStore = new KahaTransactionStore(this, container);
                    transactionStore.setBrokerService(brokerService);
                    break;
                } catch (StoreLockedExcpetion e) {
                    LOG.info("Store is locked... waiting " + (STORE_LOCKED_WAIT_DELAY / 1000)
View Full Code Here


    }

    protected MapContainer getSubsMapContainer(Object id, String containerName)
        throws IOException {
        Store store = getStore();
        MapContainer container = store.getMapContainer(id, containerName);
        container.setKeyMarshaller(Store.STRING_MARSHALLER);
        container.setValueMarshaller(createMessageMarshaller());
        container.load();
        return container;
    }
View Full Code Here

    public TopicReferenceStore createTopicReferenceStore(ActiveMQTopic destination) throws IOException {
        TopicReferenceStore rc = (TopicReferenceStore)topics.get(destination);
        if (rc == null) {
            Store store = getStore();
            MapContainer messageContainer = getMapReferenceContainer(destination.getPhysicalName(), "topic-data");
            MapContainer subsContainer = getSubsMapContainer(destination.getPhysicalName() + "-Subscriptions", "blob");
            ListContainer<TopicSubAck> ackContainer = store.getListContainer(destination.getPhysicalName(), "topic-acks");
            ackContainer.setMarshaller(new TopicSubAckMarshaller());
            rc = new KahaTopicReferenceStore(store, this, messageContainer, ackContainer, subsContainer,
                                             destination);
            messageStores.put(destination, rc);
View Full Code Here

    }

   
    protected MapContainer addSubscriberMessageContainer(String clientId, String subscriptionName) throws IOException {
        String containerName = getSubscriptionContainerName(getSubscriptionKey(clientId, subscriptionName));
        MapContainer container = store.getMapContainer(containerName,containerName);
        container.setKeyMarshaller(Store.MESSAGEID_MARSHALLER);
        Marshaller marshaller = new ConsumerMessageRefMarshaller();
        container.setValueMarshaller(marshaller);
        TopicSubContainer tsc = new TopicSubContainer(container);
        subscriberMessages.put(getSubscriptionKey(clientId, subscriptionName), tsc);
        return container;
    }
View Full Code Here

    public synchronized TopicMessageStore createTopicMessageStore(ActiveMQTopic destination) throws IOException{
        TopicMessageStore rc=(TopicMessageStore)topics.get(destination);
        if(rc==null){
            Store store=getStore();
            ListContainer messageContainer=getListContainer(destination,"topic-data");
            MapContainer subsContainer=getMapContainer(destination.toString()+"-Subscriptions","topic-subs");
            ListContainer ackContainer=store.getListContainer(destination.toString(),"topic-acks");
            ackContainer.setMarshaller(new TopicSubAckMarshaller());
            rc=new KahaTopicMessageStore(store,messageContainer,ackContainer,subsContainer,destination);
            messageStores.put(destination,rc);
            if(transactionStore!=null){
View Full Code Here

    }

    public TransactionStore createTransactionStore() throws IOException{
        if(transactionStore==null){
            Store store=getStore();
            MapContainer container=store.getMapContainer(PREPARED_TRANSACTIONS_NAME,"transactions");
            container.setKeyMarshaller(new CommandMarshaller(wireFormat));
            container.setValueMarshaller(new TransactionMarshaller(wireFormat));
            container.load();
            transactionStore=new KahaTransactionStore(this,container);
        }
        return transactionStore;
    }
View Full Code Here

        this.useExternalMessageReferences=useExternalMessageReferences;
    }

    protected MapContainer getMapContainer(Object id,String containerName) throws IOException{
        Store store=getStore();
        MapContainer container=store.getMapContainer(id,containerName);
        container.setKeyMarshaller(new StringMarshaller());
        if(useExternalMessageReferences){
            container.setValueMarshaller(new StringMarshaller());
        }else{
            container.setValueMarshaller(new CommandMarshaller(wireFormat));
        }
        container.load();
        return container;
    }
View Full Code Here

    }

    public MessageStore createQueueMessageStore(ActiveMQQueue destination) throws IOException {
        RapidMessageStore store = (RapidMessageStore) queues.get(destination);
        if (store == null) {
            MapContainer messageContainer=getMapContainer(destination,"topic-data");
            store = new RapidMessageStore(this, destination, messageContainer);
            queues.put(destination, store);
        }
        return store;
    }
View Full Code Here

        }
        return store;
    }

    protected MapContainer getMapContainer(Object id,String containerName) throws IOException{
        MapContainer container=store.getMapContainer(id,containerName);
        container.setKeyMarshaller(new StringMarshaller());
        if(useExternalMessageReferences){
            container.setValueMarshaller(new StringMarshaller());
        }else{
            container.setValueMarshaller(new CommandMarshaller(wireFormat));
        }
        container.load();
        return container;
    }
View Full Code Here

    public TopicMessageStore createTopicMessageStore(ActiveMQTopic destination) throws IOException {
        RapidTopicMessageStore store = (RapidTopicMessageStore) topics.get(destination);
        if (store == null) {
           
            MapContainer messageContainer=getMapContainer(destination,"topic-data");
            MapContainer subsContainer=getMapContainer(destination.toString()+"-subscriptions","topic-subs");
            MapContainer ackContainer=this.store.getMapContainer(destination.toString(),"topic-acks");
           
            ackContainer.setKeyMarshaller(new StringMarshaller());
            ackContainer.setValueMarshaller(new AtomicIntegerMarshaller());

            store = new RapidTopicMessageStore(this, destination, messageContainer, subsContainer, ackContainer);
            topics.put(destination, store);
        }
        return store;
View Full Code Here

TOP

Related Classes of org.apache.activemq.kaha.MapContainer

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.