Search in sources :

Example 6 with MBeanNotificationInfo

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!");
}
Also used : MBeanConstructorInfo(javax.management.MBeanConstructorInfo) MBeanNotificationInfo(javax.management.MBeanNotificationInfo) MBeanInfo(javax.management.MBeanInfo) MBeanOperationInfo(javax.management.MBeanOperationInfo) MBeanAttributeInfo(javax.management.MBeanAttributeInfo)

Example 7 with MBeanNotificationInfo

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;
}
Also used : MBeanNotificationInfo(javax.management.MBeanNotificationInfo)

Example 8 with MBeanNotificationInfo

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 };
}
Also used : MBeanNotificationInfo(javax.management.MBeanNotificationInfo) AttributeChangeNotification(javax.management.AttributeChangeNotification) AttributeChangeNotification(javax.management.AttributeChangeNotification) Notification(javax.management.Notification)

Example 9 with MBeanNotificationInfo

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 };
}
Also used : MBeanNotificationInfo(javax.management.MBeanNotificationInfo)

Example 10 with MBeanNotificationInfo

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;
}
Also used : MBeanNotificationInfo(javax.management.MBeanNotificationInfo) NotificationEmitter(javax.management.NotificationEmitter) MBeanInfo(javax.management.MBeanInfo)

Aggregations

MBeanNotificationInfo (javax.management.MBeanNotificationInfo)28 MBeanInfo (javax.management.MBeanInfo)10 MBeanOperationInfo (javax.management.MBeanOperationInfo)7 MBeanAttributeInfo (javax.management.MBeanAttributeInfo)6 MBeanConstructorInfo (javax.management.MBeanConstructorInfo)6 DescriptorSupport (javax.management.modelmbean.DescriptorSupport)5 MBeanParameterInfo (javax.management.MBeanParameterInfo)3 OpenMBeanAttributeInfo (javax.management.openmbean.OpenMBeanAttributeInfo)3 OpenMBeanAttributeInfoSupport (javax.management.openmbean.OpenMBeanAttributeInfoSupport)3 OpenMBeanConstructorInfo (javax.management.openmbean.OpenMBeanConstructorInfo)3 OpenMBeanConstructorInfoSupport (javax.management.openmbean.OpenMBeanConstructorInfoSupport)3 OpenMBeanInfoSupport (javax.management.openmbean.OpenMBeanInfoSupport)3 OpenMBeanOperationInfo (javax.management.openmbean.OpenMBeanOperationInfo)3 OpenMBeanOperationInfoSupport (javax.management.openmbean.OpenMBeanOperationInfoSupport)3 OpenMBeanParameterInfo (javax.management.openmbean.OpenMBeanParameterInfo)3 OpenMBeanParameterInfoSupport (javax.management.openmbean.OpenMBeanParameterInfoSupport)3 ArrayList (java.util.ArrayList)2 AttributeChangeNotification (javax.management.AttributeChangeNotification)2 Descriptor (javax.management.Descriptor)2 Notification (javax.management.Notification)2