add some more useful methods

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@583237 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-10-09 17:45:54 +00:00
parent 2d5a099074
commit b2f7ba79db
1 changed files with 25 additions and 5 deletions

View File

@ -96,14 +96,25 @@ public class ActiveMQMessageAudit {
} }
/** /**
* Checks if this message has beeb seen before * Checks if this message has been seen before
* *
* @param message * @param message
* @return true if the message is a duplicate * @return true if the message is a duplicate
*/ */
public synchronized boolean isDuplicateMessageReference(final MessageReference message) { public boolean isDuplicateMessageReference(final MessageReference message) {
boolean answer = false;
MessageId id = message.getMessageId(); MessageId id = message.getMessageId();
return isDuplicateMessageId(id);
}
/**
* Checks if this messageId has been seen before
*
* @param id
* @return true if the message is a duplicate
*/
public synchronized boolean isDuplicateMessageId(final MessageId id) {
boolean answer = false;
if (id != null) { if (id != null) {
ProducerId pid = id.getProducerId(); ProducerId pid = id.getProducerId();
if (pid != null) { if (pid != null) {
@ -119,12 +130,21 @@ public class ActiveMQMessageAudit {
} }
/** /**
* uun mark this messager as being received * mark this message as being received
* *
* @param message * @param message
*/ */
public synchronized void rollbackMessageReference(final MessageReference message) { public void rollbackMessageReference(final MessageReference message) {
MessageId id = message.getMessageId(); MessageId id = message.getMessageId();
rollbackMessageId(id);
}
/**
* mark this message as being received
*
* @param id
*/
public synchronized void rollbackMessageId(final MessageId id) {
if (id != null) { if (id != null) {
ProducerId pid = id.getProducerId(); ProducerId pid = id.getProducerId();
if (pid != null) { if (pid != null) {