Class CounterConfigurationManager


  • public class CounterConfigurationManager
    extends Object
    Stores all the defined counter's configuration.

    It uses the state-Cache to distribute the counter's configuration among the nodes in the cluster, and the CounterConfigurationStorage to persist persistent configurations.

    Note that the Cache doesn't persist anything.

    Since:
    9.2
    Author:
    Pedro Ruivo
    • Constructor Detail

      • CounterConfigurationManager

        public CounterConfigurationManager​(org.infinispan.configuration.global.GlobalConfiguration globalConfiguration)
    • Method Detail

      • start

        public void start()
        It checks for existing defined configurations in CounterConfigurationStorage and in the Cache.

        If any is found, it starts the counter's Cache.

      • stop

        public void stop()
        Removes the listener for new coming defined counter's.

        The persistence is done on the fly when the configuration is defined.

      • defineConfiguration

        public CompletableFuture<Boolean> defineConfiguration​(String name,
                                                              org.infinispan.counter.api.CounterConfiguration configuration)
        It defines a new counter with the CounterConfiguration.
        Parameters:
        name - the counter's name.
        configuration - the counter's CounterConfiguration.
        Returns:
        true if the counter doesn't exist. false otherwise.
      • getCounterNames

        public Collection<String> getCounterNames()
        Returns:
        all the defined counter's name, even the one in Infinispan's configuration.