use of javax.management.modelmbean.ModelMBeanNotificationInfo in project jdk8u_jdk by JetBrains.
the class MBeanInfoInteropTest method init.
private static void init() throws Exception {
mbai = new MBeanAttributeInfo("name", "type", "descr", true, false, false);
mbpi = new MBeanParameterInfo("name", "type", "descr");
MBeanParameterInfo[] params = new MBeanParameterInfo[] { mbpi };
mbci1 = new MBeanConstructorInfo("name", "descr", null);
mbci2 = new MBeanConstructorInfo("name", "descr", params);
mbni1 = new MBeanNotificationInfo(null, "name", "descr");
mbni2 = new MBeanNotificationInfo(new String[] { "type" }, "name", "descr");
mboi1 = new MBeanOperationInfo("name", "descr", null, "type", ACTION);
mboi2 = new MBeanOperationInfo("name", "descr", params, "type", INFO);
mbi1 = new MBeanInfo("class", "descr", null, null, null, null);
mbi2 = new MBeanInfo("class", "descr", new MBeanAttributeInfo[] { mbai }, new MBeanConstructorInfo[] { mbci1, mbci2 }, new MBeanOperationInfo[] { mboi1, mboi2 }, new MBeanNotificationInfo[] { mbni1, mbni2 });
ombai1 = new OpenMBeanAttributeInfoSupport("name", "descr", INTEGER, true, false, false);
ombai2 = new OpenMBeanAttributeInfoSupport("name", "descr", INTEGER, true, false, false, 5);
ombai3 = new OpenMBeanAttributeInfoSupport("name", "descr", INTEGER, true, false, false, 5, 1, 6);
ombai4 = new OpenMBeanAttributeInfoSupport("name", "descr", INTEGER, true, false, false, 5, new Integer[] { 2, 3, 5, 7 });
ombpi1 = new OpenMBeanParameterInfoSupport("name1", "descr", INTEGER);
ombpi2 = new OpenMBeanParameterInfoSupport("name2", "descr", INTEGER, 5);
ombpi3 = new OpenMBeanParameterInfoSupport("name3", "descr", INTEGER, 5, 1, 6);
ombpi4 = new OpenMBeanParameterInfoSupport("name4", "descr", INTEGER, 5, new Integer[] { 2, 3, 5, 7 });
OpenMBeanParameterInfo[] oparams = { ombpi1, ombpi2, ombpi3, ombpi4 };
ombci1 = new OpenMBeanConstructorInfoSupport("name", "descr", null);
ombci2 = new OpenMBeanConstructorInfoSupport("name", "descr", oparams);
omboi1 = new OpenMBeanOperationInfoSupport("name", "descr", null, INTEGER, ACTION);
omboi2 = new OpenMBeanOperationInfoSupport("name", "descr", oparams, INTEGER, ACTION);
ombi1 = new OpenMBeanInfoSupport("class", "descr", null, null, null, null);
ombi2 = new OpenMBeanInfoSupport("class", "descr", new OpenMBeanAttributeInfo[] { ombai1, ombai2, ombai3, ombai4 }, new OpenMBeanConstructorInfo[] { ombci1, ombci2 }, new OpenMBeanOperationInfo[] { omboi1, omboi2 }, new MBeanNotificationInfo[] { mbni1, mbni2 });
Descriptor attrd = new DescriptorSupport(new String[] { "name=name", "descriptorType=attribute" });
mmbai1 = new ModelMBeanAttributeInfo("name", "type", "descr", true, false, false);
mmbai2 = new ModelMBeanAttributeInfo("name", "type", "descr", true, false, false, attrd);
Descriptor constrd = new DescriptorSupport(new String[] { "name=name", "descriptorType=operation", "role=constructor" });
mmbci1 = new ModelMBeanConstructorInfo("name", "descr", null);
mmbci2 = new ModelMBeanConstructorInfo("name", "descr", null, constrd);
mmbci3 = new ModelMBeanConstructorInfo("name", "descr", params);
mmbci4 = new ModelMBeanConstructorInfo("name", "descr", params, constrd);
Descriptor operd = new DescriptorSupport(new String[] { "name=name", "descriptorType=operation" });
mmboi1 = new ModelMBeanOperationInfo("name", "descr", null, "type", ACTION);
mmboi2 = new ModelMBeanOperationInfo("name", "descr", null, "type", ACTION, operd);
mmboi3 = new ModelMBeanOperationInfo("name", "descr", params, "type", ACTION);
mmboi4 = new ModelMBeanOperationInfo("name", "descr", params, "type", ACTION, operd);
Descriptor notifd = new DescriptorSupport(new String[] { "name=name", "descriptorType=notification" });
mmbni1 = new ModelMBeanNotificationInfo(null, "name", "descr");
mmbni2 = new ModelMBeanNotificationInfo(null, "name", "descr", notifd);
mmbni3 = new ModelMBeanNotificationInfo(new String[] { "type" }, "name", "descr");
mmbni4 = new ModelMBeanNotificationInfo(new String[] { "type" }, "name", "descr", notifd);
Descriptor mbeand = new DescriptorSupport(new String[] { "name=name", "descriptorType=mbean" });
mmbi1 = new ModelMBeanInfoSupport("class", "descr", null, null, null, null);
mmbi2 = new ModelMBeanInfoSupport("class", "descr", null, null, null, null, mbeand);
mmbi3 = new ModelMBeanInfoSupport("class", "descr", new ModelMBeanAttributeInfo[] { mmbai1, mmbai2 }, new ModelMBeanConstructorInfo[] { mmbci1, mmbci2, mmbci3, mmbci4 }, new ModelMBeanOperationInfo[] { mmboi1, mmboi2, mmboi3, mmboi4 }, new ModelMBeanNotificationInfo[] { mmbni1, mmbni2, mmbni3, mmbni4 });
mmbi4 = new ModelMBeanInfoSupport("class", "descr", new ModelMBeanAttributeInfo[] { mmbai1, mmbai2 }, new ModelMBeanConstructorInfo[] { mmbci1, mmbci2, mmbci3, mmbci4 }, new ModelMBeanOperationInfo[] { mmboi1, mmboi2, mmboi3, mmboi4 }, new ModelMBeanNotificationInfo[] { mmbni1, mmbni2, mmbni3, mmbni4 }, mbeand);
objects = new Serializable[] { mbai, mbpi, mbci1, mbci2, mbni1, mbni2, mboi1, mboi2, mbi1, mbi2, ombai1, ombai2, ombai3, ombai4, ombpi1, ombpi2, ombpi3, ombpi4, ombci1, ombci2, omboi1, omboi2, ombi1, ombi2, mmbai1, mmbai2, mmbci1, mmbci2, mmbci3, mmbci4, mmboi1, mmboi2, mmboi3, mmboi4, mmbni1, mmbni2, mmbni3, mmbni4 };
}
use of javax.management.modelmbean.ModelMBeanNotificationInfo in project spring-framework by spring-projects.
the class MetadataMBeanInfoAssembler method getNotificationInfo.
/**
* Reads the {@link ManagedNotification} metadata from the {@code Class} of the managed resource
* and generates and returns the corresponding {@link ModelMBeanNotificationInfo} metadata.
*/
@Override
protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean, String beanKey) {
ManagedNotification[] notificationAttributes = obtainAttributeSource().getManagedNotifications(getClassToExpose(managedBean));
ModelMBeanNotificationInfo[] notificationInfos = new ModelMBeanNotificationInfo[notificationAttributes.length];
for (int i = 0; i < notificationAttributes.length; i++) {
ManagedNotification attribute = notificationAttributes[i];
notificationInfos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(attribute);
}
return notificationInfos;
}
Aggregations