8343730: JMX cleanups

Reviewed-by: cjplummer
This commit is contained in:
Kevin Walls 2024-11-07 13:10:26 +00:00
parent ac82a8f89c
commit d2b681d455
4 changed files with 7 additions and 12 deletions

View File

@ -100,7 +100,7 @@ final class MBeanServerDelegateImpl
super();
delegateInfo =
new MBeanInfo("javax.management.MBeanServerDelegate",
"Represents the MBean server from the management "+
"Represents the MBean server from the management "+
"point of view.",
MBeanServerDelegateImpl.attributeInfos, null,
null,getNotificationInfo());

View File

@ -31,7 +31,7 @@ import com.sun.jmx.defaults.ServiceName;
import com.sun.jmx.mbeanserver.Util;
/**
* Represents the MBean server from the management point of view.
* Represents the MBean server from the management point of view.
* The MBeanServerDelegate MBean emits the MBeanServerNotifications when
* an MBean is registered/unregistered in the MBean server.
*

View File

@ -59,7 +59,7 @@ public class Notification extends EventObject {
/**
* @serialField type String The notification type.
* A string expressed in a dot notation similar to Java properties.
* An example of a notification type is network.alarm.router
* An example of a notification type is com.sun.management.gc.notification
* @serialField sequenceNumber long The notification sequence number.
* A serial number which identify particular instance
* of notification in the context of the notification source.
@ -83,7 +83,7 @@ public class Notification extends EventObject {
/**
* @serial The notification type.
* A string expressed in a dot notation similar to Java properties.
* An example of a notification type is network.alarm.router
* An example of a notification type is com.sun.management.gc.notification
*/
private String type;
@ -239,7 +239,7 @@ public class Notification extends EventObject {
* @return The notification type. It's a string expressed in a dot notation
* similar to Java properties. It is recommended that the notification type
* should follow the reverse-domain-name convention used by Java package
* names. An example of a notification type is com.example.alarm.router.
* names. An example of a notification type is com.sun.management.gc.notification
*/
public String getType() {
return type ;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -159,12 +159,7 @@ public class JMXConnectionNotification extends Notification {
long sequenceNumber,
String message,
Object userData) {
/* We don't know whether the parent class (Notification) will
throw an exception if the type or source is null, because
JMX 1.2 doesn't specify that. So we make sure it is not
null, in case it would throw the wrong exception
(e.g. IllegalArgumentException instead of
NullPointerException). Likewise for the sequence number. */
// Do not pass null source to super, as EventObject will throw IllegalArgumentException.
super((String) nonNull(type),
nonNull(source),
Math.max(0, sequenceNumber),