Examples of StoreEntry


Examples of org.apache.activemq.kaha.StoreEntry

    public void removeMessage(ConnectionContext context, MessageAck ack) throws IOException {
        lock.lock();
        try {
            MessageId msgId = ack.getLastMessageId();
            StoreEntry entry = messageContainer.getEntry(msgId);
            if (entry != null) {
                ReferenceRecord rr = messageContainer.remove(msgId);
                if (rr != null) {
                    removeInterest(rr);
                    if (ack instanceof MessageAckWithLocation) {
View Full Code Here

Examples of org.apache.activemq.kaha.StoreEntry

        lock.lock();
        try {
            final ReferenceRecord record = new ReferenceRecord(messageId.toString(), data);
            final int subscriberCount = subscriberMessages.size();
            if (subscriberCount > 0 && !isDuplicate(messageId)) {
                final StoreEntry messageEntry = messageContainer.place(messageId, record);
                addInterest(record);
                uniqueReferenceAdded = true;
                final TopicSubAck tsa = new TopicSubAck();
                tsa.setCount(subscriberCount);
                tsa.setMessageEntry(messageEntry);
                final StoreEntry ackEntry = ackContainer.placeLast(tsa);
                for (final Iterator<TopicSubContainer> i = subscriberMessages.values().iterator(); i.hasNext();) {
                    final TopicSubContainer container = i.next();
                    final ConsumerMessageRef ref = new ConsumerMessageRef();
                    ref.setAckEntry(ackEntry);
                    ref.setMessageEntry(messageEntry);
View Full Code Here

Examples of org.apache.activemq.kaha.StoreEntry

   
            TopicSubContainer container = subscriberMessages.get(key);
            if (container != null) {
                ConsumerMessageRef ref = null;
                if((ref = container.remove(messageId)) != null) {
                    StoreEntry entry = ref.getAckEntry();
                    //ensure we get up to-date pointers
                    entry = ackContainer.refresh(entry);
                    TopicSubAck tsa = ackContainer.get(entry);
                    if (tsa != null) {
                        if (tsa.decrementCount() <= 0) {
View Full Code Here

Examples of org.apache.activemq.kaha.StoreEntry

        lock.lock();
        try {
            TopicSubContainer container = subscriberMessages.get(key);
            if (container != null) {
                int count = 0;
                StoreEntry entry = container.getBatchEntry();
                if (entry == null) {
                    entry = container.getEntry();
                } else {
                    entry = container.refreshEntry(entry);
                    if (entry != null) {
View Full Code Here

Examples of org.apache.activemq.kaha.StoreEntry

     * @see java.util.ListIterator#nextIndex()
     */
    public int nextIndex(){
        int result = -1;
        if (nextItem != null){
            StoreEntry next = list.getNextEntry(nextItem);
            if (next != null){
                result = container.getInternalList().indexOf(next);
            }
        }
       
View Full Code Here

Examples of org.apache.activemq.kaha.StoreEntry

     * @see java.util.ListIterator#previousIndex()
     */
    public int previousIndex(){
        int result = -1;
        if (nextItem != null){
            StoreEntry prev = list.getPrevEntry(nextItem);
            if (prev != null){
                result = container.getInternalList().indexOf(prev);
            }
        }
       
View Full Code Here

Examples of org.apache.activemq.kaha.StoreEntry

     *
     * @param object
     * @return the entry in the Store
     */
    public synchronized StoreEntry placeLast(Object object){
        StoreEntry item=internalAddLast(object);
        return item;
    }
View Full Code Here

Examples of org.apache.activemq.kaha.StoreEntry

     *
     * @param object
     * @return the location in the Store
     */
    public synchronized StoreEntry placeFirst(Object object){
        StoreEntry item=internalAddFirst(object);
        return item;
    }
View Full Code Here

Examples of org.apache.activemq.kaha.StoreEntry

    }

    public synchronized void addMessage(ConnectionContext context,Message message) throws IOException{
        int subscriberCount=subscriberMessages.size();
        if(subscriberCount>0){
            StoreEntry messageEntry=messageContainer.placeLast(message);
            TopicSubAck tsa=new TopicSubAck();
            tsa.setCount(subscriberCount);
            tsa.setMessageEntry(messageEntry);
            StoreEntry ackEntry=ackContainer.placeLast(tsa);
            for(Iterator i=subscriberMessages.values().iterator();i.hasNext();){
                TopicSubContainer container=(TopicSubContainer)i.next();
                ConsumerMessageRef ref=new ConsumerMessageRef();
                ref.setAckEntry(ackEntry);
                ref.setMessageEntry(messageEntry);
View Full Code Here

Examples of org.apache.activemq.kaha.StoreEntry

            MessageRecoveryListener listener) throws Exception{
        String key=getSubscriptionKey(clientId,subscriptionName);
        TopicSubContainer container=(TopicSubContainer)subscriberMessages.get(key);
        if(container!=null){
            int count=0;
            StoreEntry entry=container.getBatchEntry();
            if(entry==null){
                entry=container.getListContainer().getFirst();
            }else{
                entry=container.getListContainer().refresh(entry);
                entry=container.getListContainer().getNext(entry);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.