org.opends.server.config
Class JMXMBean

java.lang.Object
  extended by org.opends.server.config.JMXMBean
All Implemented Interfaces:
javax.management.DynamicMBean, DirectoryServerMBean

@PublicAPI(stability=VOLATILE,
           mayInstantiate=true,
           mayExtend=false,
           mayInvoke=true)
public final class JMXMBean
extends java.lang.Object
implements javax.management.DynamicMBean, DirectoryServerMBean

This class defines a JMX MBean that can be registered with the Directory Server to provide monitoring and statistical information, provide read and/or read-write access to the configuration, and provide notifications and alerts if a significant event or severe/fatal error occurs.


Constructor Summary
JMXMBean(DN configEntryDN)
          Creates a new dynamic JMX MBean for use with the Directory Server.
 
Method Summary
 void addAlertGenerator(AlertGenerator generator)
          Adds the provided alert generator to the set of alert generators associated with this JMX MBean.
 void addInvokableComponent(InvokableComponent component)
          Adds the provided invokable component to the set of components associated with this JMX MBean.
 void addMonitorProvider(MonitorProvider<? extends MonitorProviderCfg> component)
          Adds the given monitor provider to the set of components associated with this JMX MBean.
 java.util.concurrent.CopyOnWriteArrayList<AlertGenerator> getAlertGenerators()
          Retrieves the set of alert generators for this JMX MBean.
 javax.management.Attribute getAttribute(java.lang.String attributeName)
          Obtain the value of a specific attribute of the Dynamic MBean.
 javax.management.AttributeList getAttributes(java.lang.String[] attributes)
          Get the values of several attributes of the Dynamic MBean.
 java.util.concurrent.CopyOnWriteArrayList<InvokableComponent> getInvokableComponents()
          Retrieves the set of invokable components associated with this JMX MBean.
static java.lang.String getJmxName(DN configEntryDN)
          Creates a JMX object name string based on a DN.
 javax.management.MBeanInfo getMBeanInfo()
          Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.
 java.util.concurrent.CopyOnWriteArrayList<MonitorProvider<? extends MonitorProviderCfg>> getMonitorProviders()
          Retrieves the set of monitor providers associated with this JMX MBean.
 javax.management.ObjectName getObjectName()
          Retrieves the JMX object name for this JMX MBean.
 java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature)
          Allows an action to be invoked on the Dynamic MBean.
 boolean removeAlertGenerator(AlertGenerator generator)
          Removes the provided alert generator from the set of alert generators associated with this JMX MBean.
 boolean removeInvokableComponent(InvokableComponent component)
          Removes the provided invokable component from the set of components associated with this JMX MBean.
 boolean removeMonitorProvider(MonitorProvider component)
          Removes the given monitor provider from the set of components associated with this JMX MBean.
 void setAttribute(javax.management.Attribute attribute)
          Set the value of a specific attribute of the Dynamic MBean.
 javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
          Sets the values of several attributes of the Dynamic MBean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMXMBean

public JMXMBean(DN configEntryDN)
Creates a new dynamic JMX MBean for use with the Directory Server.

Parameters:
configEntryDN - The DN of the configuration entry with which this MBean is associated.
Method Detail

getJmxName

public static java.lang.String getJmxName(DN configEntryDN)
Creates a JMX object name string based on a DN.

Parameters:
configEntryDN - The DN of the configuration entry with which this ObjectName is associated.
Returns:
The string representation of the JMX Object Name associated with the input DN.

getObjectName

public javax.management.ObjectName getObjectName()
Retrieves the JMX object name for this JMX MBean.

Specified by:
getObjectName in interface DirectoryServerMBean
Returns:
The JMX object name for this JMX MBean.

getAlertGenerators

public java.util.concurrent.CopyOnWriteArrayList<AlertGenerator> getAlertGenerators()
Retrieves the set of alert generators for this JMX MBean.

Returns:
The set of alert generators for this JMX MBean.

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 boolean 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.
Returns:
true if the alert generator was removed, or false if it was not associated with this MBean.

getInvokableComponents

public java.util.concurrent.CopyOnWriteArrayList<InvokableComponent> getInvokableComponents()
Retrieves the set of invokable components associated with this JMX MBean.

Returns:
The set of invokable components associated with this JMX MBean.

addInvokableComponent

public void addInvokableComponent(InvokableComponent component)
Adds the provided invokable component to the set of components associated with this JMX MBean.

Parameters:
component - The component to add to the set of invokable components for this JMX MBean.

removeInvokableComponent

public boolean removeInvokableComponent(InvokableComponent component)
Removes the provided invokable component from the set of components associated with this JMX MBean.

Parameters:
component - The component to remove from the set of invokable components for this JMX MBean.
Returns:
true if the specified component was successfully removed, or false if not.

getMonitorProviders

public java.util.concurrent.CopyOnWriteArrayList<MonitorProvider<? extends MonitorProviderCfg>> getMonitorProviders()
Retrieves the set of monitor providers associated with this JMX MBean.

Returns:
The set of monitor providers associated with this JMX MBean.

addMonitorProvider

public void addMonitorProvider(MonitorProvider<? extends MonitorProviderCfg> 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 boolean 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.
Returns:
true if the specified component was successfully removed, or false if not.

getAttribute

public javax.management.Attribute getAttribute(java.lang.String attributeName)
                                        throws javax.management.AttributeNotFoundException
Obtain the value of a specific attribute of the Dynamic MBean.

Specified by:
getAttribute in interface javax.management.DynamicMBean
Parameters:
attributeName - The name of the attribute to be retrieved.
Returns:
The requested attribute.
Throws:
javax.management.AttributeNotFoundException - If the specified attribute is not associated with this MBean.

setAttribute

public void setAttribute(javax.management.Attribute attribute)
                  throws javax.management.AttributeNotFoundException,
                         javax.management.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 javax.management.DynamicMBean
Parameters:
attribute - The identification of the attribute to be set and the value it is to be set to.
Throws:
javax.management.AttributeNotFoundException - If the specified attribute is not associated with this MBean.
javax.management.InvalidAttributeValueException - If the provided value is not acceptable for this MBean.

getAttributes

public javax.management.AttributeList getAttributes(java.lang.String[] attributes)
Get the values of several attributes of the Dynamic MBean.

Specified by:
getAttributes in interface javax.management.DynamicMBean
Parameters:
attributes - A list of the attributes to be retrieved.
Returns:
The list of attributes retrieved.

setAttributes

public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
Sets the values of several attributes of the Dynamic MBean.

Specified by:
setAttributes in interface javax.management.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 java.lang.Object invoke(java.lang.String actionName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws javax.management.MBeanException
Allows an action to be invoked on the Dynamic MBean.

Specified by:
invoke in interface javax.management.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:
javax.management.MBeanException - If a problem is encountered while invoking the method.

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo()
Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.

Specified by:
getMBeanInfo in interface javax.management.DynamicMBean
Returns:
An instance of MBeanInfo allowing all attributes and actions exposed by this Dynamic MBean to be retrieved.