diff --git a/src/share/classes/javax/management/Descriptor.java b/src/share/classes/javax/management/Descriptor.java index 70c17f2eedb51237d67dd5e002b583ea245047d2..a74fb11cde70c5174c24b00890d8ceeeabbc6da1 100644 --- a/src/share/classes/javax/management/Descriptor.java +++ b/src/share/classes/javax/management/Descriptor.java @@ -101,7 +101,7 @@ import javax.management.openmbean.OpenType; * *
The Open Type of this element. In the case of {@code @@ -240,7 +244,7 @@ import javax.management.openmbean.OpenType; * which case it indicates the Open Type that the {@link * Notification#getUserData() user data} will have.
The original Java type of this element as it appeared in the @@ -282,11 +286,132 @@ import javax.management.openmbean.OpenType; * * * - *
Some additional fields are defined by Model MBeans. See - * {@link javax.management.modelmbean.ModelMBeanInfo ModelMBeanInfo} - * and related classes and the chapter "Model MBeans" of the - * - * JMX Specification.
+ *Some additional fields are defined by Model MBeans. See the + * information for {@code ModelMBeanInfo}, + * {@code ModelMBeanAttributeInfo}, + * {@code ModelMBeanConstructorInfo}, + * {@code ModelMBeanNotificationInfo}, and + * {@code ModelMBeanOperationInfo}, as + * well as the chapter "Model MBeans" of the JMX + * Specification. The following table summarizes these fields. Note + * that when the Type in this table is Number, a String that is the decimal + * representation of a Long can also be used.
+ * + *Nothing prevents the use of these fields in MBeans that are not Model + * MBeans. The displayName, severity, and visibility fields are of + * interest outside Model MBeans, for example. But only Model MBeans have + * a predefined behavior for these fields.
+ * + *Name | Type | Used in | Meaning |
---|---|---|---|
class | String | ModelMBeanOperationInfo | + *Class where method is defined (fully qualified). |
currencyTimeLimit | Number | + *ModelMBeanInfo ModelMBeanAttributeInfo ModelMBeanOperationInfo |
+ * How long cached value is valid: <0 never, =0 always, + * >0 seconds. |
default | Object | ModelMBeanAttributeInfo | + *Default value for attribute. |
descriptorType | String | Any | + *Type of descriptor, "mbean", "attribute", "constructor", "operation", + * or "notification". |
displayName | String | Any | + *Human readable name of this item. |
export | String | ModelMBeanInfo | + *Name to be used to export/expose this MBean so that it is + * findable by other JMX Agents. |
getMethod | String | ModelMBeanAttributeInfo | + *Name of operation descriptor for get method. |
lastUpdatedTimeStamp | Number | + *ModelMBeanAttributeInfo ModelMBeanOperationInfo |
+ * When value was set. |
log | String | ModelMBeanInfo ModelMBeanNotificationInfo |
+ * t or T: log all notifications, f or F: log no notifications. |
logFile | String | ModelMBeanInfo ModelMBeanNotificationInfo |
+ * Fully qualified filename to log events to. |
messageID | String | ModelMBeanNotificationInfo | + *Unique key for message text (to allow translation, analysis). |
messageText | String | ModelMBeanNotificationInfo | + *Text of notification. |
name | String | Any | + *Name of this item. |
persistFile | String | ModelMBeanInfo | + *File name into which the MBean should be persisted. |
persistLocation | String | ModelMBeanInfo | + *The fully qualified directory name where the MBean should be + * persisted (if appropriate). |
persistPeriod | Number | + *ModelMBeanInfo ModelMBeanAttributeInfo |
+ * Frequency of persist cycle in seconds. Used when persistPolicy is + * "OnTimer" or "NoMoreOftenThan". |
persistPolicy | String | + *ModelMBeanInfo ModelMBeanAttributeInfo |
+ * One of: OnUpdate|OnTimer|NoMoreOftenThan|OnUnregister|Always|Never. + * See the section "MBean Descriptor Fields" in the JMX specification + * document. |
presentationString | String | Any | + *XML formatted string to allow presentation of data. |
protocolMap | Descriptor | ModelMBeanAttributeInfo | + *See the section "Protocol Map Support" in the JMX specification + * document. Mappings must be appropriate for the attribute and entries + * can be updated or augmented at runtime. |
role | String | + *ModelMBeanConstructorInfo ModelMBeanOperationInfo |
+ * One of "constructor", "operation", "getter", or "setter". |
setMethod | String | ModelMBeanAttributeInfo | + *Name of operation descriptor for set method. |
severity | Number | + *ModelMBeanNotificationInfo | + *0-6 where 0: unknown; 1: non-recoverable; + * 2: critical, failure; 3: major, severe; + * 4: minor, marginal, error; 5: warning; + * 6: normal, cleared, informative |
targetObject | Object | ModelMBeanOperationInfo | + *Object on which to execute this method. |
targetType | String | ModelMBeanOperationInfo | + *type of object reference for targetObject. Can be: + * ObjectReference | Handle | EJBHandle | IOR | RMIReference. |
value | Object | + *ModelMBeanAttributeInfo ModelMBeanOperationInfo |
+ * Current (cached) value for attribute or operation. |
visibility | Number | Any | + *1-4 where 1: always visible, 4: rarely visible. |
Compares this descriptor to the given object. The objects are equal if * the given object is also a Descriptor, and if the two Descriptors have * the same field names (possibly differing in case) and the same * associated values. The respective values for a field in the two diff --git a/src/share/classes/javax/management/MBeanInfo.java b/src/share/classes/javax/management/MBeanInfo.java index 722e96fedd98b49d493d5eafe5105e2357f3182d..3561e3cfc132d7ebd212eb67f01cfb8ac289fbd2 100644 --- a/src/share/classes/javax/management/MBeanInfo.java +++ b/src/share/classes/javax/management/MBeanInfo.java @@ -45,6 +45,17 @@ import static javax.management.ImmutableDescriptor.nonNullDescriptor; * management operations. Instances of this class are immutable. * Subclasses may be mutable but this is not recommended.
* + *Usually the {@code MBeanInfo} for any given MBean does + * not change over the lifetime of that MBean. Dynamic MBeans can change their + * {@code MBeanInfo} and in that case it is recommended that they emit a {@link + * Notification} with a {@linkplain Notification#getType() type} of {@code + * "jmx.mbean.info.changed"} and a {@linkplain Notification#getUserData() + * userData} that is the new {@code MBeanInfo}. This is not required, but + * provides a conventional way for clients of the MBean to discover the change. + * See also the immutableInfo and + * infoTimeout fields in the {@code + * MBeanInfo} {@link Descriptor}.
+ * *The contents of the MBeanInfo
for a Dynamic MBean
* are determined by its {@link DynamicMBean#getMBeanInfo
* getMBeanInfo()} method. This includes Open MBeans and Model
@@ -62,27 +73,49 @@ import static javax.management.ImmutableDescriptor.nonNullDescriptor;
* constructors in that object;
*
*
getName
, isName
, or
- * setName
method that conforms to the conventions
+ * whose existence is deduced as follows:
+ * getName
, isName
, or
+ * setName
methods that conform to the conventions
* for Standard MBeans;
+ * @MBean
or @MXBean
+ * class, the array implied by those annotations;
+ * The description returned by {@link #getDescription()} and the * descriptions of the contained attributes and operations are determined - * by the corresponding Description annotations if any; + * by the corresponding {@link Description} annotations if any; * otherwise their contents are not specified.
* *The remaining details of the MBeanInfo
for a
diff --git a/src/share/classes/javax/management/MBeanServer.java b/src/share/classes/javax/management/MBeanServer.java
index 90d42d2df6c2d2b2799b5a65c67e00685288d3f1..e6d79e5bd949605ca938cf8770c17185e043c4ed 100644
--- a/src/share/classes/javax/management/MBeanServer.java
+++ b/src/share/classes/javax/management/MBeanServer.java
@@ -377,19 +377,19 @@ public interface MBeanServer extends MBeanServerConnection {
* MBean will not be registered.
* @exception RuntimeMBeanException If the postRegister
* (MBeanRegistration
interface) method of the MBean throws a
- * RuntimeException
, the registerMBean
method will
+ *
RuntimeException
, the registerMBean
method will
* throw a RuntimeMBeanException
, although the MBean
* registration succeeded. In such a case, the MBean will be actually
- * registered even though the registerMBean
method
+ * registered even though the
registerMBean
method
* threw an exception. Note that RuntimeMBeanException
can
* also be thrown by preRegister
, in which case the MBean
* will not be registered.
* @exception RuntimeErrorException If the postRegister
* (MBeanRegistration
interface) method of the MBean throws an
- * Error
, the registerMBean
method will
+ *
Error
, the registerMBean
method will
* throw a RuntimeErrorException
, although the MBean
* registration succeeded. In such a case, the MBean will be actually
- * registered even though the registerMBean
method
+ * registered even though the
registerMBean
method
* threw an exception. Note that RuntimeErrorException
can
* also be thrown by preRegister
, in which case the MBean
* will not be registered.
@@ -411,6 +411,8 @@ public interface MBeanServer extends MBeanServerConnection {
* is sent as described above.
A notification string type used by an {@code EventClient} object to - * inform a listener added by {@code #addEventClientListener} that it - * has detected that notifications have been lost. The {@link - * Notification#getUserData() userData} of the notification is a Long which - * is an upper bound on the number of lost notifications that have just - * been detected.
+ *A notification string type used by an {@code EventClient} object + * to inform a listener added by {@link #addEventClientListener + * addEventClientListener} that it has detected that notifications have + * been lost. The {@link Notification#getUserData() userData} of the + * notification is a Long which is an upper bound on the number of lost + * notifications that have just been detected.
* * @see #addEventClientListener */ @@ -577,8 +577,13 @@ public class EventClient implements EventConsumer, NotificationManager { } /** - * Returns the set of listeners that have been added through - * this {@code EventClient} and not subsequently removed. + *Returns the collection of listeners that have been added through + * this {@code EventClient} and not subsequently removed. The returned + * collection contains one entry for every listener added with + * {@link #addNotificationListener addNotificationListener} or + * {@link #subscribe subscribe} and not subsequently removed with + * {@link #removeNotificationListener removeNotificationListener} or + * {@link #unsubscribe unsubscribe}, respectively.
* * @return A collection of listener information. Empty if there are no * current listeners or if this {@code EventClient} has been {@linkplain @@ -927,8 +932,10 @@ public class EventClient implements EventConsumer, NotificationManager { private final static MBeanNotificationInfo[] myInfo = new MBeanNotificationInfo[] { new MBeanNotificationInfo( - new String[] {FAILED, NOTIFS_LOST}, - Notification.class.getName(), "")}; + new String[] {FAILED, NONFATAL, NOTIFS_LOST}, + Notification.class.getName(), + "Notifications that can be sent to a listener added with " + + "EventClient.addEventClientListener")}; private final NotificationBroadcasterSupport broadcaster = new NotificationBroadcasterSupport(); diff --git a/src/share/classes/javax/management/modelmbean/DescriptorSupport.java b/src/share/classes/javax/management/modelmbean/DescriptorSupport.java index 4e9db9dcd54bf3cfb8d632cac69e09c2587eb176..ee8e3030e54f2eff29ca0e2a0ca6af5f6e285442 100644 --- a/src/share/classes/javax/management/modelmbean/DescriptorSupport.java +++ b/src/share/classes/javax/management/modelmbean/DescriptorSupport.java @@ -884,9 +884,9 @@ public class DescriptorSupport * not a String with value "t", "f", "true", "false". These String * values must not be case sensitive. *The ModelMBeanAttributeInfo object describes an attribute of the ModelMBean. * It is a subclass of MBeanAttributeInfo with the addition of an associated Descriptor - * and an implementation of the DescriptorAccess interface. - *
- * The fields in the descriptor are defined, but not limited to, the following:
- *
- * name : attribute name - * descriptorType : must be "attribute" - * value : current value for attribute - * default : default value for attribute - * displayName : name of attribute to be used in displays - * getMethod : name of operation descriptor for get method - * setMethod : name of operation descriptor for set method - * protocolMap : object which implements the Descriptor interface: mappings - * must be appropriate for the attribute - * and entries can be updated or augmented at runtime. - * persistPolicy : OnUpdate|OnTimer|NoMoreOftenThan|OnUnregister|Always|Never - * persistPeriod : seconds - frequency of persist cycle. Used when persistPolicy - * is "OnTimer" or "NoMoreOftenThan". - * currencyTimeLimit : how long value is valid, <0 never, =0 always, >0 seconds - * lastUpdatedTimeStamp : when value was set - * visibility : 1-4 where 1: always visible, 4: rarely visible - * presentationString : xml formatted string to allow presentation of data - *- * The default descriptor contains the name, descriptorType and displayName fields. - * The default value of the name and displayName fields is the name of the attribute. + * and an implementation of the DescriptorAccess interface. + * + *
+ * The fields in the descriptor are defined, but not limited to, the following. + * Note that when the Type in this table is Number, a String that is the decimal + * representation of a Long can also be used.
+ * + *Name | Type | Meaning |
---|---|---|
name | String | + *Attribute name. |
descriptorType | String | + *Must be "attribute". |
value | Object | + *Current (cached) value for attribute. |
default | Object | + *Default value for attribute. |
displayName | String | + *Name of attribute to be used in displays. |
getMethod | String | + *Name of operation descriptor for get method. |
setMethod | String | + *Name of operation descriptor for set method. |
protocolMap | Descriptor | + *See the section "Protocol Map Support" in the JMX specification + * document. Mappings must be appropriate for the attribute and entries + * can be updated or augmented at runtime. |
persistPolicy | String | + *One of: OnUpdate|OnTimer|NoMoreOftenThan|OnUnregister|Always|Never. + * See the section "MBean Descriptor Fields" in the JMX specification + * document. |
persistPeriod | Number | + *Frequency of persist cycle in seconds. Used when persistPolicy is + * "OnTimer" or "NoMoreOftenThan". |
currencyTimeLimit | Number | + *How long value is valid: <0 never, + * =0 always, >0 seconds. |
lastUpdatedTimeStamp | Number | + *When value was set. |
visibility | Number | + *1-4 where 1: always visible, 4: rarely visible. |
presentationString | String | + *XML formatted string to allow presentation of data. |
The default descriptor contains the name, descriptorType and displayName + * fields. The default value of the name and displayName fields is the name of + * the attribute.
* *Note: because of inconsistencies in previous versions of * this specification, it is recommended not to use negative or zero diff --git a/src/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java b/src/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java index 89948d5c92cd4729d0075763b10a0dc9b6cace9b..ecf8ecf002bdd7a4a390b969baca9d09d4656de4 100644 --- a/src/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java +++ b/src/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java @@ -49,22 +49,33 @@ import javax.management.MBeanParameterInfo; import javax.management.RuntimeOperationsException; /** - * The ModelMBeanConstructorInfo object describes a constructor of the ModelMBean. + *
The ModelMBeanConstructorInfo object describes a constructor of the ModelMBean. * It is a subclass of MBeanConstructorInfo with the addition of an associated Descriptor - * and an implementation of the DescriptorAccess interface. - *
- *
- * The fields in the descriptor are defined, but not limited to, the following:+ * and an implementation of the DescriptorAccess interface. + * + *- * name : constructor name - * descriptorType : must be "operation" - * role : must be "constructor" - * displayName : human readable name of constructor - * visibility : 1-4 where 1: always visible 4: rarely visible - * presentationString : xml formatted string to describe how to present operation - *
+ * The fields in the descriptor are defined, but not limited to, the following. + * Note that when the Type in this table is Number, a String that is the decimal + * representation of a Long can also be used.
+ * + *Name | Type | Meaning |
---|---|---|
name | String | + *Constructor name. |
descriptorType | String | + *Must be "operation". |
role | String | + *Must be "constructor". |
displayName | String | + *Human readable name of constructor. |
visibility | Number | + *1-4 where 1: always visible 4: rarely visible. |
presentationString | String | + *XML formatted string to describe how to present operation |
The {@code persistPolicy} and {@code currencyTimeLimit} fields - * are meaningless for constructors, but are not considered invalid. + * are meaningless for constructors, but are not considered invalid.
* *The default descriptor will have the {@code name}, {@code * descriptorType}, {@code displayName} and {@code role} fields. The diff --git a/src/share/classes/javax/management/modelmbean/ModelMBeanInfo.java b/src/share/classes/javax/management/modelmbean/ModelMBeanInfo.java index 367e616eb09b6b051fe79adf35ad3e5db4c2784d..70c0e74f9f2039ceac86527080d8ed5ce089deff 100644 --- a/src/share/classes/javax/management/modelmbean/ModelMBeanInfo.java +++ b/src/share/classes/javax/management/modelmbean/ModelMBeanInfo.java @@ -156,29 +156,55 @@ public interface ModelMBeanInfo /** - * Returns the ModelMBean's descriptor which contains MBean wide policies. This descriptor contains - * metadata about the MBean and default policies for persistence and caching. - *
- * The fields in the descriptor are defined, but not limited to, the following: - *
- * name : MBean name - * descriptorType : must be "mbean" - * displayName : name of attribute to be used in displays - * persistPolicy : OnUpdate|OnTimer|NoMoreOftenThan|OnUnregister|Always|Never - * persistLocation : The fully qualified directory name where the MBean should be persisted (if appropriate) - * persistFile : File name into which the MBean should be persisted - * persistPeriod : seconds - frequency of persist cycle for OnTime and NoMoreOftenThan PersistPolicy - * currencyTimeLimit : how long value is valid, <0 never, =0 always, >0 seconds - * log : where t: log all notifications f: log no notifications - * logfile : fully qualified filename to log events to - * visibility : 1-4 where 1: always visible 4: rarely visible - * export : name to be used to export/expose this MBean so that it is findable by - * other JMX Agents. - * presentationString : xml formatted string to allow presentation of data to be associated with the MBean. - *+ *
Returns the ModelMBean's descriptor which contains MBean wide + * policies. This descriptor contains metadata about the MBean and default + * policies for persistence and caching.
+ * + *+ * The fields in the descriptor are defined, but not limited to, the + * following. Note that when the Type in this table is Number, a String + * that is the decimal representation of a Long can also be used.
+ * + *Name | Type | Meaning |
---|---|---|
name | String | + *MBean name. |
descriptorType | String | + *Must be "mbean". |
displayName | String | + *Name of MBean to be used in displays. |
persistPolicy | String | + *One of: OnUpdate|OnTimer|NoMoreOftenThan|OnUnregister|Always|Never. + * See the section "MBean Descriptor Fields" in the JMX specification + * document. |
persistLocation | String | + *The fully qualified directory name where the MBean should be + * persisted (if appropriate). |
persistFile | String | + *File name into which the MBean should be persisted. |
persistPeriod | Number | + *Frequency of persist cycle in seconds, for OnTime and + * NoMoreOftenThan PersistPolicy |
currencyTimeLimit | Number | + *How long cached value is valid: <0 never, =0 always, + * >0 seconds. |
log | String | + *t: log all notifications, f: log no notifications. |
logfile | String | + *Fully qualified filename to log events to. |
visibility | Number | + *1-4 where 1: always visible 4: rarely visible. |
export | String | + *Name to be used to export/expose this MBean so that it is + * findable by other JMX Agents. |
presentationString | String | + *XML formatted string to allow presentation of data to be + * associated with the MBean. |
* The default descriptor is: name=className,descriptorType="mbean", displayName=className, - * persistPolicy="never",log="F",export="F",visibility="1" + * persistPolicy="never",log="F",visibility="1" * If the descriptor does not contain all these fields, they will be added with these default values. * *
Note: because of inconsistencies in previous versions of @@ -207,7 +233,7 @@ public interface ModelMBeanInfo * does a complete replacement of the descriptor, no merging is done. If the descriptor to * set to is null then the default descriptor will be created. * The default descriptor is: name=className,descriptorType="mbean", displayName=className, - * persistPolicy="never",log="F",export="F",visibility="1" + * persistPolicy="never",log="F",visibility="1" * If the descriptor does not contain all these fields, they will be added with these default values. * * See {@link #getMBeanDescriptor getMBeanDescriptor} method javadoc for description of valid field names. diff --git a/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java b/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java index 52f1317db816bce840a3944a8b7f6c9b2f11a1db..4b637ee08f8cf187ff944e8d8adee2a95f806419 100644 --- a/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java +++ b/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java @@ -46,34 +46,46 @@ import javax.management.MBeanNotificationInfo; import javax.management.RuntimeOperationsException; /** - * The ModelMBeanNotificationInfo object describes a notification emitted + *
The ModelMBeanNotificationInfo object describes a notification emitted * by a ModelMBean. * It is a subclass of MBeanNotificationInfo with the addition of an - * associated Descriptor and an implementation of the Descriptor interface. - *
- * The fields in the descriptor are defined, but not limited to, - * the following: - *
- * name : notification name - * descriptorType : must be "notification" - * severity : 0-6 where 0: unknown; 1: non-recoverable; - * 2: critical, failure; 3: major, severe; - * 4: minor, marginal, error; 5: warning; - * 6: normal, cleared, informative - * messageID : unique key for message text (to allow translation, - * analysis) - * messageText : text of notification - * log : T - log message F - do not log message - * logfile : string fully qualified file name appropriate for - * operating system - * visibility : 1-4 where 1: always visible 4: rarely visible - * presentationString : xml formatted string to allow presentation of data - *- * The default descriptor contains the name, descriptorType, + * associated Descriptor and an implementation of the Descriptor interface. + * + *
+ * The fields in the descriptor are defined, but not limited to, the following. + * Note that when the Type in this table is Number, a String that is the decimal + * representation of a Long can also be used.
+ * + *Name | Type | Meaning |
---|---|---|
name | String | + *Notification name. |
descriptorType | String | + *Must be "notification". |
severity | Number | + *0-6 where 0: unknown; 1: non-recoverable; + * 2: critical, failure; 3: major, severe; + * 4: minor, marginal, error; 5: warning; + * 6: normal, cleared, informative |
messageID | String | + *Unique key for message text (to allow translation, analysis). |
messageText | String | + *Text of notification. |
log | String | + *T - log message, F - do not log message. |
logfile | String | + *fully qualified file name appropriate for operating system. |
visibility | Number | + *1-4 where 1: always visible 4: rarely visible. |
presentationString | String | + *XML formatted string to allow presentation of data. |
The default descriptor contains the name, descriptorType,
* displayName and severity(=6) fields. The default value of the name
* and displayName fields is the name of the Notification class (as
* specified by the name
parameter of the
- * ModelMBeanNotificationInfo constructor).
+ * ModelMBeanNotificationInfo constructor).
The serialVersionUID of this class is -7445681389570207141L
.
*
diff --git a/src/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java b/src/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java
index 2ed992240671802c1481b72da731d944b914ecac..6ebea49954dc0fc2619e615bc6693c77f06fe116 100644
--- a/src/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java
+++ b/src/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java
@@ -49,27 +49,48 @@ import javax.management.MBeanParameterInfo;
import javax.management.RuntimeOperationsException;
/**
- * The ModelMBeanOperationInfo object describes a management operation of the ModelMBean.
- * It is a subclass of MBeanOperationInfo with the addition of an associated Descriptor
- * and an implementation of the DescriptorAccess interface.
- *
- *
- * The fields in the descriptor are defined, but not limited to, the following: - * name : operation name - * descriptorType : must be "operation" - * class : class where method is defined (fully qualified) - * role : must be "operation", "getter", or "setter - * targetObject : object on which to execute this method - * targetType : type of object reference for targetObject. Can be: - * ObjectReference | Handle | EJBHandle | IOR | RMIReference. - * value : cached value for operation - * currencyTimeLimit : how long cached value is valid - * lastUpdatedTimeStamp : when cached value was set - * visibility : 1-4 where 1: always visible 4: rarely visible - * presentationString : xml formatted string to describe how to present operation - *- * The default descriptor will have name, descriptorType, displayName and role fields set. - * The default value of the name and displayName fields is the operation name. + *
The ModelMBeanOperationInfo object describes a management operation of + * the ModelMBean. It is a subclass of MBeanOperationInfo with the addition + * of an associated Descriptor and an implementation of the DescriptorAccess + * interface.
+ * + *+ * The fields in the descriptor are defined, but not limited to, the following. + * Note that when the Type in this table is Number, a String that is the decimal + * representation of a Long can also be used.
+ * + *Name | Type | Meaning |
---|---|---|
name | String | + *Operation name. |
descriptorType | String | + *Must be "operation". |
class | String | + *Class where method is defined (fully qualified). |
role | String | + *Must be "operation", "getter", or "setter". |
targetObject | Object | + *Object on which to execute this method. |
targetType | String | + *type of object reference for targetObject. Can be: + * ObjectReference | Handle | EJBHandle | IOR | RMIReference. |
value | Object | + *Cached value for operation. |
displayName | String | + *Human readable display name of the operation. | + *
currencyTimeLimit | Number | + *How long cached value is valid. |
lastUpdatedTimeStamp | Number | + *When cached value was set. |
visibility | Number | + *1-4 where 1: always visible 4: rarely visible. |
presentationString | String | + *XML formatted string to describe how to present operation |
The default descriptor will have name, descriptorType, displayName and + * role fields set. The default value of the name and displayName fields is + * the operation name.
* *Note: because of inconsistencies in previous versions of
* this specification, it is recommended not to use negative or zero
diff --git a/test/javax/management/eventService/CustomForwarderTest.java b/test/javax/management/eventService/CustomForwarderTest.java
index 22238b37505c2377f1ab5d420f1b88e43c2e39ea..c9c866aaee076e5e723277d4e6315deebb515a94 100644
--- a/test/javax/management/eventService/CustomForwarderTest.java
+++ b/test/javax/management/eventService/CustomForwarderTest.java
@@ -23,7 +23,7 @@
/*
* @test CustomForwarderTest
- * @bug 5108776
+ * @bug 5108776 6759619
* @summary Test that a custom EventForwarder can be added
* @author Eamonn McManus
*/
@@ -45,6 +45,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
+import javax.management.MBeanNotificationInfo;
import javax.management.MBeanServer;
import javax.management.MBeanServerInvocationHandler;
import javax.management.Notification;
@@ -107,6 +108,14 @@ public class CustomForwarderTest {
socket.close();
}
+ void simulateNonFatal() {
+ receiver.nonFatal(new Exception("NonFatal"));
+ }
+
+ void simulateFailed() {
+ receiver.failed(new Error("Failed"));
+ }
+
private class Receiver implements Runnable {
public void run() {
byte[] buf = new byte[1024];
@@ -216,16 +225,26 @@ public class CustomForwarderTest {
EventClientDelegateMBean.OBJECT_NAME,
EventClientDelegateMBean.class,
false);
- EventRelay relay = new UdpEventRelay(delegate);
+ UdpEventRelay relay = new UdpEventRelay(delegate);
EventClient client = new EventClient(delegate, relay, null, null, 0L);
final Semaphore lostCountSema = new Semaphore(0);
+ final BlockingQueue