Java Code Examples for javax.management.MBeanNotificationInfo

The following are top voted examples for showing how to use javax.management.MBeanNotificationInfo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: tqdev-metrics   File: JmxReporter.java   Source Code and License 6 votes vote down vote up
@Override
public MBeanInfo getMBeanInfo() {

	ArrayList<OpenMBeanAttributeInfoSupport> attributes = new ArrayList<>();

	attributes.add(new OpenMBeanAttributeInfoSupport("enabled", "enabled", SimpleType.BOOLEAN, true, true, true));
	for (String type : registry.getTypes()) {
		attributes.add(new OpenMBeanAttributeInfoSupport(type, type, getCompositeType(type), true, false, false));
	}

	OpenMBeanParameterInfo[] params = new OpenMBeanParameterInfoSupport[0];
	OpenMBeanOperationInfoSupport reset = new OpenMBeanOperationInfoSupport("reset", "Reset all Metrics", params,
			SimpleType.VOID, MBeanOperationInfo.ACTION);

	OpenMBeanInfoSupport PSOMBInfo = new OpenMBeanInfoSupport(this.getClass().getName(), description,
			attributes.toArray(new OpenMBeanAttributeInfoSupport[0]), new OpenMBeanConstructorInfoSupport[0],
			new OpenMBeanOperationInfoSupport[] { reset }, new MBeanNotificationInfo[0]);

	return PSOMBInfo;
}
 
Example 2
Project: lazycat   File: StandardContext.java   Source Code and License 6 votes vote down vote up
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
	// FIXME: i18n
	if (notificationInfo == null) {
		notificationInfo = new MBeanNotificationInfo[] {
				new MBeanNotificationInfo(new String[] { "j2ee.object.created" }, Notification.class.getName(),
						"web application is created"),
				new MBeanNotificationInfo(new String[] { "j2ee.state.starting" }, Notification.class.getName(),
						"change web application is starting"),
				new MBeanNotificationInfo(new String[] { "j2ee.state.running" }, Notification.class.getName(),
						"web application is running"),
				new MBeanNotificationInfo(new String[] { "j2ee.state.stopping" }, Notification.class.getName(),
						"web application start to stopped"),
				new MBeanNotificationInfo(new String[] { "j2ee.object.stopped" }, Notification.class.getName(),
						"web application is stopped"),
				new MBeanNotificationInfo(new String[] { "j2ee.object.deleted" }, Notification.class.getName(),
						"web application is deleted") };

	}

	return notificationInfo;
}
 
Example 3
Project: OpenJSharp   File: MBeanIntrospector.java   Source Code and License 6 votes vote down vote up
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 4
Project: OpenJSharp   File: CommunicatorServer.java   Source Code and License 6 votes vote down vote up
/**
 * Returns an array of MBeanNotificationInfo objects describing
 * the notification types sent by this CommunicatorServer.
 * There is only one type of notifications sent by the CommunicatorServer:
 * it is <tt>{@link javax.management.AttributeChangeNotification}</tt>,
 * sent when the <tt>State</tt> attribute of this CommunicatorServer
 * changes.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {

    // Initialize notifInfos on first call to getNotificationInfo()
    //
    if (notifInfos == null) {
        notifInfos = new MBeanNotificationInfo[1];
        String[] notifTypes = {
            AttributeChangeNotification.ATTRIBUTE_CHANGE};
        notifInfos[0] = new MBeanNotificationInfo( notifTypes,
                 AttributeChangeNotification.class.getName(),
                 "Sent to notify that the value of the State attribute "+
                 "of this CommunicatorServer instance has changed.");
    }

    return notifInfos.clone();
}
 
Example 5
Project: OpenJSharp   File: RelationService.java   Source Code and License 6 votes vote down vote up
/**
 * Returns a NotificationInfo object containing the name of the Java class
 * of the notification and the notification types sent.
 */
public MBeanNotificationInfo[] getNotificationInfo() {

    RELATION_LOGGER.entering(RelationService.class.getName(),
            "getNotificationInfo");

    String ntfClass = "javax.management.relation.RelationNotification";

    String[] ntfTypes = new String[] {
        RelationNotification.RELATION_BASIC_CREATION,
        RelationNotification.RELATION_MBEAN_CREATION,
        RelationNotification.RELATION_BASIC_UPDATE,
        RelationNotification.RELATION_MBEAN_UPDATE,
        RelationNotification.RELATION_BASIC_REMOVAL,
        RelationNotification.RELATION_MBEAN_REMOVAL,
    };

    String ntfDesc = "Sent when a relation is created, updated or deleted.";

    MBeanNotificationInfo ntfInfo =
        new MBeanNotificationInfo(ntfTypes, ntfClass, ntfDesc);

    RELATION_LOGGER.exiting(RelationService.class.getName(),
            "getNotificationInfo");
    return new MBeanNotificationInfo[] {ntfInfo};
}
 
Example 6
Project: lazycat   File: StandardWrapper.java   Source Code and License 6 votes vote down vote up
@Override
public MBeanNotificationInfo[] getNotificationInfo() {

	if (notificationInfo == null) {
		notificationInfo = new MBeanNotificationInfo[] {
				new MBeanNotificationInfo(new String[] { "j2ee.object.created" }, Notification.class.getName(),
						"servlet is created"),
				new MBeanNotificationInfo(new String[] { "j2ee.state.starting" }, Notification.class.getName(),
						"servlet is starting"),
				new MBeanNotificationInfo(new String[] { "j2ee.state.running" }, Notification.class.getName(),
						"servlet is running"),
				new MBeanNotificationInfo(new String[] { "j2ee.state.stopped" }, Notification.class.getName(),
						"servlet start to stopped"),
				new MBeanNotificationInfo(new String[] { "j2ee.object.stopped" }, Notification.class.getName(),
						"servlet is stopped"),
				new MBeanNotificationInfo(new String[] { "j2ee.object.deleted" }, Notification.class.getName(),
						"servlet is deleted") };
	}

	return notificationInfo;
}
 
