updated recoverNextMessages()

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@490813 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2006-12-28 21:02:44 +00:00
parent a70f96bd37
commit 6964747912
1 changed files with 25 additions and 2 deletions

View File

@ -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); 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);
}
});
} }