Class RemoteCounterManager
- All Implemented Interfaces:
CounterManager
CounterManager
implementation for Hot Rod clients.- Since:
- 9.2
- Author:
- Pedro Ruivo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
defineCounter
(String name, CounterConfiguration configuration) Defines a counter with the specificname
andCounterConfiguration
.getConfiguration
(String counterName) Returns aCollection
of defined counter names.getStrongCounter
(String name) Returns theStrongCounter
with that specific name.getWeakCounter
(String name) Returns theWeakCounter
with that specific name.boolean
void
It removes the counter from the cluster.void
start
(org.infinispan.client.hotrod.impl.transport.netty.ChannelFactory channelFactory, Configuration configuration, ClientListenerNotifier listenerNotifier) void
stop()
void
undefineCounter
(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:CounterManager
Returns theStrongCounter
with that specific name.If the
StrongCounter
does 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_STRONG
andCounterType.UNBOUNDED_STRONG
counters.- Specified by:
getStrongCounter
in interfaceCounterManager
- Parameters:
name
- the counter name.- Returns:
- the
StrongCounter
instance.
-
getWeakCounter
Description copied from interface:CounterManager
Returns theWeakCounter
with that specific name.If the
WeakCounter
does 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.WEAK
counters.- Specified by:
getWeakCounter
in interfaceCounterManager
- Parameters:
name
- the counter name.- Returns:
- the
WeakCounter
instance.
-
defineCounter
Description copied from interface:CounterManager
Defines a counter with the specificname
andCounterConfiguration
.It does not overwrite existing configurations.
- Specified by:
defineCounter
in interfaceCounterManager
- Parameters:
name
- the counter name.configuration
- the counter configuration- Returns:
true
if successfully defined orfalse
if the counter exists or fails to defined.
-
undefineCounter
Description copied from interface:CounterManager
It removes the counter and its configuration from the cluster.- Specified by:
undefineCounter
in interfaceCounterManager
- Parameters:
name
- The counter's name to remove
-
isDefined
- Specified by:
isDefined
in interfaceCounterManager
- Parameters:
name
- the counter name.- Returns:
true
if the counter is defined orfalse
if the counter is not defined or fails to check.
-
getConfiguration
- Specified by:
getConfiguration
in interfaceCounterManager
- Parameters:
counterName
- the counter name.- Returns:
- the counter's
CounterConfiguration
ornull
if the counter is not defined.
-
remove
Description copied from interface:CounterManager
It 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 registeredCounterListener
s are removed and they aren't invoked anymore.- Specified by:
remove
in interfaceCounterManager
- Parameters:
counterName
- The counter's name to remove.
-
getCounterNames
Description copied from interface:CounterManager
Returns aCollection
of defined counter names.- Specified by:
getCounterNames
in interfaceCounterManager
- Returns:
- a
Collection
of defined counter names.
-
stop
public void stop()
-