use of javax.management.MBeanNotificationInfo in project jdk8u_jdk by JetBrains.
the class MustBeValidCommand method main.
public static void main(String[] args) throws Exception {
// Instantiate the MBean server
//
final MBeanAttributeInfo[] atts = makeAttInfos(attributes);
final MBeanConstructorInfo[] ctors = makeCtorInfos(constructors);
final MBeanOperationInfo[] ops = makeOpInfos(operations);
final MBeanNotificationInfo[] notifs = makeNotifInfos(notificationclasses);
for (int i = 0; i < mbeanclasses.length; i++) {
System.out.println("Create an MBeanInfo: " + mbeanclasses[i][0]);
final MBeanInfo mbi = new MBeanInfo(mbeanclasses[i][1], mbeanclasses[i][0], atts, ctors, ops, notifs);
}
// Test OK!
//
System.out.println("All MBeanInfo successfuly created!");
System.out.println("Bye! Bye!");
}
use of javax.management.MBeanNotificationInfo in project jdk8u_jdk by JetBrains.
the class MustBeValidCommand method makeNotifInfos.
private static MBeanNotificationInfo[] makeNotifInfos(String[][] spec) {
final MBeanNotificationInfo[] result = new MBeanNotificationInfo[spec.length];
final String[] types = { "valid.type", "invalid-type" };
for (int i = 0; i < result.length; i++) {
System.out.println("\tCreate an MBeanNotificationInfo: " + spec[i][0]);
final MBeanNotificationInfo item = new MBeanNotificationInfo(types, spec[i][1], spec[i][0]);
result[i] = item;
}
return result;
}
use of javax.management.MBeanNotificationInfo in project aries by apache.
the class BundleState method getNotificationInfo.
/**
* @see javax.management.NotificationBroadcasterSupport#getNotificationInfo()
*/
public MBeanNotificationInfo[] getNotificationInfo() {
MBeanNotificationInfo eventInfo = new MBeanNotificationInfo(new String[] { BUNDLE_EVENT }, Notification.class.getName(), "A BundleEvent issued from the Framework describing a bundle lifecycle change");
MBeanNotificationInfo attributeChangeInfo = new MBeanNotificationInfo(new String[] { AttributeChangeNotification.ATTRIBUTE_CHANGE }, AttributeChangeNotification.class.getName(), "An attribute of this MBean has changed");
return new MBeanNotificationInfo[] { eventInfo, attributeChangeInfo };
}
use of javax.management.MBeanNotificationInfo in project aries by apache.
the class BlueprintState method getNotificationInfo.
/**
* @see javax.management.NotificationBroadcasterSupport#getNotificationInfo()
*/
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
String[] types = new String[] { BLUEPRINT_EVENT };
String name = Notification.class.getName();
String description = "A BlueprintEvent issued from the Blueprint Extender describing a blueprint bundle lifecycle change";
MBeanNotificationInfo info = new MBeanNotificationInfo(types, name, description);
return new MBeanNotificationInfo[] { info };
}
use of javax.management.MBeanNotificationInfo in project aries by apache.
the class RegistrableStandardEmitterMBean method getMBeanInfo.
/**
* @see javax.management.StandardMBean#getMBeanInfo()
*/
public MBeanInfo getMBeanInfo() {
MBeanInfo mbeanInfo = super.getMBeanInfo();
if (mbeanInfo != null) {
MBeanNotificationInfo[] notificationInfo;
Object impl = getImplementation();
if (impl instanceof NotificationEmitter) {
notificationInfo = ((NotificationEmitter) (impl)).getNotificationInfo();
} else {
notificationInfo = new MBeanNotificationInfo[0];
}
mbeanInfo = new MBeanInfo(mbeanInfo.getClassName(), mbeanInfo.getDescription(), mbeanInfo.getAttributes(), mbeanInfo.getConstructors(), mbeanInfo.getOperations(), notificationInfo);
}
return mbeanInfo;
}
Aggregations