Class EmbeddedCounterManager

  • All Implemented Interfaces:
    org.infinispan.counter.api.CounterManager

    @MBean(objectName="CounterManager",
           description="Component to manage counters")
    public class EmbeddedCounterManager
    extends Object
    implements org.infinispan.counter.api.CounterManager
    A CounterManager implementation for embedded cache manager.
    Since:
    9.0
    Author:
    Pedro Ruivo
    • Constructor Detail

      • EmbeddedCounterManager

        public EmbeddedCounterManager()
    • Method Detail

      • start

        public void start()
      • stop

        public void stop()
      • remove

        @ManagedOperation(description="Removes the counter\'s value from the cluster. The counter will be re-created when access next time.",
                          displayName="Remove Counter",
                          name="remove")
        public void remove​(String counterName)
        Specified by:
        remove in interface org.infinispan.counter.api.CounterManager
      • undefineCounter

        public void undefineCounter​(String counterName)
        Specified by:
        undefineCounter in interface org.infinispan.counter.api.CounterManager
      • getStrongCounter

        public org.infinispan.counter.api.StrongCounter getStrongCounter​(String name)
        Specified by:
        getStrongCounter in interface org.infinispan.counter.api.CounterManager
      • getStrongCounterAsync

        public CompletionStage<org.infinispan.counter.api.StrongCounter> getStrongCounterAsync​(String counterName)
      • getWeakCounter

        public org.infinispan.counter.api.WeakCounter getWeakCounter​(String name)
        Specified by:
        getWeakCounter in interface org.infinispan.counter.api.CounterManager
      • getWeakCounterAsync

        public CompletionStage<org.infinispan.counter.api.WeakCounter> getWeakCounterAsync​(String counterName)
      • getCounterNames

        @ManagedOperation(description="Returns a collection of defined counter\'s name.",
                          displayName="Get Defined Counters",
                          name="counters")
        public Collection<String> getCounterNames()
        Specified by:
        getCounterNames in interface org.infinispan.counter.api.CounterManager
      • defineCounterAsync

        public CompletableFuture<Boolean> defineCounterAsync​(String name,
                                                             org.infinispan.counter.api.CounterConfiguration configuration)
      • defineCounter

        public boolean defineCounter​(String name,
                                     org.infinispan.counter.api.CounterConfiguration configuration)
        Specified by:
        defineCounter in interface org.infinispan.counter.api.CounterManager
      • isDefined

        public boolean isDefined​(String name)
        Specified by:
        isDefined in interface org.infinispan.counter.api.CounterManager
      • getConfiguration

        public org.infinispan.counter.api.CounterConfiguration getConfiguration​(String counterName)
        Specified by:
        getConfiguration in interface org.infinispan.counter.api.CounterManager
      • getConfigurationAsync

        public CompletableFuture<org.infinispan.counter.api.CounterConfiguration> getConfigurationAsync​(String name)
      • getValue

        @ManagedOperation(description="Returns the current counter\'s value",
                          displayName="Get Counter\' Value",
                          name="value")
        public long getValue​(String counterName)
      • reset

        @ManagedOperation(description="Resets the counter\'s value",
                          displayName="Reset Counter",
                          name="reset")
        public void reset​(String counterName)
      • getCounterConfiguration

        @ManagedOperation(description="Returns the counter\'s configuration",
                          displayName="Counter Configuration",
                          name="configuration")
        public Properties getCounterConfiguration​(String counterName)