Class CountLimit
java.lang.Object
com.swiftmq.impl.streams.comp.memory.limit.CountLimit
- All Implemented Interfaces:
Limit
A CountLimit keeps a Memory at a specific number of Messages and removes
older Messages if necessary.
- Author:
- IIT Software GmbH, Muenster/Germany, (c) 2016, All Rights Reserved
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks the Memory limits and deletes Messages that doesn't fit in the limitlimit()
Creates a new LimitBuilder and that chains new Limits to the corresponding MemoryonRetire
(RetirementCallback callback) Sets a callback which is called for each Message that is retired (removed by a Limit).sliding()
Marks it as sliding count limit (default).toString()
tumbling()
Marks it as tumbling count limit.
-
Method Details
-
sliding
Marks it as sliding count limit (default). If a new Message is being added and the limit is reached, the oldest Message will retire.- Returns:
- this
-
tumbling
Marks it as tumbling count limit. If a new Message is being added and the limit is reached, all Messages will retire and the Memory is empty.- Returns:
- this
-
checkLimit
public void checkLimit()Description copied from interface:Limit
Checks the Memory limits and deletes Messages that doesn't fit in the limit- Specified by:
checkLimit
in interfaceLimit
-
onRetire
Description copied from interface:Limit
Sets a callback which is called for each Message that is retired (removed by a Limit). -
limit
Description copied from interface:Limit
Creates a new LimitBuilder and that chains new Limits to the corresponding Memory -
toString
-