|
From: Ivan R. <iv...@we...> - 2003-12-03 15:23:46
|
Rob Butler wrote: >>There are some similarities between JMX and Spring. The JMX spec. >>defines a MLET service, a class capable of loading JMX components >>(MBean) based on the XML-like file format. > > The XML format is usually too different between different JMX Kernel > implementations to get any sort of portability at all. Is it? Because MLET is part of the standard spec. But that's not important as MLET is not good enough anyway. >>I have always thought that Spring could play well with JMX, creating >>MBeans in the same manner as it creates "plain" beans. There are two >>things to do: >> >>1) Detect beans that are also mbeans and register them with the >> MBeanServer. This should be very easy to do. Spring already >> supports bean initialization, we have a name - there is only >> call to mserver instance missing. Of course, there are more >> complex things to deal with but not much. > > > Only if you have to do something special.. There is actually a > much better way in my opinion -- see below. I agree what you've said below but you still need to support static mbeans. It would make no sense to have to supply additional configuration for a static mbean :) >>2) Expose normal beans as JMX MBeans. This would allow any bean to >> be manipulated through the JMX protocol. This is also easy to do >> although there is more work involved. > > Actually, I think this can be a lot less work if done right, and > provide portability too. Yes, that is great. The only drawback would be that it will complicate the configuration file further. Perhaps Spring should support another configuration file with a different syntax. And this configuration file would use bean names to reference beans and then specify which attributes and methods should be exposed to JMX. > Hope this helps out. When I get some spare time I hope to do a lot > of these things with Spring - and contribute some patches too. But > that is going to have to wait a little while. :( Same here. Actually I am just starting with an JMX project but I think I will use the MX4J syntax for the time being (I don't need JMX implementation portability). I am on a tight deadline. -- ModSecurity (http://www.modsecurity.org) [ Open source IDS for Web applications ] |