Example Creating an instance of MBeanInfo
public class Queue extends Basic implements DynamicMBean . . . private MBeanInfo _MBeanInfo . . . public static final String NOTIF_STALLED_FULL public static final String NOTIF_STALLED_EMPTY sample.Queue.stalled.empty . . . public Queue int queueSize . . . Attributes attributeInfo 0 new MBeanAttributeInfo QueueSize, Integer.TYPE.getName , Maximum number of items the queue may contain at one time., true, true, false attributeInfo 1 new MBeanAttributeInfo NumberOfConsumers, Integer.TYPE.getName ,...
CompositeDataSupport
This class implements the CompositeData interface. If we need to create a CompositeData object, we use one of this class's constructors public CompositeDataSupport CompositeType compositeType, String itemNames, Object itemValues public CompositeDataSupport CompositeType compositeType, Map items throws OpenDataException . . . The first constructor takes a CompositeType object, a String array of item names, and an Object array of item values in the exact order of the item names. Each of the item...
Example Describing a complex data type using CompositeType
first describe the attribute names String itemNames NumberOfFloors, Height, NumberOfElevators, OfficeSpace next describe the attribute descriptions String itemDescriptions The number of floors stories the building has, The height of the building in feet, Whether or not the building has underground parking, The total number of elevators in the building, The amount of office space in square feet next describe the data type of each item OpenType itemTypes CompositeType buildingType new...
Example The significant constructors of ModelMBeanOperationInfo
public class ModelMBeanOperationInfo extends MBeanOperationInfo implements DescriptorAccess . . . public ModelMBeanOperationInfo String description, public ModelMBeanOperationInfo String description, public ModelMBeanOperationInfo String name, String description, MBeanParameterInfo signature, String type, int impact public ModelMBeanOperationInfo String name, String description, MBeanParameterInfo signature, String type, int impact, Notice the emphasized lines in Example 4-4. The second and...