Interface InternalCounterAdmin
-
- All Known Implementing Classes:
AbstractStrongCounter,BoundedStrongCounter,UnboundedStrongCounter,WeakCounterImpl
public interface InternalCounterAdminInternal interface which abstract theStrongCounterandWeakCounter.- Since:
- 14.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default org.infinispan.counter.api.StrongCounterasStrongCounter()default org.infinispan.counter.api.WeakCounterasWeakCounter()CompletionStage<Void>destroy()Destroys the counter.booleanisWeakCounter()Checks if the counter is aWeakCounter.CompletionStage<Void>reset()Resets the counter to its initial value.CompletionStage<Long>value()Returns the counter's value.
-
-
-
Method Detail
-
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.
-
-