More info: I checked MX4J, JMX-RI and JBoss. The model mbean implementations in the first 2 are consistent - and do not send attribute change notifications on the 'normal' listeners ( those registered with addNotificationListener). That's also consistent with the spec wording "all other notifications" ( other than attribute change ).
JBoss doesn't follow the spec and sends attribute changes to all listeners ( at least in 3.0.4 ). One way or the other - the JMX spec seems to have a problem. IMO jboss is doing the right thing ( since attribute change notifications are useless if you can't register listeners - and so far I couldn't find any method to allow that without having an mbean instance, and I found no method to give back the mbean instance ). The bigger problem is that without beeing able to get back the mbean instance, a lot of the things are impossible. You can only invoke methods and set attributes via JMX ( probably that was the intention ), but that removes a possible optimization and makes JMX unusable ( alone) as a 'core' component architecture. I'm still investigating how jboss works - but it seems they also use JNDI to suplement JMX. Costin Costin Manolache wrote: > Craig, Amy - or anyone who knows JMX, I need help :-) > > I just can't find any way to add an attribute change listener > in the whole JMX spec, unless I have the instance of the model > mbean. And there is no way to get that instance. > > All query and get methods in MBeanServer return ObjectInstance - > i.e. name and class, but no 'instance'. > > There is an 'addNotificationListener' that takes the object name - > but the spec ( and implementation ) doesn't allow this to register > attribute change listeners, and att changes are not sent to > listeners registered with this method ( there is an "all other but > attribute changes" in the PDF file ). > > I'm stuck. I can add some code to the modeler mbean to work > around, but the solution won't work for other mbeans. > > What I want to do is find all attribute changes done via JMX and persist > them - if you remember my old proposal. At the moment I'm not very sure > it can be implemented. The only possible solution to revive it would be > to force all attribute changes to go through a modeler-specific interface > or to require the use of the modeler for all mbeans. > > Costin -- To unsubscribe, e-mail: <mailto:tomcat-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:tomcat-dev-help@;jakarta.apache.org>