Package org.apache.activemq.broker.region

Examples of org.apache.activemq.broker.region.MessageReference.decrementReferenceCount()


   
    public synchronized void gc() {
        for (Iterator<MessageReference>i = batchList.iterator();i.hasNext();) {
            MessageReference msg = i.next();
            rollback(msg.getMessageId());
            msg.decrementReferenceCount();
        }
        batchList.clear();
        clearIterator(false);
        batchResetNeeded = true;
        setCacheEnabled(false);
View Full Code Here


    protected synchronized void flushToDisk() {

        if (!memoryList.isEmpty()) {
            while (!memoryList.isEmpty()) {
                MessageReference node = memoryList.removeFirst();
                node.decrementReferenceCount();
                ByteSequence bs;
                try {
                    bs = getByteSequence(node.getMessage());
                    getDiskList().addLast(node.getMessageId().toString(), bs);
                } catch (IOException e) {
View Full Code Here

   
    public final synchronized void gc() {
        for (Iterator<MessageReference>i = batchList.iterator();i.hasNext();) {
            MessageReference msg = i.next();
            rollback(msg.getMessageId());
            msg.decrementReferenceCount();
        }
        batchList.clear();
        clearIterator(false);
        batchResetNeeded = true;
        this.cacheEnabled=false;
View Full Code Here

            throws Exception {
        List<MessageReference> rc = new ArrayList<MessageReference>();
        for (Iterator<MessageReference> iterator = list.iterator(); iterator.hasNext();) {
            MessageReference r = iterator.next();
            if (r.getRegionDestination() == destination) {
                r.decrementReferenceCount();
                rc.add(r);
                iterator.remove();
            }
        }
        return rc;
View Full Code Here

     */
   
    public synchronized void clear() {
        for (Iterator<MessageReference> i = list.iterator(); i.hasNext();) {
            MessageReference ref = i.next();
            ref.decrementReferenceCount();
        }
        list.clear();
    }

   
View Full Code Here

        underTest.setMaxBatchSize(2);
        underTest.reset();
        while (underTest.hasNext() && dequeueCount < count) {
            MessageReference ref = underTest.next();
            ref.decrementReferenceCount();
            underTest.remove();
            Log.info("Received message: {} with body: {}",
                     ref.getMessageId(), ((ActiveMQTextMessage)ref.getMessage()).getText());
            assertEquals(dequeueCount++, ref.getMessageId().getProducerSequenceId());
        }
View Full Code Here

    public synchronized List<MessageReference> remove(ConnectionContext context, Destination destination) throws Exception {
      List<MessageReference> rc = new ArrayList<MessageReference>();
        for (Iterator<MessageReference> iterator = list.iterator(); iterator.hasNext();) {
            MessageReference r = iterator.next();
            if( r.getRegionDestination()==destination ) {
                r.decrementReferenceCount();
                rc.add(r);
                iterator.remove();
            }
        }
        return rc ;       
View Full Code Here

    public synchronized void remove(MessageReference node) {
        for (Iterator<MessageReference> i = list.iterator(); i.hasNext();) {
            MessageReference ref = i.next();
            if (node.getMessageId().equals(ref.getMessageId())) {
                ref.decrementReferenceCount();
                i.remove();
                break;
            }
        }
    }
View Full Code Here

        underTest.setMaxBatchSize(2);
        underTest.reset();
        while (underTest.hasNext() && dequeueCount < count) {
            MessageReference ref = underTest.next();
            ref.decrementReferenceCount();
            underTest.remove();
            assertEquals(dequeueCount++, ref.getMessageId()
                    .getProducerSequenceId());
        }
        underTest.release();
View Full Code Here

   
    public synchronized void gc() {
        for (Iterator<MessageReference>i = batchList.iterator();i.hasNext();) {
            MessageReference msg = i.next();
            rollback(msg.getMessageId());
            msg.decrementReferenceCount();
        }
        batchList.clear();
        clearIterator(false);
        batchResetNeeded = true;
        setCacheEnabled(false);
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.