Interface InternalCounterAdmin
- All Known Implementing Classes:
AbstractStrongCounter,BoundedStrongCounter,UnboundedStrongCounter,WeakCounterImpl
public interface InternalCounterAdmin
Internal interface which abstract the
StrongCounter and WeakCounter.- Since:
- 14.0
-
Method Summary
-
Method Details
-
asStrongCounter
default org.infinispan.counter.api.StrongCounter asStrongCounter()- Returns:
- The
StrongCounterinstance or throws anCounterExceptionif the counter is not aStrongCounter.
-
asWeakCounter
default org.infinispan.counter.api.WeakCounter asWeakCounter()- Returns:
- The
WeakCounterinstance or throws anCounterExceptionif the counter is not aWeakCounter.
-
destroy
CompletionStage<Void> destroy()Destroys the counter.It drops the counter's value and all listeners registered.
- Returns:
- A
CompletionStageinstance which is completed when the operation finishes.
-
reset
CompletionStage<Void> reset()Resets the counter to its initial value.- Returns:
- A
CompletionStageinstance which is completed when the operation finishes.
-
value
CompletionStage<Long> value()Returns the counter's value.- Returns:
- A
CompletionStageinstance which is completed when the operation finishes.
-
isWeakCounter
boolean isWeakCounter()Checks if the counter is aWeakCounter.If
true, ensuresasWeakCounter()never throws anCounterException. Otherwise, it ensuresasStrongCounter()never throws anCounterException.- Returns:
trueif the counter isWeakCounter.
-