avoid NPE I was getting in the web console

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@516401 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2007-03-09 12:48:36 +00:00
parent ba54ee86b2
commit cb3becf3c4
1 changed files with 13 additions and 11 deletions

View File

@ -163,19 +163,21 @@ public class AMQTopicMessageStore extends AMQMessageStore implements TopicMessag
this.ackedLastAckLocations=new HashMap<SubscriptionKey,MessageId>();
}
Location location=super.doAsyncWrite();
transactionTemplate.run(new Callback(){
public void execute() throws Exception{
// Checkpoint the acknowledged messages.
Iterator<SubscriptionKey> iterator=cpAckedLastAckLocations.keySet().iterator();
while(iterator.hasNext()){
SubscriptionKey subscriptionKey=iterator.next();
MessageId identity=cpAckedLastAckLocations.get(subscriptionKey);
topicReferenceStore.acknowledge(transactionTemplate.getContext(),subscriptionKey.clientId,
subscriptionKey.subscriptionName,identity);
if (cpAckedLastAckLocations != null) {
transactionTemplate.run(new Callback() {
public void execute() throws Exception {
// Checkpoint the acknowledged messages.
Iterator<SubscriptionKey> iterator = cpAckedLastAckLocations.keySet().iterator();
while (iterator.hasNext()) {
SubscriptionKey subscriptionKey = iterator.next();
MessageId identity = cpAckedLastAckLocations.get(subscriptionKey);
topicReferenceStore.acknowledge(transactionTemplate.getContext(), subscriptionKey.clientId,
subscriptionKey.subscriptionName, identity);
}
}
}
});
});
}
return location;
}