Re: Can values be negative for CounterMonitors?

Luis-Miguel Alventosa <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Organization Sun Microsystems, Inc.
Message-ID <[email protected]>
 > Bordet, Simone wrote:
 > Hi,
 >
 >
 >>Page 150 of the spec says that the value of the observed
 >>attribute "is always greater than or equal to zero." MX4J
 >>enforces this restriction by sending a THRESHOLD_ERROR if the
 >>value < 0; the RI appears not to, allowing negative attribute
 >>values to be set.
 >>
 >>Am I misreading the intent of the specification here? Do we
 >>need to remove this check?
 >
 >
 > IMO this is a bug in the RI.

Simon,

I agree with you that this is a bug in the RI although it is
not clear to me by reading the Javadoc and the spec that this
is a THRESHOLD_ERROR.

I'd like it to be an OBSERVED_ATTRIBUTE_TYPE_ERROR but I don't
know whether it fits into the following definition:

jmx.monitor.error.type - Sent when the object instance of the
                          observed attribute value is null or
                          not of the appropriate type for the
                          given monitor. The observed object
                          name and observed attribute name are
                          provided in the notification.

or the RUNTIME_ERROR one:

jmx.monitor.error.runtime - All exceptions (except the cases
                             described above) that occur while
                             trying to get the value of the
                             observed attribute are caught by
                             the monitor and will be reported
                             in a notification of this type.

Do you think a negative integer can be considered as a non
appropriate type for the positive integer the CounterMonitor
requires?

Regards,
Luis


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.