Class OpenMBeanHelper

java.lang.Object
com.tangosol.net.management.OpenMBeanHelper

public class OpenMBeanHelper extends Object
A set of utility method for dealing with OpenMBean APIs because they stupidly have constructors that throw exceptions.
Since:
21.12.4
Author:
Jonathan Knight 2022.03.23
  • Constructor Details

    • OpenMBeanHelper

      public OpenMBeanHelper()
  • Method Details

    • createCompositeType

      public static CompositeType createCompositeType(String typeName, String description, String[] itemNames, String[] itemDescriptions, OpenType<?>[] itemTypes)
      Constructs a CompositeType instance, checking for the validity of the given parameters. The validity constraints are described below for each parameter.

      Note that the contents of the three array parameters itemNames, itemDescriptions and itemTypes are internally copied so that any subsequent modification of these arrays by the caller of this constructor has no impact on the constructed CompositeType instance.

      The Java class name of composite data values this composite type represents (ie the class name returned by the getClassName method) is set to the string value returned by CompositeData.class.getName().

      Parameters:
      typeName - The name given to the composite type this instance represents; cannot be a null or empty string.
      description - The human readable description of the composite type this instance represents; cannot be a null or empty string.
      itemNames - The names of the items contained in the composite data values described by this CompositeType instance; cannot be null and should contain at least one element; no element can be a null or empty string. Note that the order in which the item names are given is not important to differentiate a CompositeType instance from another; the item names are internally stored sorted in ascending alphanumeric order.
      itemDescriptions - The descriptions, in the same order as itemNames, of the items contained in the composite data values described by this CompositeType instance; should be of the same size as itemNames; no element can be null or an empty string.
      itemTypes - The open type instances, in the same order as itemNames, describing the items contained in the composite data values described by this CompositeType instance; should be of the same size as itemNames; no element can be null.
      Throws:
      IllegalArgumentException - If typeName or description is a null or empty string, or itemNames or itemDescriptions or itemTypes is null, or any element of itemNames or itemDescriptions is a null or empty string, or any element of itemTypes is null, or itemNames or itemDescriptions or itemTypes are not of the same size.
    • createTabularType

      public static TabularType createTabularType(String typeName, String description, CompositeType rowType, String[] indexNames)
      Constructs a TabularType instance, checking for the validity of the given parameters. The validity constraints are described below for each parameter.

      The Java class name of tabular data values this tabular type represents (ie the class name returned by the getClassName method) is set to the string value returned by TabularData.class.getName().

      Parameters:
      typeName - The name given to the tabular type this instance represents; cannot be a null or empty string.
       
      description - The human readable description of the tabular type this instance represents; cannot be a null or empty string.
       
      rowType - The type of the row elements of tabular data values described by this tabular type instance; cannot be null.
       
      indexNames - The names of the items the values of which are used to uniquely index each row element in the tabular data values described by this tabular type instance; cannot be null or empty. Each element should be an item name defined in rowType (no null or empty string allowed). It is important to note that the order of the item names in indexNames is used by the methods get and remove of class TabularData to match their array of values parameter to items.
       
      Throws:
      IllegalArgumentException - if rowType is null, or indexNames is a null or empty array, or an element in indexNames is a null or empty string, or typeName or description is a null or empty string.