git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@587033 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-10-22 08:38:22 +00:00
parent 99966f58e7
commit 36486fe5b4
5 changed files with 20 additions and 2 deletions

View File

@ -128,7 +128,7 @@ public class DurableTopicSubscription extends PrefetchSubscription implements Us
} else {
redeliveredMessages.put(node.getMessageId(), Integer.valueOf(1));
}
if (keepDurableSubsActive) {
if (keepDurableSubsActive&& pending.isTransient()) {
synchronized (pending) {
pending.addMessageFirst(node);
}
@ -137,7 +137,7 @@ public class DurableTopicSubscription extends PrefetchSubscription implements Us
}
iter.remove();
}
if (!keepDurableSubsActive) {
if (!keepDurableSubsActive && pending.isTransient()) {
synchronized (pending) {
try {
pending.reset();

View File

@ -234,6 +234,10 @@ public class AbstractPendingMessageCursor implements PendingMessageCursor {
audit= new ActiveMQMessageAudit(maxAuditDepth,maxProducersToAudit);
}
}
public boolean isTransient() {
return false;
}
protected synchronized boolean isDuplicate(MessageId messageId) {

View File

@ -280,6 +280,10 @@ public class FilePendingMessageCursor extends AbstractPendingMessageCursor imple
}
}
}
public boolean isTransient() {
return true;
}
protected boolean isSpaceInMemoryList() {
return hasSpace() && isDiskListEmpty();

View File

@ -241,6 +241,12 @@ public interface PendingMessageCursor extends Service {
* @param enableAudit the enableAudit to set
*/
public void setEnableAudit(boolean enableAudit);
/**
* @return true if the underlying state of this cursor
* disappears when the broker shuts down
*/
public boolean isTransient();
}

View File

@ -142,4 +142,8 @@ public class VMPendingMessageCursor extends AbstractPendingMessageCursor {
public LinkedList<MessageReference> pageInList(int maxItems) {
return list;
}
public boolean isTransient() {
return true;
}
}