Example 7
Project: openjdk-jdk10   File: MustBeValidCommand.java   Source Code and License 6 votes vote down vote up
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!");
}
 
Example 8
Project: jdk8u-jdk   File: ResultLogManager.java   Source Code and License 6 votes vote down vote up
/**
 * This MBean emits three kind of notifications:
 * <pre>
 *    <i>com.sun.jmx.examples.scandir.log.file.switched</i>
 *    <i>com.sun.jmx.examples.scandir.log.memory.full</i>
 *    <i>com.sun.jmx.examples.scandir.log.memory.cleared</i>
 * </pre>
 **/
public MBeanNotificationInfo[] getNotificationInfo() {
    return new MBeanNotificationInfo[] {
        new MBeanNotificationInfo(new String[] {
            LOG_FILE_CHANGED},
                Notification.class.getName(),
                "Emitted when the log file is switched")
                ,
        new MBeanNotificationInfo(new String[] {
            MEMORY_LOG_MAX_CAPACITY},
                Notification.class.getName(),
                "Emitted when the memory log capacity is reached")
                ,
        new MBeanNotificationInfo(new String[] {
            MEMORY_LOG_CLEARED},
                Notification.class.getName(),
                "Emitted when the memory log is cleared")
    };
}
 
Example 9
Project: jdk8u-jdk   File: MBeanIntrospector.java   Source Code and License 6 votes vote down vote up
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 10
Project: jdk8u-jdk   File: RelationService.java   Source Code and License 6 votes vote down vote up
/**
 * Returns a NotificationInfo object containing the name of the Java class
 * of the notification and the notification types sent.
 */
public MBeanNotificationInfo[] getNotificationInfo() {

    RELATION_LOGGER.entering(RelationService.class.getName(),
            "getNotificationInfo");

    String ntfClass = "javax.management.relation.RelationNotification";

    String[] ntfTypes = new String[] {
        RelationNotification.RELATION_BASIC_CREATION,
        RelationNotification.RELATION_MBEAN_CREATION,
        RelationNotification.RELATION_BASIC_UPDATE,
        RelationNotification.RELATION_MBEAN_UPDATE,
        RelationNotification.RELATION_BASIC_REMOVAL,
        RelationNotification.RELATION_MBEAN_REMOVAL,
    };

    String ntfDesc = "Sent when a relation is created, updated or deleted.";

    MBeanNotificationInfo ntfInfo =
        new MBeanNotificationInfo(ntfTypes, ntfClass, ntfDesc);

    RELATION_LOGGER.exiting(RelationService.class.getName(),
            "getNotificationInfo");
    return new MBeanNotificationInfo[] {ntfInfo};
}
 
Example 11
Project: openjdk-jdk10   File: Basic.java   Source Code and License 6 votes vote down vote up
public MBeanNotificationInfo[] getNotificationInfo() {
    if (notifDescriptorAtt == null) {
        initNotifDescriptorAtt();
    }

    return new MBeanNotificationInfo[]{
                new MBeanNotificationInfo(new String[]{
                    NOTIF_TYPE_0
                },
                javax.management.Notification.class.getName(),
                "Standard JMX Notification",
                notifDescriptorAtt),
                new MBeanNotificationInfo(new String[]{
                    NOTIF_TYPE_1
                },
                SqeNotification.class.getName(),
                "SQE Notification",
                notifDescriptorAtt)
            };
}
 
Example 12
Project: jdk8u-jdk   File: MustBeValidCommand.java   Source Code and License 6 votes vote down vote up
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!");
}
 
Example 13
Project: jdk8u-jdk   File: Basic.java   Source Code and License 6 votes vote down vote up
public MBeanNotificationInfo[] getNotificationInfo() {
    if (notifDescriptorAtt == null) {
        initNotifDescriptorAtt();
    }

    return new MBeanNotificationInfo[]{
                new MBeanNotificationInfo(new String[]{
                    NOTIF_TYPE_0
                },
                javax.management.Notification.class.getName(),
                "Standard JMX Notification",
                notifDescriptorAtt),
                new MBeanNotificationInfo(new String[]{
                    NOTIF_TYPE_1
                },
                SqeNotification.class.getName(),
                "SQE Notification",
                notifDescriptorAtt)
            };
}
 
Example 14
Project: jdk8u-jdk   File: MXBeanInteropTest2.java   Source Code and License 6 votes vote down vote up
private void printMBeanInfo(MBeanInfo mbInfo) {
    System.out.println("Description " + mbInfo.getDescription());

    for (MBeanConstructorInfo ctor : mbInfo.getConstructors()) {
        System.out.println("Constructor " + ctor.getName());
    }

    for (MBeanAttributeInfo att : mbInfo.getAttributes()) {
        System.out.println("Attribute " + att.getName()
        + " [" + att.getType() + "]");
    }

    for (MBeanOperationInfo oper : mbInfo.getOperations()) {
        System.out.println("Operation " + oper.getName());
    }

    for (MBeanNotificationInfo notif : mbInfo.getNotifications()) {
        System.out.println("Notification " + notif.getName());
    }
}
 
Example 15
Project: openjdk-jdk10   File: MXBeanNotifTest.java   Source Code and License 6 votes vote down vote up
private int checkMBeanInfo(MBeanInfo mbi, Descriptor refDescr) {
    MBeanNotificationInfo[] notifsInfo = mbi.getNotifications();
    int res = 0;

    for (MBeanNotificationInfo mbni : notifsInfo) {
        if ( mbni.getDescriptor().equals(refDescr) ) {
            System.out.println("(OK)");
        } else {
            System.out.println("(ERROR) Descriptor of the notification is "
                    + mbni.getDescriptor()
                    + " as we expect "
                    + refDescr);
            res++;
        }
    }

    return res;
}
 
