Interface InfoMBean

All Superinterfaces:
SelfEmailingMBean
All Known Subinterfaces:
NotificationHandlerMBean, SummaryMBean
All Known Implementing Classes:
Info

public interface InfoMBean extends SelfEmailingMBean
Allows a set of MBean object names and attribute names to be specified for purposes of obtaining these later, e.g. to output to logs, e-mail, etc.

Supported API: true

Extendable: true
  • Method Details

    • getInfoItemsAsOpenData

      TabularData getInfoItemsAsOpenData() throws OpenDataException
      Structured representation of items to be obtained; see InfoItemsAsStrings for alternate string representation

      An array of CompositeData would make more sense here, but JMX consoles seem to fail to interpret this properly for display purposes when outside the context of a CompositeData or TabularData.

      Supported API: true

      Throws:
      OpenDataException
    • getInfoItemsAsStrings

      String[] getInfoItemsAsStrings()
      String representation of items to be obtained; format is: [index] mbeanObjectName mbeanAttributeName (displayName)

      Supported API: true
    • getInfoItemsPreview

      String[] getInfoItemsPreview()
      String preview representation of data currently selected by info items

      Supported API: true
    • getCustomDelegateFactoryClass

      @Deprecated String getCustomDelegateFactoryClass()
      Deprecated.
      THIS ATTRIBUTE IS OBSOLETE (since one can now have multiple custom delegate factories) and is retained purely for backwards compatibility.

      Returns name of custom delegate factory class.

      This method is retained purely for backwards compatibility and should no longer be used. It may either obtain the class name of the first delegate factory by an undefined internal iterator ordering or simply throw a runtime exception when there are multiple custom delegate factories specified.

      Supported API: true

    • setCustomDelegateFactoryClass

      @Deprecated void setCustomDelegateFactoryClass(String customDelegateFactoryClassname) throws ClassCastException, ClassNotFoundException, IllegalAccessException, InstantiationException
      Deprecated.
      THIS ATTRIBUTE IS OBSOLETE (since one can now have multiple custom delegate factories) and is retained purely for backwards compatibility

      Sets custom delegate factory class (removing all other factory instances) and using the class name as the factory name.

      This method is retained purely for backwards compatibility and should no longer be used.

      Supported API: true

      Throws:
      ClassCastException
      ClassNotFoundException
      IllegalAccessException
      InstantiationException
    • getCustomDelegateFactoryNames

      String[] getCustomDelegateFactoryNames()
      Names of custom delegate factories attached to this MBean

      Supported API: true
    • getCustomDelegateFactoryData

      TabularData getCustomDelegateFactoryData() throws OpenDataException
      Names and class of custom delegates

      Supported API: true
      Throws:
      OpenDataException
    • addCustomDelegateFactory

      @MBeanOperationImpact(1) void addCustomDelegateFactory(String factoryName, String factoryClass) throws ClassNotFoundException, InstantiationException, IllegalAccessException
      Add custom delegate factory instance and associate it with the given name.

      An attempt is made to find a constructor in the specified class taking a single String argument and call this constructor passing the specified name. If this fails, the no-arg constructor (which must be public) is used instead and an attempt is also made to call setName(String) on the instance. An attempt is also made to call setOwnerMBean(BaseObjectNamed) on the instance, passing it this MBean, so that any interested delegate factory can obtain this information.

      If the factory is a SelfAwareMBean, then the factory is registered as a child MBean of this MBean.

      The factory class must implement InfoDelegateFactory. The factory class should also override equals() to return 'true' for logically equivalent instances.

      Supported API: true

      Parameters:
      factoryName - Name to associate with custom delegate factory; will use factoryClass if this is null
      factoryClass - Name of custom delegate factory class; class must implement InfoDelegateFactory
      Throws:
      ClassNotFoundException
      InstantiationException
      IllegalAccessException
    • removeCustomDelegateFactory

      @MBeanOperationImpact(1) void removeCustomDelegateFactory(String factoryName)
      Remove the custom delegate factory with the specified name

      Supported API: true
      Parameters:
      factoryName - Name of custom delegate factory to remove
    • addInfoItem

      @MBeanOperationImpact(0) void addInfoItem(ObjectName mbeanObjectName, String mbeanAttributeName, String displayName)
      Add item to end of list of those to be obtained

      Supported API: true
      Parameters:
      mbeanObjectName - ObjectName (or ObjectNamePattern) of MBean(s) from which to obtain data
      mbeanAttributeName - Name of attribute in 'mbeanObjectName' to obtain; can use .itemName-style suffixes to select CompositeData fields
      displayName - Display name to use for this item; used when UseShortFormat is false and FormatString is unspecified
    • insertInfoItem

      @MBeanOperationImpact(1) void insertInfoItem(int infoItemIdx, ObjectName mbeanObjectName, String mbeanAttributeName, String displayName)
      Insert item into list of those to be obtained

      Supported API: true
      Parameters:
      infoItemIdx - Index of item to insert in front of
      mbeanObjectName - ObjectName (or ObjectNamePattern) of MBean(s) from which to obtain data
      mbeanAttributeName - Name of attribute in 'mbeanObjectName' to obtain; can use .itemName-style suffixes to select CompositeData fields
      displayName - Display name to use for this item; used when UseShortFormat is false and FormatString is unspecified
    • changeInfoItemDisplayName

      @MBeanOperationImpact(1) void changeInfoItemDisplayName(int infoItemIdx, String displayName)
      Add item to end of list of those to be obtained

      Supported API: true
      Parameters:
      infoItemIdx - Index of item to change
      displayName - Display name to use for this item; used when UseShortFormat is false and FormatString is unspecified
    • removeInfoItem

      @MBeanOperationImpact(1) void removeInfoItem(int infoItemIdx)
      Remove item from list of those to be obtained

      Supported API: true
      Parameters:
      infoItemIdx - Index of item to remove
    • removeInfoItems

      @MBeanOperationImpact(1) void removeInfoItems()
      Remove all items from list of those to be obtained

      Supported API: true