https://issues.apache.org/jira/browse/AMQ-3193 - implement equals for indirect message ref, so remove from pendingdispatch will work on moveMessages

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1075864 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2011-03-01 15:59:59 +00:00
parent 462efdb9de
commit d8fd5330a4
1 changed files with 11 additions and 0 deletions

View File

@ -72,6 +72,17 @@ public class IndirectMessageReference implements QueueMessageReference {
return "Message " + message.getMessageId() + " dropped=" + dropped + " acked=" + acked + " locked=" + (lockOwner != null);
}
@Override
public boolean equals(Object obj) {
return this == obj || (obj instanceof IndirectMessageReference &&
message.getMessageId().equals(((IndirectMessageReference)obj).getMessage().getMessageId()));
}
@Override
public int hashCode() {
return message.hashCode();
}
public void incrementRedeliveryCounter() {
message.incrementRedeliveryCounter();
}