Example 16
Project: openjdk-jdk10   File: MBeanIntrospector.java   Source Code and License 6 votes vote down vote up
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 17
Project: openjdk-jdk10   File: RelationService.java   Source Code and License 6 votes vote down vote up
/**
 * Returns a NotificationInfo object containing the name of the Java class
 * of the notification and the notification types sent.
 */
public MBeanNotificationInfo[] getNotificationInfo() {

    RELATION_LOGGER.log(Level.TRACE, "ENTRY");

    String ntfClass = "javax.management.relation.RelationNotification";

    String[] ntfTypes = new String[] {
        RelationNotification.RELATION_BASIC_CREATION,
        RelationNotification.RELATION_MBEAN_CREATION,
        RelationNotification.RELATION_BASIC_UPDATE,
        RelationNotification.RELATION_MBEAN_UPDATE,
        RelationNotification.RELATION_BASIC_REMOVAL,
        RelationNotification.RELATION_MBEAN_REMOVAL,
    };

    String ntfDesc = "Sent when a relation is created, updated or deleted.";

    MBeanNotificationInfo ntfInfo =
        new MBeanNotificationInfo(ntfTypes, ntfClass, ntfDesc);

    RELATION_LOGGER.log(Level.TRACE, "RETURN");
    return new MBeanNotificationInfo[] {ntfInfo};
}
 
Example 18
Project: openjdk-jdk10   File: MXBeanInteropTest2.java   Source Code and License 6 votes vote down vote up
private void printMBeanInfo(MBeanInfo mbInfo) {
    System.out.println("Description " + mbInfo.getDescription());

    for (MBeanConstructorInfo ctor : mbInfo.getConstructors()) {
        System.out.println("Constructor " + ctor.getName());
    }

    for (MBeanAttributeInfo att : mbInfo.getAttributes()) {
        System.out.println("Attribute " + att.getName()
        + " [" + att.getType() + "]");
    }

    for (MBeanOperationInfo oper : mbInfo.getOperations()) {
        System.out.println("Operation " + oper.getName());
    }

    for (MBeanNotificationInfo notif : mbInfo.getNotifications()) {
        System.out.println("Notification " + notif.getName());
    }
}
 
Example 19
Project: tomcat7   File: ConnectionPool.java   Source Code and License 5 votes vote down vote up
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
    MBeanNotificationInfo[] pres = super.getNotificationInfo();
    MBeanNotificationInfo[] loc = getDefaultNotificationInfo();
    MBeanNotificationInfo[] aug = new MBeanNotificationInfo[pres.length + loc.length];
    if (pres.length>0) System.arraycopy(pres, 0, aug, 0, pres.length);
    if (loc.length >0) System.arraycopy(loc, 0, aug, pres.length, loc.length);
    return aug;
}
 
Example 20
Project: tomcat7   File: ConnectionPool.java   Source Code and License 5 votes vote down vote up
public static MBeanNotificationInfo[] getDefaultNotificationInfo() {
    String[] types = new String[] {NOTIFY_INIT, NOTIFY_CONNECT, NOTIFY_ABANDON, SLOW_QUERY_NOTIFICATION,
            FAILED_QUERY_NOTIFICATION, SUSPECT_ABANDONED_NOTIFICATION, POOL_EMPTY, SUSPECT_RETURNED_NOTIFICATION};
    String name = Notification.class.getName();
    String description = "A connection pool error condition was met.";
    MBeanNotificationInfo info = new MBeanNotificationInfo(types, name, description);
    return new MBeanNotificationInfo[] {info};
}
 
Example 21
Project: lams   File: StandardContext.java   Source Code and License 5 votes vote down vote up
public MBeanNotificationInfo[] getNotificationInfo() {
	// FIXME: i18n
	if(notificationInfo == null) {
		notificationInfo = new MBeanNotificationInfo[]{
				new MBeanNotificationInfo(new String[] {
				"j2ee.object.created"},
	Notification.class.getName(),
	"web application is created"
				), 
	new MBeanNotificationInfo(new String[] {
	"j2ee.state.starting"},
	Notification.class.getName(),
	"change web application is starting"
	),
	new MBeanNotificationInfo(new String[] {
	"j2ee.state.running"},
	Notification.class.getName(),
	"web application is running"
	),
	new MBeanNotificationInfo(new String[] {
	"j2ee.state.stopped"},
	Notification.class.getName(),
	"web application start to stopped"
	),
	new MBeanNotificationInfo(new String[] {
	"j2ee.object.stopped"},
	Notification.class.getName(),
	"web application is stopped"
	),
	new MBeanNotificationInfo(new String[] {
	"j2ee.object.deleted"},
	Notification.class.getName(),
	"web application is deleted"
	)
		};
		
	}
	
	return notificationInfo;
}
 
Example 22
Project: openjdk-jdk10   File: MustBeValidCommand.java   Source Code and License 5 votes vote down vote up
static private 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;
}
 
Example 23
Project: OpenJSharp   File: GarbageCollectorImpl.java   Source Code and License 5 votes vote down vote up
public MBeanNotificationInfo[] getNotificationInfo() {
    synchronized (this) {
        if (notifInfo == null) {
             notifInfo = new MBeanNotificationInfo[1];
             notifInfo[0] = new MBeanNotificationInfo(gcNotifTypes,
                                                      notifName,
                                                      "GC Notification");
        }
    }
    return notifInfo;
}
 
Example 24
Project: OpenJSharp   File: MemoryImpl.java   Source Code and License 5 votes vote down vote up
public MBeanNotificationInfo[] getNotificationInfo() {
    synchronized (this) {
        if (notifInfo == null) {
             notifInfo = new MBeanNotificationInfo[1];
             notifInfo[0] = new MBeanNotificationInfo(notifTypes,
                                                      notifName,
                                                      "Memory Notification");
        }
    }
    return notifInfo;
}
 
