Class CounterConfigurationManager
- java.lang.Object
-
- org.infinispan.counter.impl.manager.CounterConfigurationManager
-
public class CounterConfigurationManager extends Object
Stores all the defined counter's configuration.It uses the state-
Cacheto distribute the counter's configuration among the nodes in the cluster, and theCounterConfigurationStorageto persist persistent configurations.Note that the
Cachedoesn't persist anything.- Since:
- 9.2
- Author:
- Pedro Ruivo
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOUNTER_SCOPE
-
Constructor Summary
Constructors Constructor Description CounterConfigurationManager(org.infinispan.configuration.global.GlobalConfiguration globalConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Boolean>defineConfiguration(String name, org.infinispan.counter.api.CounterConfiguration configuration)It defines a new counter with theCounterConfiguration.Collection<String>getCounterNames()voidstart()It checks for existing defined configurations inCounterConfigurationStorageand in theCache.voidstop()Removes the listener for new coming defined counter's.
-
-
-
Field Detail
-
COUNTER_SCOPE
public static final String COUNTER_SCOPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
start
public void start()
It checks for existing defined configurations inCounterConfigurationStorageand in theCache.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 theCounterConfiguration.- Parameters:
name- the counter's name.configuration- the counter'sCounterConfiguration.- Returns:
trueif the counter doesn't exist.falseotherwise.
-
getCounterNames
public Collection<String> getCounterNames()
- Returns:
- all the defined counter's name, even the one in Infinispan's configuration.
-
-