org.apache.solr.core

## Class JmxMonitoredMap<K,V>

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.concurrent.ConcurrentHashMap<String,SolrInfoMBean>
    - - org.apache.solr.core.JmxMonitoredMap<K,V>

- All Implemented Interfaces:
    Serializable, ConcurrentMap<String,SolrInfoMBean>, Map<String,SolrInfoMBean>

      public class JmxMonitoredMap<K,V>
      extends ConcurrentHashMap<String,SolrInfoMBean>

  Responsible for finding (or creating) a MBeanServer from given configuration and registering all SolrInfoMBean objects with JMX.

  Please see http://wiki.apache.org/solr/SolrJmx for instructions on usage and configuration

  Since:
    solr 1.3
  See Also:
    `SolrConfig.JmxConfiguration`, Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `JmxMonitoredMap.JmxAugmentedSolrInfoMBean` SolrInfoMBean that provides JMX-specific statistics.

    - ### Nested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap

      `ConcurrentHashMap.KeySetView<K,V>`

    - ### Nested classes/interfaces inherited from class java.util.AbstractMap

      `AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

    - ### Nested classes/interfaces inherited from interface java.util.Map

      `Map.Entry<K,V>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JmxMonitoredMap(String coreName, String coreHashCode, SolrConfig.JmxConfiguration jmxConfig)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clears the map and unregisters all SolrInfoMBeans in the map from MBeanServer
    `MBeanServer` | `getServer()` For test verification
    `SolrInfoMBean` | `put(String key, SolrInfoMBean infoBean)` Adds the SolrInfoMBean to the map and registers the given SolrInfoMBean instance with the MBeanServer defined for this core.
    `SolrInfoMBean` | `remove(Object key)` Removes the SolrInfoMBean object at the given key and unregisters it from MBeanServer

    - ### Methods inherited from class java.util.concurrent.ConcurrentHashMap

      `compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, get, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, putAll, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values`

    - ### Methods inherited from class java.util.AbstractMap

      `clone`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### JmxMonitoredMap

          public JmxMonitoredMap(String coreName,
                                 String coreHashCode,
                                 SolrConfig.JmxConfiguration jmxConfig)

  - ### Method Detail

    - #### clear

          public void clear()

      Clears the map and unregisters all SolrInfoMBeans in the map from MBeanServer
      Specified by:
        `clear` in interface `Map<String,SolrInfoMBean>`
      Overrides:
        `clear` in class `ConcurrentHashMap<String,SolrInfoMBean>`

    - #### put

          public SolrInfoMBean put(String key,
                                   SolrInfoMBean infoBean)

      Adds the SolrInfoMBean to the map and registers the given SolrInfoMBean instance with the MBeanServer defined for this core. If a SolrInfoMBean is already registered with the MBeanServer then it is unregistered and then re-registered.
      Specified by:
        `put` in interface `Map<String,SolrInfoMBean>`
      Overrides:
        `put` in class `ConcurrentHashMap<String,SolrInfoMBean>`
      Parameters:
        `key` - the JMX type name for this SolrInfoMBean
        `infoBean` - the SolrInfoMBean instance to be registered

    - #### remove

          public SolrInfoMBean remove(Object key)

      Removes the SolrInfoMBean object at the given key and unregisters it from MBeanServer
      Specified by:
        `remove` in interface `Map<String,SolrInfoMBean>`
      Overrides:
        `remove` in class `ConcurrentHashMap<String,SolrInfoMBean>`
      Parameters:
        `key` - the JMX type name for this SolrInfoMBean

    - #### getServer

          public MBeanServer getServer()

      For test verification

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.