Example 25
Project: OpenJSharp   File: MemoryManagerImpl.java   Source Code and License 5 votes vote down vote up
public MBeanNotificationInfo[] getNotificationInfo() {
    synchronized (this) {
        if(notifInfo == null) {
            notifInfo = new MBeanNotificationInfo[0];
        }
    }
    return notifInfo;
}
 
Example 26
Project: OpenJSharp   File: SnmpMibTable.java   Source Code and License 5 votes vote down vote up
/**
 * Return a <CODE>NotificationInfo</CODE> object containing the
 * notification class and the notification type sent by the
 * <CODE>SnmpMibTable</CODE>.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {

    String[] types = {SnmpTableEntryNotification.SNMP_ENTRY_ADDED,
                      SnmpTableEntryNotification.SNMP_ENTRY_REMOVED};

    MBeanNotificationInfo[] notifsInfo = {
        new MBeanNotificationInfo
        (types, "com.sun.jmx.snmp.agent.SnmpTableEntryNotification",
         "Notifications sent by the SnmpMibTable")
    };

    return notifsInfo;
}
 
Example 27
Project: OpenJSharp   File: ModelMBeanInfoSupport.java   Source Code and License 5 votes vote down vote up
public ModelMBeanNotificationInfo getNotification(String inName)
throws MBeanException, RuntimeOperationsException {
    ModelMBeanNotificationInfo retInfo = null;
    if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
        MODELMBEAN_LOGGER.logp(Level.FINER,
                ModelMBeanInfoSupport.class.getName(),
                "getNotification(String)", "Entry");
    }
    if (inName == null) {
        throw new RuntimeOperationsException(
                new IllegalArgumentException("Notification name is null"),
                "Exception occurred trying to get the " +
                "ModelMBeanNotificationInfo of the MBean");
    }
    MBeanNotificationInfo[] notifList = modelMBeanNotifications; //this.getNotifications();
    int numNotifs = 0;
    if (notifList != null) numNotifs = notifList.length;

    for (int i=0; (i < numNotifs) && (retInfo == null); i++) {
        if (inName.equals(notifList[i].getName())) {
            retInfo = ((ModelMBeanNotificationInfo) notifList[i].clone());
        }
    }
    if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
        MODELMBEAN_LOGGER.logp(Level.FINER,
                ModelMBeanInfoSupport.class.getName(),
                "getNotification(String)", "Exit");
    }

    return retInfo;
}
 
Example 28
Project: OpenJSharp   File: ModelMBeanInfoSupport.java   Source Code and License 5 votes vote down vote up
/**
 * Deserializes a {@link ModelMBeanInfoSupport} from an {@link ObjectInputStream}.
 */
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
    if (compat) {
        // Read an object serialized in the old serial form
        //
        ObjectInputStream.GetField fields = in.readFields();
        modelMBeanDescriptor =
                (Descriptor) fields.get("modelMBeanDescriptor", null);
        if (fields.defaulted("modelMBeanDescriptor")) {
            throw new NullPointerException("modelMBeanDescriptor");
        }
        modelMBeanAttributes =
                (MBeanAttributeInfo[]) fields.get("mmbAttributes", null);
        if (fields.defaulted("mmbAttributes")) {
            throw new NullPointerException("mmbAttributes");
        }
        modelMBeanConstructors =
                (MBeanConstructorInfo[]) fields.get("mmbConstructors", null);
        if (fields.defaulted("mmbConstructors")) {
            throw new NullPointerException("mmbConstructors");
        }
        modelMBeanNotifications =
                (MBeanNotificationInfo[]) fields.get("mmbNotifications", null);
        if (fields.defaulted("mmbNotifications")) {
            throw new NullPointerException("mmbNotifications");
        }
        modelMBeanOperations =
                (MBeanOperationInfo[]) fields.get("mmbOperations", null);
        if (fields.defaulted("mmbOperations")) {
            throw new NullPointerException("mmbOperations");
        }
    } else {
        // Read an object serialized in the new serial form
        //
        in.defaultReadObject();
    }
}
 
Example 29
Project: OpenJSharp   File: JMXConnectorServer.java   Source Code and License 5 votes vote down vote up
/**
 * <p>Returns an array indicating the notifications that this MBean
 * sends. The implementation in <code>JMXConnectorServer</code>
 * returns an array with one element, indicating that it can emit
 * notifications of class {@link JMXConnectionNotification} with
 * the types defined in that class.  A subclass that can emit other
 * notifications should return an array that contains this element
 * plus descriptions of the other notifications.</p>
 *
 * @return the array of possible notifications.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
    final String[] types = {
        JMXConnectionNotification.OPENED,
        JMXConnectionNotification.CLOSED,
        JMXConnectionNotification.FAILED,
    };
    final String className = JMXConnectionNotification.class.getName();
    final String description =
        "A client connection has been opened or closed";
    return new MBeanNotificationInfo[] {
        new MBeanNotificationInfo(types, className, description),
    };
}
 
Example 30
Project: openjdk-jdk10   File: RMINotifTest.java   Source Code and License 5 votes vote down vote up
/**
 * Returns a NotificationInfo object containing the name of the Java class of the notification
 * and the notification types sent by this notification broadcaster.
 */
public MBeanNotificationInfo[] getNotificationInfo() {

    MBeanNotificationInfo[] ntfInfoArray  = new MBeanNotificationInfo[1];

    String[] ntfTypes = new String[1];
    ntfTypes[0] = myType;

    ntfInfoArray[0] = new MBeanNotificationInfo(ntfTypes,
                                                "javax.management.Notification",
                                                "Notifications sent by the NotificationEmitter");
    return ntfInfoArray;
}
 
Example 31
Project: azeroth   File: ManagedRateLimiter.java   Source Code and License 5 votes vote down vote up
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
    String[] types = new String[] {JMX_MONITOR_RATE_LIMIT_SERVICE_TYPE,
            MonitorNotification.THRESHOLD_VALUE_EXCEEDED};
    MBeanNotificationInfo info = new MBeanNotificationInfo(types, Notification.class.getName(),
            "rate-limited request processed");
    return new MBeanNotificationInfo[] {info};
}
 
