Package org.apache.activemq.command

Examples of org.apache.activemq.command.Message.decrementReferenceCount()


    public final synchronized MessageReference next() {
        Message result = null;
        if (!this.batchList.isEmpty()) {
            Iterator<Entry<MessageId, Message>> i = this.batchList.entrySet().iterator();
            result = i.next().getValue();
            result.decrementReferenceCount();
            i.remove();
        }
        return result;
    }
   
View Full Code Here


    public void removeMessage(MessageId msgId) throws IOException {
        synchronized (messageTable) {
            Message removed = messageTable.remove(msgId);
            if( removed !=null ) {
                removed.decrementReferenceCount();
            }
            if ((lastBatchId != null && lastBatchId.equals(msgId)) || messageTable.isEmpty()) {
                lastBatchId = null;
            }
        }
View Full Code Here

            MessageId id = ack.getLastMessageId();
            Message message = messages.remove(id);
            if (message == null) {
                messageAcks.add(ack);
            } else {
                message.decrementReferenceCount();
            }
        }
    }

    public void replayRemoveMessage(ConnectionContext context, MessageAck messageAck) {
View Full Code Here

                            longTermStore.addMessage(context, message);
                        } catch (Throwable e) {
                            LOG.warn("Message could not be added to long term store: " + e.getMessage(), e);
                        }
                        size += message.getSize();
                        message.decrementReferenceCount();
                        // Commit the batch if it's getting too big
                        if (size >= maxCheckpointMessageAddSize) {
                            persitanceAdapter.commitTransaction(context);
                            persitanceAdapter.beginTransaction(context);
                            size = 0;
View Full Code Here

            if ((lastBatch != null && lastBatch.equals(id)) || map.isEmpty()) {
                resetBatching();
            }
        }
        if( removed!=null ) {
            removed.decrementReferenceCount();
        }
    }

    synchronized int size() {
        return map.size();
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.