Enum Class CommitStrategy
- All Implemented Interfaces:
Serializable
,Comparable<CommitStrategy>
,Constable
An enum representing different strategies for committing positions in a Coherence topic when
using CoherenceTopicListener
.
To track messages that have been consumed, Coherence allows committing positions at a frequency desired by the developer.
Depending on requirements you may wish the commit more or less frequently and you may not care whether the
commit was successful or not. This enum allows configuring a range of policies for a Coherence topic subscriber
from leaving it down to the client to synchronously commit (with SYNC
) or asynchronously commit
(with ASYNC
) after each message is consumed, through to manually handling commits (with MANUAL
).
- Since:
- 1.0
- Author:
- Jonathan Knight
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CommitStrategy
Returns the enum constant of this class with the specified name.static CommitStrategy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MANUAL
Do not commit messages. In this case the subscriber method should accept an argument that is theSubscriber.Element
itself and callSubscriber.Element.commit()
orSubscriber.Element.commitAsync()
to commit the received element. -
SYNC
Synchronously commit usingSubscriber.Element.commit()
after each message is processed. -
ASYNC
Asynchronously commit usingSubscriber.Element.commitAsync()
after each message is processed.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-