public class MessageCountReleaseStrategy extends Object implements ReleaseStrategy
Constructor and Description |
---|
MessageCountReleaseStrategy()
Convenient constructor is only one message is required (threshold=1).
|
MessageCountReleaseStrategy(int threshold)
Construct an instance based on the provided threshold.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canRelease(MessageGroup group)
Release the group if it has more messages than the threshold and has not previously been released.
|
public MessageCountReleaseStrategy()
public MessageCountReleaseStrategy(int threshold)
threshold
- the number of messages to accept before releasingpublic boolean canRelease(MessageGroup group)
canRelease
in interface ReleaseStrategy