public void execute() throws Throwable {
// Checkpoint the added messages.
Iterator iterator = cpAddedMessageIds.keySet().iterator();
while (iterator.hasNext()) {
MessageIdentity identity = (MessageIdentity) iterator.next();
ActiveMQMessage msg = getCacheMessage(identity);
// Pull it out of the journal if we have to.
if (msg == null) {
RecordLocation location = (RecordLocation) cpAddedMessageIds.get(identity);
msg = (ActiveMQMessage) peristenceAdapter.readPacket((RecordLocation) location);