Class Registry<K,V>

java.lang.Object
org.serviceconnector.registry.Registry<K,V>
Type Parameters:
K - the key type
V - the value type
All Implemented Interfaces:
IRegistryMXBean
Direct Known Subclasses:
CacheModuleRegistry, ResponderRegistry, SCMPSessionCompositeRegistry, ServerRegistry, ServiceRegistry, SessionRegistry, SrvServiceRegistry, SubscriptionRegistry, WebSessionRegistry

public abstract class Registry<K,V> extends Object implements IRegistryMXBean
The Class Registry. Provides functionality for general registries.
Author:
JTraber
  • Field Details

    • registryMap

      protected Map<K,V> registryMap
      The registry map.
  • Constructor Details

    • Registry

      public Registry()
      Instantiates a new registry.
  • Method Details

    • put

      protected void put(K key, V value)
      Put an entry into map.
      Parameters:
      key - the key
      value - the value
    • get

      protected V get(K key)
      Gets an entry by key. If key is null - null will be returned.
      Parameters:
      key - the key
      Returns:
      the map bean
    • remove

      protected V remove(K key)
      Removes an entry by key.
      Parameters:
      key - the key
      Returns:
      the v
    • getSize

      public int getSize()
      Gets the size.
      Returns:
      the size
    • containsKey

      public boolean containsKey(K key)
      Looks up a key.
      Parameters:
      key - the key
      Returns:
      true, if successful
    • keySet

      public Set<K> keySet()
      Key set. The view's iterator is a "weakly consistent" iterator that will never throw ConcurrentModificationException, and guarantees to traverse elements as they existed upon construction of the iterator, and may (but is not guaranteed to) reflect any modifications subsequent to construction.
      Returns:
      the set
    • keySetArray

      public K[] keySetArray()
      Key set array.
      Returns:
      the k[]
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getEntries

      public RegistryEntryWrapperJMX[] getEntries()
      Gets the entries.
      Specified by:
      getEntries in interface IRegistryMXBean
      Returns:
      the entries