Class RemoteCounterManager
- All Implemented Interfaces:
CounterManager
CounterManager implementation for Hot Rod clients.- Since:
- 9.2
- Author:
- Pedro Ruivo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandefineCounter(String name, CounterConfiguration configuration) Defines a counter with the specificnameandCounterConfiguration.getConfiguration(String counterName) Returns aCollectionof defined counter names.getStrongCounter(String name) Returns theStrongCounterwith that specific name.getWeakCounter(String name) Returns theWeakCounterwith that specific name.booleanvoidIt removes the counter from the cluster.voidstart(org.infinispan.client.hotrod.impl.transport.netty.ChannelFactory channelFactory, Configuration configuration, ClientListenerNotifier listenerNotifier) voidstop()voidundefineCounter(String name) It removes the counter and its configuration from the cluster.
-
Constructor Details
-
RemoteCounterManager
public RemoteCounterManager()
-
-
Method Details
-
start
public void start(org.infinispan.client.hotrod.impl.transport.netty.ChannelFactory channelFactory, Configuration configuration, ClientListenerNotifier listenerNotifier) -
getStrongCounter
Description copied from interface:CounterManagerReturns theStrongCounterwith that specific name.If the
StrongCounterdoes not exists, it is created based on theCounterConfiguration.Note that the counter must be defined prior to this method invocation using
CounterManager.defineCounter(String, CounterConfiguration)or via global configuration. This method only supportsCounterType.BOUNDED_STRONGandCounterType.UNBOUNDED_STRONGcounters.- Specified by:
getStrongCounterin interfaceCounterManager- Parameters:
name- the counter name.- Returns:
- the
StrongCounterinstance.
-
getWeakCounter
Description copied from interface:CounterManagerReturns theWeakCounterwith that specific name.If the
WeakCounterdoes not exists, it is created based on theCounterConfiguration.Note that the counter must be defined prior to this method invocation using
CounterManager.defineCounter(String, CounterConfiguration)or via global configuration. This method only supportsCounterType.WEAKcounters.- Specified by:
getWeakCounterin interfaceCounterManager- Parameters:
name- the counter name.- Returns:
- the
WeakCounterinstance.
-
defineCounter
Description copied from interface:CounterManagerDefines a counter with the specificnameandCounterConfiguration.It does not overwrite existing configurations.
- Specified by:
defineCounterin interfaceCounterManager- Parameters:
name- the counter name.configuration- the counter configuration- Returns:
trueif successfully defined orfalseif the counter exists or fails to defined.
-
undefineCounter
Description copied from interface:CounterManagerIt removes the counter and its configuration from the cluster.- Specified by:
undefineCounterin interfaceCounterManager- Parameters:
name- The counter's name to remove
-
isDefined
- Specified by:
isDefinedin interfaceCounterManager- Parameters:
name- the counter name.- Returns:
trueif the counter is defined orfalseif the counter is not defined or fails to check.
-
getConfiguration
- Specified by:
getConfigurationin interfaceCounterManager- Parameters:
counterName- the counter name.- Returns:
- the counter's
CounterConfigurationornullif the counter is not defined.
-
remove
Description copied from interface:CounterManagerIt removes the counter from the cluster.All instances returned by
CounterManager.getWeakCounter(String)orCounterManager.getStrongCounter(String)are destroyed and they shouldn't be used anymore. Also, the registeredCounterListeners are removed and they aren't invoked anymore.- Specified by:
removein interfaceCounterManager- Parameters:
counterName- The counter's name to remove.
-
getCounterNames
Description copied from interface:CounterManagerReturns aCollectionof defined counter names.- Specified by:
getCounterNamesin interfaceCounterManager- Returns:
- a
Collectionof defined counter names.
-
stop
public void stop()
-