Example 32
Project: apache-tomcat-7.0.73-with-comment   File: ConnectionPool.java   Source Code and License 5 votes vote down vote up
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
    MBeanNotificationInfo[] pres = super.getNotificationInfo();
    MBeanNotificationInfo[] loc = getDefaultNotificationInfo();
    MBeanNotificationInfo[] aug = new MBeanNotificationInfo[pres.length + loc.length];
    if (pres.length>0) System.arraycopy(pres, 0, aug, 0, pres.length);
    if (loc.length >0) System.arraycopy(loc, 0, aug, pres.length, loc.length);
    return aug;
}
 
Example 33
Project: apache-tomcat-7.0.73-with-comment   File: ConnectionPool.java   Source Code and License 5 votes vote down vote up
public static MBeanNotificationInfo[] getDefaultNotificationInfo() {
    String[] types = new String[] {NOTIFY_INIT, NOTIFY_CONNECT, NOTIFY_ABANDON, SLOW_QUERY_NOTIFICATION,
            FAILED_QUERY_NOTIFICATION, SUSPECT_ABANDONED_NOTIFICATION, POOL_EMPTY, SUSPECT_RETURNED_NOTIFICATION};
    String name = Notification.class.getName();
    String description = "A connection pool error condition was met.";
    MBeanNotificationInfo info = new MBeanNotificationInfo(types, name, description);
    return new MBeanNotificationInfo[] {info};
}
 
Example 34
Project: jdk8u-jdk   File: ScanManager.java   Source Code and License 5 votes vote down vote up
/**
 * We emit an {@code AttributeChangeNotification} when the {@code State}
 * attribute changes.
 **/
public MBeanNotificationInfo[] getNotificationInfo() {
    return new MBeanNotificationInfo[] {
        new MBeanNotificationInfo(new String[] {
            AttributeChangeNotification.ATTRIBUTE_CHANGE},
            AttributeChangeNotification.class.getName(),
            "Emitted when the State attribute changes")
        };
}
 
Example 35
Project: jdk8u-jdk   File: GarbageCollectorImpl.java   Source Code and License 5 votes vote down vote up
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
    return new MBeanNotificationInfo[]{
        new MBeanNotificationInfo(gcNotifTypes,
        notifName,
        "GC Notification")
    };
}
 
Example 36
Project: jdk8u-jdk   File: MemoryManagerImpl.java   Source Code and License 5 votes vote down vote up
public MBeanNotificationInfo[] getNotificationInfo() {
    synchronized (this) {
        if(notifInfo == null) {
            notifInfo = new MBeanNotificationInfo[0];
        }
    }
    return notifInfo;
}
 
Example 37
Project: jdk8u-jdk   File: SnmpMibTable.java   Source Code and License 5 votes vote down vote up
/**
 * Return a <CODE>NotificationInfo</CODE> object containing the
 * notification class and the notification type sent by the
 * <CODE>SnmpMibTable</CODE>.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {

    String[] types = {SnmpTableEntryNotification.SNMP_ENTRY_ADDED,
                      SnmpTableEntryNotification.SNMP_ENTRY_REMOVED};

    MBeanNotificationInfo[] notifsInfo = {
        new MBeanNotificationInfo
        (types, "com.sun.jmx.snmp.agent.SnmpTableEntryNotification",
         "Notifications sent by the SnmpMibTable")
    };

    return notifsInfo;
}
 
Example 38
Project: openjdk-jdk10   File: NotSerializableNotifTest.java   Source Code and License 5 votes vote down vote up
public MBeanNotificationInfo[] getNotificationInfo() {
    final String[] ntfTypes = {myType};

    final MBeanNotificationInfo[] ntfInfoArray  = {
        new MBeanNotificationInfo(ntfTypes,
                                  "javax.management.Notification",
                                  "Notifications sent by the NotificationEmitter")};

    return ntfInfoArray;
}
 
Example 39
Project: jdk8u-jdk   File: ModelMBeanInfoSupport.java   Source Code and License 5 votes vote down vote up
/**
 * Deserializes a {@link ModelMBeanInfoSupport} from an {@link ObjectInputStream}.
 */
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
    if (compat) {
        // Read an object serialized in the old serial form
        //
        ObjectInputStream.GetField fields = in.readFields();
        modelMBeanDescriptor =
                (Descriptor) fields.get("modelMBeanDescriptor", null);
        if (fields.defaulted("modelMBeanDescriptor")) {
            throw new NullPointerException("modelMBeanDescriptor");
        }
        modelMBeanAttributes =
                (MBeanAttributeInfo[]) fields.get("mmbAttributes", null);
        if (fields.defaulted("mmbAttributes")) {
            throw new NullPointerException("mmbAttributes");
        }
        modelMBeanConstructors =
                (MBeanConstructorInfo[]) fields.get("mmbConstructors", null);
        if (fields.defaulted("mmbConstructors")) {
            throw new NullPointerException("mmbConstructors");
        }
        modelMBeanNotifications =
                (MBeanNotificationInfo[]) fields.get("mmbNotifications", null);
        if (fields.defaulted("mmbNotifications")) {
            throw new NullPointerException("mmbNotifications");
        }
        modelMBeanOperations =
                (MBeanOperationInfo[]) fields.get("mmbOperations", null);
        if (fields.defaulted("mmbOperations")) {
            throw new NullPointerException("mmbOperations");
        }
    } else {
        // Read an object serialized in the new serial form
        //
        in.defaultReadObject();
    }
}
 
