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 Details

    • asStrongCounter

      default org.infinispan.counter.api.StrongCounter asStrongCounter()
      Returns:
      The StrongCounter instance or throws an CounterException if the counter is not a StrongCounter.
    • asWeakCounter

      default org.infinispan.counter.api.WeakCounter asWeakCounter()
      Returns:
      The WeakCounter instance or throws an CounterException if the counter is not a WeakCounter.
    • destroy

      CompletionStage<Void> destroy()
      Destroys the counter.

      It drops the counter's value and all listeners registered.

      Returns:
      A CompletionStage instance which is completed when the operation finishes.
    • reset

      Resets the counter to its initial value.
      Returns:
      A CompletionStage instance which is completed when the operation finishes.
    • value

      Returns the counter's value.
      Returns:
      A CompletionStage instance which is completed when the operation finishes.
    • isWeakCounter

      boolean isWeakCounter()
      Checks if the counter is a WeakCounter.

      If true, ensures asWeakCounter() never throws an CounterException. Otherwise, it ensures asStrongCounter() never throws an CounterException.

      Returns:
      true if the counter is WeakCounter.