LOG.info("Stopped KahaDB");
super.doStop(stopper);
}
void incrementRedeliveryAndReWrite(final String key, final KahaDestination destination) throws IOException {
Location location;
this.indexLock.writeLock().lock();
try {
location = findMessageLocation(key, destination);
} finally {
this.indexLock.writeLock().unlock();
}
if (location != null) {
KahaAddMessageCommand addMessage = (KahaAddMessageCommand) load(location);
Message message = (Message) wireFormat.unmarshal(new DataInputStream(addMessage.getMessage().newInput()));
message.incrementRedeliveryCounter();
if (LOG.isTraceEnabled()) {
LOG.trace("rewriting: " + key + " with deliveryCount: " + message.getRedeliveryCounter());
}
org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message);
addMessage.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength()));
final Location rewriteLocation = journal.write(toByteSequence(addMessage), true);
this.indexLock.writeLock().lock();
try {
pageFile.tx().execute(new Transaction.Closure<IOException>() {
public void execute(Transaction tx) throws IOException {