public class RemoteCounterManager extends Object implements CounterManager
CounterManager implementation for Hot Rod clients.| Constructor and Description |
|---|
RemoteCounterManager() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
defineCounter(String name,
CounterConfiguration configuration)
Defines a counter with the specific
name and CounterConfiguration. |
CounterConfiguration |
getConfiguration(String counterName) |
Collection<String> |
getCounterNames()
Returns a
Collection of defined counter names. |
StrongCounter |
getStrongCounter(String name)
Returns the
StrongCounter with that specific name. |
WeakCounter |
getWeakCounter(String name)
Returns the
WeakCounter with that specific name. |
boolean |
isDefined(String name) |
void |
remove(String counterName)
It removes the counter from the cluster.
|
void |
start(ChannelFactory channelFactory,
Codec codec,
Configuration configuration,
ClientListenerNotifier listenerNotifier) |
void |
stop() |
void |
undefineCounter(String name)
It removes the counter and its configuration from the cluster.
|
public void start(ChannelFactory channelFactory, Codec codec, Configuration configuration, ClientListenerNotifier listenerNotifier)
public StrongCounter getStrongCounter(String name)
CounterManagerStrongCounter with that specific name.
If the StrongCounter does not exists, it is created based on the CounterConfiguration.
Note that the counter must be defined prior to this method invocation using CounterManager.defineCounter(String, CounterConfiguration) or via global configuration. This method only supports
CounterType.BOUNDED_STRONG and CounterType.UNBOUNDED_STRONG counters.
getStrongCounter in interface CounterManagername - the counter name.StrongCounter instance.public WeakCounter getWeakCounter(String name)
CounterManagerWeakCounter with that specific name.
If the WeakCounter does not exists, it is created based on the CounterConfiguration.
Note that the counter must be defined prior to this method invocation using CounterManager.defineCounter(String, CounterConfiguration) or via global configuration. This method only supports
CounterType.WEAK counters.
getWeakCounter in interface CounterManagername - the counter name.WeakCounter instance.public boolean defineCounter(String name, CounterConfiguration configuration)
CounterManagername and CounterConfiguration.
It does not overwrite existing configurations.
defineCounter in interface CounterManagername - the counter name.configuration - the counter configurationtrue if successfully defined or false if the counter exists or fails to defined.public void undefineCounter(String name)
CounterManagerundefineCounter in interface CounterManagername - The counter's name to removepublic boolean isDefined(String name)
isDefined in interface CounterManagername - the counter name.true if the counter is defined or false if the counter is not defined or fails to check.public CounterConfiguration getConfiguration(String counterName)
getConfiguration in interface CounterManagercounterName - the counter name.CounterConfiguration or null if the counter is not defined.public void remove(String counterName)
CounterManager
All instances returned by CounterManager.getWeakCounter(String) or CounterManager.getStrongCounter(String) are destroyed and
they shouldn't be used anymore. Also, the registered CounterListeners are removed and they aren't invoked
anymore.
remove in interface CounterManagercounterName - The counter's name to remove.public Collection<String> getCounterNames()
CounterManagerCollection of defined counter names.getCounterNames in interface CounterManagerCollection of defined counter names.public void stop()
Copyright © 2022 JBoss by Red Hat. All rights reserved.