[ mx4j-Bugs-855000 ] MBean registration notification emitted too soon
"SourceForge.net" <[email protected]>
| Newsgroups | gmane.comp.java.mx4j.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #855000, was opened at 2003-12-05 14:41 Message generated for change (Comment added) made by btscully You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=450647&aid=855000&group_id=47745 Category: JMX implementation Group: Release 1.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: MBean registration notification emitted too soon Initial Comment: When an MBean is registered, the MBeanServerDelegate will emit a registration notification to all of its listeners. Unfortunately, the MBeanServerDelegate emits this notification too soon, before the MBean has been fully registered. It is very easy to replicate this bug. Write a MBean registration listener and add it to the MBeanServerDelegate. In that listener, call "getMBeanInfo" on the MBeanServer passing in the ObjectName of the newly registered MBean. Then, register an MBean. Notice that getMBeanInfo returns null. MX4J hasn't fully initialized its internal data structures before it calls the registration notification listeners. It should be that if a registration notification listener's handleNotification is called, that MBean should be fully registered and the listener should be able to do whatever it wants with the bean (at the very least, it should be able to get its MBeanInfo). The current workaround I am using today is the handleNotification spawns a thread and returns. That thread will spin waiting for MBeanInfo to return a non- null. At that point, I know MX4J has completely registered the MBean. John Mazz Hewlett-Packard, Company [email protected] ---------------------------------------------------------------------- >Comment By: Brian Scully (btscully) Date: 2003-12-06 12:08 Message: Logged In: YES user_id=234750 I can't duplicate your testcase with the latest codebase from CVS. Are you working against 1.1.1 or 2.0 Beta? If it's not fixed in 2.0 Beta, it is fixed in the nightly snapshot. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=450647&aid=855000&group_id=47745 ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click