[ mx4j-Bugs-858190 ] Types for setThresholds on GaugeMonitor
"SourceForge.net" <[email protected]>
| Newsgroups | gmane.comp.java.mx4j.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #858190, was opened at 2003-12-11 06:32 Message generated for change (Comment added) made by btscully You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=450647&aid=858190&group_id=47745 >Category: JMX implementation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Noah Body (sherington) >Assigned to: Brian Scully (btscully) Summary: Types for setThresholds on GaugeMonitor Initial Comment: I'm not sure if this is a bug, or is a constraint of the specification, but what I am trying to do is this... I have an MBean with an "Amount" field of type java.math.BigDecimal. java.math.BigDecimal extends java.lang.Number. I then want to use a GaugeMonitor to watch high/low thresholds for this attribute. On GaugeMonitor, there is a method setThresholds( Number high, Number, low ), so presumably it is OK to use BigDecimal for these threshold values. When I run my code, I get this warning in the trace output: "Monitor GaugeMonitor on MyServer:type=AmountManager attribute Amount attribute, threshold, offset and modules types don't match" This happens because in GaugeMonitor the "determineType" method checks "targetClass" explicitly for INT, LONG, BYTE, SHORT, FLOAT and DOUBLE and returns "false" if the targetClass is not one of those types. i.e., the determineType method does not check for BigDecimal (presumably BigInteger should work as well). Similar code exists in CounterMonitor where BigInteger should (?) work. So, is this a bug? Or is the use of BigDecimal and BigInteger not allowed? ---------------------------------------------------------------------- >Comment By: Brian Scully (btscully) Date: 2004-01-25 09:36 Message: Logged In: YES user_id=234750 Neither BigInteger nor BigDecimal are listed in the types for monitors in the JMX 1.2 specification. However, i'm not convinced that this wasn't just an oversight in the spec, where they maybe really meant all subclasses of java.lang.Number. I'll see how Sun's Reference Implementation reacts to BigDecimals/Integers - unless you have already. Certainly if the RI supports them, MX4J should. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=450647&aid=858190&group_id=47745 ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn