public class TimeoutCountSequenceSizeReleaseStrategy extends Object implements ReleaseStrategy
ReleaseStrategy
that releases all messages if any of the following is true:
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_THRESHOLD
Default threshold is effectively infinite.
|
static long |
DEFAULT_TIMEOUT
Default timeout is one minute.
|
Constructor and Description |
---|
TimeoutCountSequenceSizeReleaseStrategy() |
TimeoutCountSequenceSizeReleaseStrategy(int threshold,
long timeout) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRelease(MessageGroup messages) |
public static final long DEFAULT_TIMEOUT
public static final int DEFAULT_THRESHOLD
public TimeoutCountSequenceSizeReleaseStrategy()
public TimeoutCountSequenceSizeReleaseStrategy(int threshold, long timeout)
threshold
- the number of messages to accept before releasingtimeout
- the timeout for the release in millisecondspublic boolean canRelease(MessageGroup messages)
canRelease
in interface ReleaseStrategy