Example 40
Project: jdk8u-jdk   File: JMXConnectorServer.java   Source Code and License 5 votes vote down vote up
/**
 * <p>Returns an array indicating the notifications that this MBean
 * sends. The implementation in <code>JMXConnectorServer</code>
 * returns an array with one element, indicating that it can emit
 * notifications of class {@link JMXConnectionNotification} with
 * the types defined in that class.  A subclass that can emit other
 * notifications should return an array that contains this element
 * plus descriptions of the other notifications.</p>
 *
 * @return the array of possible notifications.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
    final String[] types = {
        JMXConnectionNotification.OPENED,
        JMXConnectionNotification.CLOSED,
        JMXConnectionNotification.FAILED,
    };
    final String className = JMXConnectionNotification.class.getName();
    final String description =
        "A client connection has been opened or closed";
    return new MBeanNotificationInfo[] {
        new MBeanNotificationInfo(types, className, description),
    };
}
 
Example 41
Project: jdk8u-jdk   File: Timer.java   Source Code and License 5 votes vote down vote up
public synchronized MBeanNotificationInfo[] getNotificationInfo() {
    Set<String> notifTypes = new TreeSet<String>();
    for (Object[] entry : timerTable.values()) {
        TimerNotification notif = (TimerNotification)
            entry[TIMER_NOTIF_INDEX];
        notifTypes.add(notif.getType());
    }
    String[] notifTypesArray =
        notifTypes.toArray(new String[0]);
    return new MBeanNotificationInfo[] {
        new MBeanNotificationInfo(notifTypesArray,
                                  TimerNotification.class.getName(),
                                  "Notification sent by Timer MBean")
    };
}
 
Example 42
Project: hashsdn-controller   File: AbstractDynamicWrapper.java   Source Code and License 5 votes vote down vote up
private static MBeanInfo generateMBeanInfo(final Module module,
        final Map<String, AttributeHolder> attributeHolderMap, final MBeanOperationInfo[] operations,
        final Set<Class<?>> jmxInterfaces) {

    String description = findDescription(module.getClass(), jmxInterfaces);
    MBeanConstructorInfo[] constructors = new MBeanConstructorInfo[0];
    List<MBeanAttributeInfo> attributes = new ArrayList<>(attributeHolderMap.size());
    for (AttributeHolder attributeHolder : attributeHolderMap.values()) {
        attributes.add(attributeHolder.toMBeanAttributeInfo());
    }
    return new MBeanInfo(module.getClass().getName(), description, attributes.toArray(new MBeanAttributeInfo[0]),
            constructors, operations, new MBeanNotificationInfo[0]);
}
 
Example 43
Project: jdk8u-jdk   File: RMINotifTest.java   Source Code and License 5 votes vote down vote up
/**
 * Returns a NotificationInfo object containing the name of the Java class of the notification
 * and the notification types sent by this notification broadcaster.
 */
public MBeanNotificationInfo[] getNotificationInfo() {

    MBeanNotificationInfo[] ntfInfoArray  = new MBeanNotificationInfo[1];

    String[] ntfTypes = new String[1];
    ntfTypes[0] = myType;

    ntfInfoArray[0] = new MBeanNotificationInfo(ntfTypes,
                                                "javax.management.Notification",
                                                "Notifications sent by the NotificationEmitter");
    return ntfInfoArray;
}
 
Example 44
Project: jdk8u-jdk   File: NotSerializableNotifTest.java   Source Code and License 5 votes vote down vote up
public MBeanNotificationInfo[] getNotificationInfo() {
    final String[] ntfTypes = {myType};

    final MBeanNotificationInfo[] ntfInfoArray  = {
        new MBeanNotificationInfo(ntfTypes,
                                  "javax.management.Notification",
                                  "Notifications sent by the NotificationEmitter")};

    return ntfInfoArray;
}
 
Example 45
Project: jdk8u-jdk   File: UnexpectedNotifTest.java   Source Code and License 5 votes vote down vote up
/**
 * Returns a NotificationInfo object containing the name of the Java
 * class of the notification and the notification types sent by this
 * notification broadcaster.
 */
public MBeanNotificationInfo[] getNotificationInfo() {

    MBeanNotificationInfo[] ntfInfoArray = new MBeanNotificationInfo[1];

    String[] ntfTypes = new String[1];
    ntfTypes[0] = myType;

    ntfInfoArray[0] = new MBeanNotificationInfo(
                      ntfTypes,
                      "javax.management.Notification",
                      "Notifications sent by the NotificationEmitter");
    return ntfInfoArray;
}
 
Example 46
Project: openjdk-jdk10   File: GarbageCollectorExtImpl.java   Source Code and License 5 votes vote down vote up
public MBeanNotificationInfo[] getNotificationInfo() {
    return new MBeanNotificationInfo[]{
        new MBeanNotificationInfo(gcNotifTypes,
        notifName,
        "GC Notification")
    };
}
 
Example 47
Project: openjdk-jdk10   File: DiagnosticCommandImpl.java   Source Code and License 5 votes vote down vote up
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
    synchronized (this) {
        if (notifInfo == null) {
             notifInfo = new MBeanNotificationInfo[1];
             notifInfo[0] =
                     new MBeanNotificationInfo(diagFramNotifTypes,
                                               notifName,
                                               "Diagnostic Framework Notification");
        }
    }
    return notifInfo.clone();
}
 
Example 48
Project: openjdk-jdk10   File: MemoryManagerImpl.java   Source Code and License 5 votes vote down vote up
public MBeanNotificationInfo[] getNotificationInfo() {
    synchronized (this) {
        if(notifInfo == null) {
            notifInfo = new MBeanNotificationInfo[0];
        }
    }
    return notifInfo;
}
 
