INT-1069: remove another method from MessageGroup

This commit is contained in:
David Syer
2010-06-18 11:38:36 +00:00
parent 0a5ce33f9b
commit c1c8ddc456
3 changed files with 8 additions and 11 deletions

View File

@@ -50,12 +50,6 @@ public interface MessageGroup {
*/
int size();
/**
* Mark all unmarked messages in the group. A MessageGroupProcessor typically invokes this method after
* processing all unmarked messages.
*/
void markAll();
/**
* @return a single message from the group
*/

View File

@@ -115,11 +115,15 @@ public class SimpleMessageGroup implements MessageGroup {
}
public Collection<Message<?>> getUnmarked() {
return Collections.unmodifiableCollection(unmarked);
synchronized (lock) {
return Collections.unmodifiableCollection(unmarked);
}
}
public Collection<Message<?>> getMarked() {
return Collections.unmodifiableCollection(marked);
synchronized (lock) {
return Collections.unmodifiableCollection(marked);
}
}
public Object getCorrelationKey() {

View File

@@ -115,10 +115,9 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes
public MessageGroup markMessageGroup(MessageGroup group) {
Object correlationId = group.getCorrelationKey();
MessageGroup internal = getMessageGroupInternal(correlationId);
SimpleMessageGroup internal = getMessageGroupInternal(correlationId);
internal.markAll();
group.markAll();
return group;
return internal;
}
public void removeMessageGroup(Object correlationId) {