From 69647479123d6b59a6ece464c7778ca9257759b3 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Thu, 28 Dec 2006 21:02:44 +0000 Subject: [PATCH] updated recoverNextMessages() git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@490813 13f79535-47bb-0310-9956-ffa450edef68 --- .../journal/QuickJournalMessageStore.java | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/store/journal/QuickJournalMessageStore.java b/activemq-core/src/main/java/org/apache/activemq/store/journal/QuickJournalMessageStore.java index ce6ace204e..3be3e5884b 100755 --- a/activemq-core/src/main/java/org/apache/activemq/store/journal/QuickJournalMessageStore.java +++ b/activemq-core/src/main/java/org/apache/activemq/store/journal/QuickJournalMessageStore.java @@ -426,9 +426,32 @@ public class QuickJournalMessageStore implements MessageStore { } - public void recoverNextMessages(int maxReturned,MessageRecoveryListener listener) throws Exception{ + public void recoverNextMessages(int maxReturned,final MessageRecoveryListener listener) throws Exception{ peristenceAdapter.checkpoint(true, true); - longTermStore.recoverNextMessages(maxReturned,listener); + longTermStore.recoverNextMessages(maxReturned,new MessageRecoveryListener() { + + public void finished(){ + listener.finished(); + + } + + public boolean hasSpace(){ + return listener.hasSpace(); + } + + public void recoverMessage(Message message) throws Exception{ + throw new IOException("Should not get called"); + + } + + public void recoverMessageReference(String messageReference) throws Exception{ + RecordLocation loc = toRecordLocation(messageReference); + Message message = (Message) peristenceAdapter.readCommand(loc); + listener.recoverMessage(message); + + } + + }); }