|
From: Ivan R. <iv...@we...> - 2003-12-03 14:16:58
|
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.
MX4J 2.0, an open source implementation, takes this one step
further (because the file format from the specification is in many
ways inadequate). Its configuration file looks like this:
-------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<configuration>
<startup>
<create classname="mx4j.tools.adaptor.http.HttpAdaptor"
objectname="connectors:type=http" loadername="null">
<arg type="int">9090</arg>
<arg type="string">localhost</arg>
</create>
<create classname="mx4j.tools.adaptor.http.XSLTProcessor"
objectname="connectors:type=http,processor=xslt" loadername="null"/>
<call objectname="connectors:type=http"
attribute="ProcessorNameString">
<arg type="string">connectors:type=http,processor=xslt</arg>
</call>
<call objectname="connectors:type=http" operation="start"/>
</startup>
<shutdown>
<call objectname="connectors:type=http" operation="stop"/>
</shutdown>
</configuration>
-------------------------------------------
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.
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.
Any opinions on this?
...
Slightly off-topic to this email but related to another email thread,
you can see how MX4J supports a <call> tag to execute methods on
instantiated beans. Maybe that would be an interesting addition to
the container capabilities of the Spring framework now.
--
ModSecurity (http://www.modsecurity.org)
[ Open source IDS for Web applications ]
|