org.springframework.jmx.export.naming

Class KeyNamingStrategy

  • java.lang.Object
    • org.springframework.jmx.export.naming.KeyNamingStrategy
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected Log logger
      Log instance for this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void afterPropertiesSet()
      Merges the Properties configured in the mappings and mappingLocations into the final Properties instance used for ObjectName resolution.
      javax.management.ObjectName getObjectName(java.lang.Object managedBean, java.lang.String beanKey)
      Attempts to retrieve the ObjectName via the given key, trying to find a mapped value in the mappings first.
      void setMappingLocation(Resource location)
      Set a location of a properties file to be loaded, containing object name mappings.
      void setMappingLocations(Resource... mappingLocations)
      Set location of properties files to be loaded, containing object name mappings.
      void setMappings(java.util.Properties mappings)
      Set local properties, containing object name mappings, e.g.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        protected final Log logger
        Log instance for this class.
    • Constructor Detail

      • KeyNamingStrategy

        public KeyNamingStrategy()
    • Method Detail

      • setMappings

        public void setMappings(java.util.Properties mappings)
        Set local properties, containing object name mappings, e.g. via the "props" tag in XML bean definitions. These can be considered defaults, to be overridden by properties loaded from files.
      • setMappingLocation

        public void setMappingLocation(Resource location)
        Set a location of a properties file to be loaded, containing object name mappings.
      • setMappingLocations

        public void setMappingLocations(Resource... mappingLocations)
        Set location of properties files to be loaded, containing object name mappings.
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.io.IOException
        Merges the Properties configured in the mappings and mappingLocations into the final Properties instance used for ObjectName resolution.
        Specified by:
        afterPropertiesSet in interface InitializingBean
        Throws:
        java.io.IOException
      • getObjectName

        public javax.management.ObjectName getObjectName(java.lang.Object managedBean,
                                                         @Nullable
                                                         java.lang.String beanKey)
                                                  throws javax.management.MalformedObjectNameException
        Attempts to retrieve the ObjectName via the given key, trying to find a mapped value in the mappings first.
        Specified by:
        getObjectName in interface ObjectNamingStrategy
        Parameters:
        managedBean - the bean that will be exposed under the returned ObjectName
        beanKey - the key associated with this bean in the beans map passed to the MBeanExporter
        Returns:
        the ObjectName instance
        Throws:
        javax.management.MalformedObjectNameException - if the resulting ObjectName is invalid