Example 49
Project: openjdk-jdk10   File: ModelMBeanInfoSupport.java   Source Code and License 5 votes vote down vote up
public ModelMBeanNotificationInfo getNotification(String inName)
throws MBeanException, RuntimeOperationsException {
    ModelMBeanNotificationInfo retInfo = null;
    if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
        MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
    }
    if (inName == null) {
        throw new RuntimeOperationsException(
                new IllegalArgumentException("Notification name is null"),
                "Exception occurred trying to get the " +
                "ModelMBeanNotificationInfo of the MBean");
    }
    MBeanNotificationInfo[] notifList = modelMBeanNotifications; //this.getNotifications();
    int numNotifs = 0;
    if (notifList != null) numNotifs = notifList.length;

    for (int i=0; (i < numNotifs) && (retInfo == null); i++) {
        if (inName.equals(notifList[i].getName())) {
            retInfo = ((ModelMBeanNotificationInfo) notifList[i].clone());
        }
    }
    if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
        MODELMBEAN_LOGGER.log(Level.TRACE, "Exit");
    }

    return retInfo;
}
 
Example 50
Project: openjdk-jdk10   File: ModelMBeanInfoSupport.java   Source Code and License 5 votes vote down vote up
/**
 * Deserializes a {@link ModelMBeanInfoSupport} from an {@link ObjectInputStream}.
 */
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
    if (compat) {
        // Read an object serialized in the old serial form
        //
        ObjectInputStream.GetField fields = in.readFields();
        modelMBeanDescriptor =
                (Descriptor) fields.get("modelMBeanDescriptor", null);
        if (fields.defaulted("modelMBeanDescriptor")) {
            throw new NullPointerException("modelMBeanDescriptor");
        }
        modelMBeanAttributes =
                (MBeanAttributeInfo[]) fields.get("mmbAttributes", null);
        if (fields.defaulted("mmbAttributes")) {
            throw new NullPointerException("mmbAttributes");
        }
        modelMBeanConstructors =
                (MBeanConstructorInfo[]) fields.get("mmbConstructors", null);
        if (fields.defaulted("mmbConstructors")) {
            throw new NullPointerException("mmbConstructors");
        }
        modelMBeanNotifications =
                (MBeanNotificationInfo[]) fields.get("mmbNotifications", null);
        if (fields.defaulted("mmbNotifications")) {
            throw new NullPointerException("mmbNotifications");
        }
        modelMBeanOperations =
                (MBeanOperationInfo[]) fields.get("mmbOperations", null);
        if (fields.defaulted("mmbOperations")) {
            throw new NullPointerException("mmbOperations");
        }
    } else {
        // Read an object serialized in the new serial form
        //
        in.defaultReadObject();
    }
}
 
Example 51
Project: lazycat   File: BaseModelMBean.java   Source Code and License 5 votes vote down vote up
/**
 * Return an <code>MBeanNotificationInfo</code> object describing the
 * notifications sent by this MBean.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {

	// Acquire the set of application notifications
	MBeanNotificationInfo current[] = getMBeanInfo().getNotifications();
	MBeanNotificationInfo response[] = new MBeanNotificationInfo[current.length + 2];
	// Descriptor descriptor = null;

	// Fill in entry for general notifications
	// descriptor = new DescriptorSupport
	// (new String[] { "name=GENERIC",
	// "descriptorType=notification",
	// "log=T",
	// "severity=5",
	// "displayName=jmx.modelmbean.generic" });
	response[0] = new MBeanNotificationInfo(new String[] { "jmx.modelmbean.generic" }, "GENERIC",
			"Text message notification from the managed resource");
	// descriptor);

	// Fill in entry for attribute change notifications
	// descriptor = new DescriptorSupport
	// (new String[] { "name=ATTRIBUTE_CHANGE",
	// "descriptorType=notification",
	// "log=T",
	// "severity=5",
	// "displayName=jmx.attribute.change" });
	response[1] = new MBeanNotificationInfo(new String[] { "jmx.attribute.change" }, "ATTRIBUTE_CHANGE",
			"Observed MBean attribute value has changed");
	// descriptor);

	// Copy remaining notifications as reported by the application
	System.arraycopy(current, 0, response, 2, current.length);
	return (response);

}
 
Example 52
Project: openjdk-jdk10   File: Timer.java   Source Code and License 5 votes vote down vote up
public synchronized MBeanNotificationInfo[] getNotificationInfo() {
    Set<String> notifTypes = new TreeSet<String>();
    for (Object[] entry : timerTable.values()) {
        TimerNotification notif = (TimerNotification)
            entry[TIMER_NOTIF_INDEX];
        notifTypes.add(notif.getType());
    }
    String[] notifTypesArray =
        notifTypes.toArray(new String[0]);
    return new MBeanNotificationInfo[] {
        new MBeanNotificationInfo(notifTypesArray,
                                  TimerNotification.class.getName(),
                                  "Notification sent by Timer MBean")
    };
}
 
Example 53
Project: phone-simulator   File: TesterHostStandardMBean.java   Source Code and License 4 votes vote down vote up
@Override
public MBeanInfo getMBeanInfo() {

    MBeanAttributeInfo[] attributes = new MBeanAttributeInfo[] {
            new MBeanAttributeInfo("Started", boolean.class.getName(), "Tester host is started now", true, false, true),
            new MBeanAttributeInfo("Instance_L1", Instance_L1.class.getName(), "Tester Level 1 agent", true, true, false),
            new MBeanAttributeInfo("Instance_L2", Instance_L2.class.getName(), "Tester Level 2 agent", true, true, false),
            new MBeanAttributeInfo("Instance_L3", Instance_L3.class.getName(), "Tester Level 3 agent", true, true, false),
            new MBeanAttributeInfo("Instance_TestTask", Instance_TestTask.class.getName(), "Tester task", true, true, false),
            new MBeanAttributeInfo("Instance_L1_Value", String.class.getName(), "Tester Level 1 agent", true, false, false),
            new MBeanAttributeInfo("Instance_L2_Value", String.class.getName(), "Tester Level 2 agent", true, false, false),
            new MBeanAttributeInfo("Instance_L3_Value", String.class.getName(), "Tester Level 3 agent", true, false, false),
            new MBeanAttributeInfo("Instance_TestTask_Value", String.class.getName(), "Tester task", true, false, false),
            new MBeanAttributeInfo("L1State", String.class.getName(), "Tester Level 1 state", true, false, false),
            new MBeanAttributeInfo("L2State", String.class.getName(), "Tester Level 2 state", true, false, false),
            new MBeanAttributeInfo("L3State", String.class.getName(), "Tester Level 3 state", true, false, false),
            new MBeanAttributeInfo("TestTaskState", String.class.getName(), "Tester TestTask state", true, false, false), };

    MBeanParameterInfo[] signString = new MBeanParameterInfo[] { new MBeanParameterInfo("val", String.class.getName(),
            "Index number or value") };
    MBeanParameterInfo[] signEmpty = new MBeanParameterInfo[] {};

    MBeanOperationInfo[] operations = new MBeanOperationInfo[] {
            new MBeanOperationInfo("putInstance_L1Value", "Tester Level 1 agent: 0:NO,1:M3UA,2:DialogicCard", signString,
                    Void.TYPE.getName(), MBeanOperationInfo.ACTION),
            new MBeanOperationInfo("putInstance_L2Value", "Tester Level 2 agent: 0:NO,1:SCCP,2:ISUP", signString,
                    Void.TYPE.getName(), MBeanOperationInfo.ACTION),
            new MBeanOperationInfo("putInstance_L3Value", "Tester Level 3 agent: 0:NO,1:MAP,2:CAP,3:INAP", signString,
                    Void.TYPE.getName(), MBeanOperationInfo.ACTION),
            new MBeanOperationInfo(
                    "putInstance_TestTaskValue",
                    "Tester task: 0:NO,1:USSD_TEST_CLIENT,2:USSD_TEST_SERVER,3:SMS_TEST_CLIENT,4:SMS_TEST_SERVER,5:CAP_TEST_SCF,6:CAP_TEST_SSF,7:ATI_TEST_CLIENT,8:ATI_TEST_SERVER,9:CHECK_IMEI_TEST_CLIENT,10:CHECK_IMEI_TEST_SERVER",
                    signString, Void.TYPE.getName(), MBeanOperationInfo.ACTION),
            new MBeanOperationInfo("start", "Starting a tester process", signEmpty, Void.TYPE.getName(),
                    MBeanOperationInfo.ACTION),
            new MBeanOperationInfo("stop", "Stopping a tester process", signEmpty, Void.TYPE.getName(),
                    MBeanOperationInfo.ACTION),
            new MBeanOperationInfo("quit", "Stop a tester process and terminate an application", signEmpty,
                    Void.TYPE.getName(), MBeanOperationInfo.ACTION), };

    MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[] { new MBeanNotificationInfo(
            new String[] { TesterHost.SS7_EVENT }, Notification.class.getName(), "SS7 events notification"), };

    return new MBeanInfo(TesterHost.class.getName(), "Tester host", attributes, null, operations, notifications);
}
 
Example 54
Project: Pogamut3   File: JMXFlagDecorator.java   Source Code and License 4 votes vote down vote up
/**
 * 
 * @return Notification info about this events possibly raised by this flag.
 */
