Package org.apache.activemq.kaha

Examples of org.apache.activemq.kaha.ListContainer


            MapContainer container = getMapContainer(id.getKey(), id.getDataContainerName());
            container.clear();
        }
        for (Iterator i = listsContainer.getKeys().iterator(); i.hasNext();) {
            ContainerId id = (ContainerId)i.next();
            ListContainer container = getListContainer(id.getKey(), id.getDataContainerName());
            container.clear();
        }

    }
View Full Code Here


            MapContainer container = getMapContainer(id.getKey(), id.getDataContainerName());
            container.clear();
        }
        for (Iterator i = listsContainer.getKeys().iterator(); i.hasNext();) {
            ContainerId id = (ContainerId)i.next();
            ListContainer container = getListContainer(id.getKey(), id.getDataContainerName());
            container.clear();
        }

    }
View Full Code Here

            MapContainer container = getMapContainer(id.getKey(), id.getDataContainerName());
            container.clear();
        }
        for (Iterator i = listsContainer.getKeys().iterator(); i.hasNext();) {
            ContainerId id = (ContainerId)i.next();
            ListContainer container = getListContainer(id.getKey(), id.getDataContainerName());
            container.clear();
        }

    }
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){
                rc=transactionStore.proxy(rc);
            }
View Full Code Here

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

    }

    public void recoverSubscription(String clientId,String subscriptionName,final MessageRecoveryListener listener)
            throws Exception{
        String key=getSubscriptionKey(clientId,subscriptionName);
        ListContainer list=(ListContainer)subscriberAcks.get(key);
        if(list!=null){
            for(Iterator i=list.iterator();i.hasNext();){
                Object msg=messageContainer.get(i.next());
                if(msg!=null){
                    if(msg.getClass()==String.class){
                        listener.recoverMessageReference((String)msg);
                    }else{
View Full Code Here

    }

    public void recoverNextMessages(String clientId,String subscriptionName,MessageId lastMessageId,int maxReturned,
            MessageRecoveryListener listener) throws Exception{
        String key=getSubscriptionKey(clientId,subscriptionName);
        ListContainer list=(ListContainer)subscriberAcks.get(key);
        if(list!=null){
            boolean startFound=false;
            int count=0;
            for(Iterator i=list.iterator();i.hasNext()&&count<maxReturned;){
                Object msg=messageContainer.get(i.next());
                if(msg!=null){
                    if(msg.getClass()==String.class){
                        String ref=msg.toString();
                        if(startFound||lastMessageId==null){
View Full Code Here

        if(subscriberCount>0){
            String id=message.getMessageId().toString();
            ackContainer.put(id,new AtomicInteger(subscriberCount));
            for(Iterator i=subscriberAcks.keySet().iterator();i.hasNext();){
                Object key=i.next();
                ListContainer container=store.getListContainer(key,"durable-subs");
                container.add(id);
            }
            super.addMessage(context,message);
        }
    }
View Full Code Here

    public void replayAcknowledge(ConnectionContext context,String clientId,String subscritionName,MessageId messageId){
        try{
            synchronized(this){
                String subcriberId=getSubscriptionKey(clientId,subscritionName);
                String id=messageId.toString();
                ListContainer container=(ListContainer)subscriberAcks.get(subcriberId);
                if(container!=null){
                    // container.remove(id);
                    container.removeFirst();
                    AtomicInteger count=(AtomicInteger)ackContainer.remove(id);
                    if(count!=null){
                        if(count.decrementAndGet()>0){
                            ackContainer.put(id,count);
                        }else{
View Full Code Here

        synchronized(this){
            lastLocation=location;
            ackedLastAckLocations.put(key,messageId);
            String subcriberId=getSubscriptionKey(key.getClientId(),key.getSubscriptionName());
            String id=messageId.toString();
            ListContainer container=(ListContainer)subscriberAcks.get(subcriberId);
            if(container!=null){
                // container.remove(id);
                container.removeFirst();
                AtomicInteger count=(AtomicInteger)ackContainer.remove(id);
                if(count!=null){
                    if(count.decrementAndGet()>0){
                        ackContainer.put(id,count);
                    }else{
View Full Code Here

TOP

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

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.