30 import java.io.ObjectInputStream; |
30 import java.io.ObjectInputStream; |
31 import java.util.Arrays; |
31 import java.util.Arrays; |
32 import java.util.Objects; |
32 import java.util.Objects; |
33 |
33 |
34 /** |
34 /** |
35 * <p>The <CODE>MBeanNotificationInfo</CODE> class is used to describe the |
35 * <p>The {@code MBeanNotificationInfo} class is used to describe the |
36 * characteristics of the different notification instances |
36 * characteristics of the different notification instances |
37 * emitted by an MBean, for a given Java class of notification. |
37 * emitted by an MBean, for a given Java class of notification. |
38 * If an MBean emits notifications that can be instances of different Java classes, |
38 * If an MBean emits notifications that can be instances of different Java classes, |
39 * then the metadata for that MBean should provide an <CODE>MBeanNotificationInfo</CODE> |
39 * then the metadata for that MBean should provide an {@code MBeanNotificationInfo} |
40 * object for each of these notification Java classes.</p> |
40 * object for each of these notification Java classes.</p> |
41 * |
41 * |
42 * <p>Instances of this class are immutable. Subclasses may be |
42 * <p>Instances of this class are immutable. Subclasses may be |
43 * mutable but this is not recommended.</p> |
43 * mutable but this is not recommended.</p> |
44 * |
44 * |
45 * <p>This class extends <CODE>javax.management.MBeanFeatureInfo</CODE> |
45 * <p>This class extends {@code javax.management.MBeanFeatureInfo} |
46 * and thus provides <CODE>name</CODE> and <CODE>description</CODE> fields. |
46 * and thus provides {@code name} and {@code description} fields. |
47 * The <CODE>name</CODE> field should be the fully qualified Java class name of |
47 * The {@code name} field should be the fully qualified Java class name of |
48 * the notification objects described by this class.</p> |
48 * the notification objects described by this class.</p> |
49 * |
49 * |
50 * <p>The <CODE>getNotifTypes</CODE> method returns an array of |
50 * <p>The {@code getNotifTypes} method returns an array of |
51 * strings containing the notification types that the MBean may |
51 * strings containing the notification types that the MBean may |
52 * emit. The notification type is a dot-notation string which |
52 * emit. The notification type is a dot-notation string which |
53 * describes what the emitted notification is about, not the Java |
53 * describes what the emitted notification is about, not the Java |
54 * class of the notification. A single generic notification class can |
54 * class of the notification. A single generic notification class can |
55 * be used to send notifications of several types. All of these types |
55 * be used to send notifications of several types. All of these types |
56 * are returned in the string array result of the |
56 * are returned in the string array result of the |
57 * <CODE>getNotifTypes</CODE> method. |
57 * {@code getNotifTypes} method. |
58 * |
58 * |
59 * @since 1.5 |
59 * @since 1.5 |
60 */ |
60 */ |
61 public class MBeanNotificationInfo extends MBeanFeatureInfo implements Cloneable { |
61 public class MBeanNotificationInfo extends MBeanFeatureInfo implements Cloneable { |
62 |
62 |
75 |
75 |
76 /** @see MBeanInfo#arrayGettersSafe */ |
76 /** @see MBeanInfo#arrayGettersSafe */ |
77 private final transient boolean arrayGettersSafe; |
77 private final transient boolean arrayGettersSafe; |
78 |
78 |
79 /** |
79 /** |
80 * Constructs an <CODE>MBeanNotificationInfo</CODE> object. |
80 * Constructs an {@code MBeanNotificationInfo} object. |
81 * |
81 * |
82 * @param notifTypes The array of strings (in dot notation) |
82 * @param notifTypes The array of strings (in dot notation) |
83 * containing the notification types that the MBean may emit. |
83 * containing the notification types that the MBean may emit. |
84 * This may be null with the same effect as a zero-length array. |
84 * This may be null with the same effect as a zero-length array. |
85 * @param name The fully qualified Java class name of the |
85 * @param name The fully qualified Java class name of the |
91 String description) { |
91 String description) { |
92 this(notifTypes, name, description, null); |
92 this(notifTypes, name, description, null); |
93 } |
93 } |
94 |
94 |
95 /** |
95 /** |
96 * Constructs an <CODE>MBeanNotificationInfo</CODE> object. |
96 * Constructs an {@code MBeanNotificationInfo} object. |
97 * |
97 * |
98 * @param notifTypes The array of strings (in dot notation) |
98 * @param notifTypes The array of strings (in dot notation) |
99 * containing the notification types that the MBean may emit. |
99 * containing the notification types that the MBean may emit. |
100 * This may be null with the same effect as a zero-length array. |
100 * This may be null with the same effect as a zero-length array. |
101 * @param name The fully qualified Java class name of the |
101 * @param name The fully qualified Java class name of the |
126 } |
126 } |
127 |
127 |
128 |
128 |
129 /** |
129 /** |
130 * Returns a shallow clone of this instance. |
130 * Returns a shallow clone of this instance. |
131 * The clone is obtained by simply calling <tt>super.clone()</tt>, |
131 * The clone is obtained by simply calling {@code super.clone()}, |
132 * thus calling the default native shallow cloning mechanism |
132 * thus calling the default native shallow cloning mechanism |
133 * implemented by <tt>Object.clone()</tt>. |
133 * implemented by {@code Object.clone()}. |
134 * No deeper cloning of any internal field is made. |
134 * No deeper cloning of any internal field is made. |
135 */ |
135 */ |
136 public Object clone () { |
136 public Object clone () { |
137 try { |
137 try { |
138 return super.clone() ; |
138 return super.clone() ; |
177 /** |
177 /** |
178 * Compare this MBeanNotificationInfo to another. |
178 * Compare this MBeanNotificationInfo to another. |
179 * |
179 * |
180 * @param o the object to compare to. |
180 * @param o the object to compare to. |
181 * |
181 * |
182 * @return true if and only if <code>o</code> is an MBeanNotificationInfo |
182 * @return true if and only if {@code o} is an MBeanNotificationInfo |
183 * such that its {@link #getName()}, {@link #getDescription()}, |
183 * such that its {@link #getName()}, {@link #getDescription()}, |
184 * {@link #getDescriptor()}, |
184 * {@link #getDescriptor()}, |
185 * and {@link #getNotifTypes()} values are equal (not necessarily |
185 * and {@link #getNotifTypes()} values are equal (not necessarily |
186 * identical) to those of this MBeanNotificationInfo. Two |
186 * identical) to those of this MBeanNotificationInfo. Two |
187 * notification type arrays are equal if their corresponding |
187 * notification type arrays are equal if their corresponding |