public MBeanNotificationInfo getMBeanNotificationInfo() {
    return new MBeanNotificationInfo(new String[]{flagName},
            Notification.class.getName(), "The flag has changed it's value.");
}
 
Example 55
Project: Pogamut3   File: JMXFlagDecorator.java   Source Code and License 4 votes vote down vote up
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
    return new MBeanNotificationInfo[]{
                getMBeanNotificationInfo()
            };
}
 
Example 56
Project: Pogamut3   File: JMXLogPublisher.java   Source Code and License 4 votes vote down vote up
@Override
public MBeanNotificationInfo[] getNotificationInfo() {		
	return notification.getNotificationInfo();
}
 
Example 57
Project: JRediClients   File: JCacheMBeanServerBuilder.java   Source Code and License 4 votes vote down vote up
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
    return delegate.getNotificationInfo();
}
 
Example 58
Project: tomcat7   File: BaseModelMBean.java   Source Code and License 4 votes vote down vote up
/**
     * Return an <code>MBeanNotificationInfo</code> object describing the
     * notifications sent by this MBean.
     */
    @Override
    public MBeanNotificationInfo[] getNotificationInfo() {

        // Acquire the set of application notifications
        MBeanNotificationInfo current[] = getMBeanInfo().getNotifications();
        MBeanNotificationInfo response[] =
            new MBeanNotificationInfo[current.length + 2];
 //       Descriptor descriptor = null;

        // Fill in entry for general notifications
//        descriptor = new DescriptorSupport
//            (new String[] { "name=GENERIC",
//                            "descriptorType=notification",
//                            "log=T",
//                            "severity=5",
//                            "displayName=jmx.modelmbean.generic" });
        response[0] = new MBeanNotificationInfo
            (new String[] { "jmx.modelmbean.generic" },
             "GENERIC",
             "Text message notification from the managed resource");
             //descriptor);

        // Fill in entry for attribute change notifications
//        descriptor = new DescriptorSupport
//            (new String[] { "name=ATTRIBUTE_CHANGE",
//                            "descriptorType=notification",
//                            "log=T",
//                            "severity=5",
//                            "displayName=jmx.attribute.change" });
        response[1] = new MBeanNotificationInfo
            (new String[] { "jmx.attribute.change" },
             "ATTRIBUTE_CHANGE",
             "Observed MBean attribute value has changed");
             //descriptor);

        // Copy remaining notifications as reported by the application
        System.arraycopy(current, 0, response, 2, current.length);
        return (response);

    }
 
Example 59
Project: tomcat7   File: SlowQueryReportJmx.java   Source Code and License 4 votes vote down vote up
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
    return notifier.getNotificationInfo();
}
 
Example 60
Project: openjdk-jdk10   File: ImmutableNotificationInfoTest.java   Source Code and License 4 votes vote down vote up
public MBeanNotificationInfo[] getNotificationInfo() {
    return new MBeanNotificationInfo[0];
}