Class JMXMBean

    • Constructor Detail

      • JMXMBean

        public JMXMBean​(Dn monitorEntryDN,
                        ServerContext serverContext)
                 throws MalformedObjectNameException
        Creates a new dynamic JMX MBean for use with the Directory Server.
        Parameters:
        monitorEntryDN - The DN of the monitoring entry with which this MBean is associated.
        serverContext - The server context
        Throws:
        MalformedObjectNameException - if we cannot build a valid JMX object name
    • Method Detail

      • getJmxName

        public static String getJmxName​(Dn monitorEntryDN)
        Creates a JMX object name string based on a DN.
        Parameters:
        monitorEntryDN - The DN of the monitoring entry with which this ObjectName is associated.
        Returns:
        The string representation of the JMX Object Name associated with the input DN.
      • addAlertGenerator

        public void addAlertGenerator​(AlertGenerator generator)
        Adds the provided alert generator to the set of alert generators associated with this JMX MBean.
        Parameters:
        generator - The alert generator to add to the set of alert generators for this JMX MBean.
      • removeAlertGenerator

        public void removeAlertGenerator​(AlertGenerator generator)
        Removes the provided alert generator from the set of alert generators associated with this JMX MBean.
        Parameters:
        generator - The alert generator to remove from the set of alert generators for this JMX MBean.
      • addMonitorProvider

        public void addMonitorProvider​(MonitorProvider component)
        Adds the given monitor provider to the set of components associated with this JMX MBean.
        Parameters:
        component - The component to add to the set of monitor providers for this JMX MBean.
      • removeMonitorProvider

        public void removeMonitorProvider​(MonitorProvider component)
        Removes the given monitor provider from the set of components associated with this JMX MBean.
        Parameters:
        component - The component to remove from the set of monitor providers for this JMX MBean.
      • setAttribute

        public void setAttribute​(Attribute attribute)
                          throws InvalidAttributeValueException
        Set the value of a specific attribute of the Dynamic MBean. In this case, it will always throw InvalidAttributeValueException because setting attribute values over JMX is currently not allowed.
        Specified by:
        setAttribute in interface DynamicMBean
        Parameters:
        attribute - The identification of the attribute to be set and the value it is to be set to.
        Throws:
        InvalidAttributeValueException - If the provided value is not acceptable for this MBean.
      • getAttributes

        public AttributeList getAttributes​(String[] attributes)
        Get the values of several attributes of the Dynamic MBean.
        Specified by:
        getAttributes in interface DynamicMBean
        Parameters:
        attributes - A list of the attributes to be retrieved.
        Returns:
        The list of attributes retrieved.
      • setAttributes

        public AttributeList setAttributes​(AttributeList attributes)
        Sets the values of several attributes of the Dynamic MBean.
        Specified by:
        setAttributes in interface DynamicMBean
        Parameters:
        attributes - A list of attributes: The identification of the attributes to be set and the values they are to be set to.
        Returns:
        The list of attributes that were set with their new values. In this case, the list will always be empty because we do not support setting attribute values over JMX.
      • invoke

        public Object invoke​(String actionName,
                             Object[] params,
                             String[] signature)
                      throws MBeanException
        Allows an action to be invoked on the Dynamic MBean.
        Specified by:
        invoke in interface DynamicMBean
        Parameters:
        actionName - The name of the action to be invoked.
        params - An array containing the parameters to be set when the action is invoked.
        signature - An array containing the signature of the action. The class objects will be loaded through the same class loader as the one used for loading the MBean on which action is invoked.
        Returns:
        The object returned by the action, which represents the result of invoking the action on the MBean specified.
        Throws:
        MBeanException - If a problem is encountered while invoking the method.
      • getMBeanInfo

        public MBeanInfo getMBeanInfo()
        Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.
        Specified by:
        getMBeanInfo in interface DynamicMBean
        Returns:
        An instance of MBeanInfo allowing all attributes and actions exposed by this Dynamic MBean to be retrieved.