Class Info<T>

Type Parameters:
T - Type of custom delegate produced by custom delegate factories
All Implemented Interfaces:
DynamicMBean, MBeanRegistration, BaseObjectNamed, InfoMBean, SelfEmailingMBean

public abstract class Info<T> extends SelfAwareMBean implements InfoMBean
Provides configurable collection of MBean info via getInfoData() routine. Intended for re-use to get collect data for logging summaries, e-mail notifications, etc.

Supported API: true

Extendable: true
  • Constructor Details

  • Method Details

    • getCustomDelegates

      protected List<T> getCustomDelegates()
      Returns list of custom delegates. [For use by subclasses.]

      Supported API: true
    • getInfoItemsPreview

      protected String[] getInfoItemsPreview(ObjectName defaultObjectName)
      Same as getInfoItemsPreview() but is given a default ObjectName for cases in which an ObjectName was left unspecified.

      Supported API: true
    • getInfoData

      protected void getInfoData(ObjectName defaultObjectName, List<Info.Item> outputItems, List<Collection<ObjectName>> outputObjectNameCollList, List<Object> outputValueList)
      Collects MBean data specified by current set of Item objects. All lists arguments are for output purposes and are populated with output data in parallel with one another except in cases where 'null' is passed, in which case no data is returned for the given argument (obviously).

      Supported API: true
      Parameters:
      defaultObjectName - ObjectName to use in cases where an Item does not specify an ObjectName
      outputItems - populated with current Item objects
      outputObjectNameCollList - populated with ObjectNames indicated by each Item appended to outputItems
      outputValueList - populated with attribute values corresponding to each Item appended to outputItems
    • insertInfoItem

      protected void insertInfoItem(int idx, ObjectName mbeanObjectName, String mbeanAttributeName, String displayName, boolean allowNullObjectName)
      Construct Item object from data specified and insert it into list of Items. If 'allowNullObjectName' is true, then allow 'mbeanObjectName' to be null, otherwise throw a NullPointerException if it is null.

      Supported API: true
    • addInfoItem

      protected void addInfoItem(ObjectName mbeanObjectName, String mbeanAttributeName, String displayName, boolean allowNullObjectName)
      Construct Item object from data specified and append it to list of Items. If 'allowNullObjectName' is true, then allow 'mbeanObjectName' to be null, otherwise throw a NullPointerException if it is null.

      Supported API: true
    • getCustomDelegateFactoryClass

      @Deprecated public String getCustomDelegateFactoryClass()
      Deprecated.
      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

      Specified by:
      getCustomDelegateFactoryClass in interface InfoMBean
    • setCustomDelegateFactoryClass

      @Deprecated protected void setCustomDelegateFactoryClass(String customDelegateFactoryClassname, Class requiredBaseClass) throws ClassCastException, ClassNotFoundException, IllegalAccessException, InstantiationException
      Deprecated.
      Sets custom delegate factory class (removing all other factory instances) and using the class name as the factory name.

      Though the factory is set by class name, an instance is created and held for re-use. It is also persisted, assuming the instance can be persisted via XMLEncoder. Finally, if the factory instance extends SelfAwareMBean then it is registered as a MBean child of this MBean and managed as such throughout the lifecycle of this MBean.

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

      Supported API: true

      Parameters:
      customDelegateFactoryClassname - Name of custom delegate factory class
      requiredBaseClass - Class delegate factory class is required to implement or extend
      Throws:
      ClassCastException
      ClassNotFoundException
      IllegalAccessException
      InstantiationException
    • getCustomDelegateFactory

      @Deprecated public InfoDelegateFactory<T> getCustomDelegateFactory()
      Deprecated.
      Returns instance of a custom delegate factory or null if no custom delegates have been specified.

      This method is retained purely for backwards compatibility and should no longer be used. It may either obtain 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

    • getCustomDelegate

      @Deprecated public T getCustomDelegate()
      Deprecated.
      Return custom delegate produced by a custom delegate factory's getInstance() method or null if no custom delegates have been specified.

      This method is retained purely for backwards compatibility and should no longer be used. It may either obtain a delegate from 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