Hi!
There is a new configuration service in jBoss. It is located in
org/jboss/configuration, and is to be used to configure JMX MBeans. It
is itself an MBean, and has two methods: "load(String)" and "String
save()", where String is an XML-structure containing the settings. By
using a string to communicate the settings it will be substantially
easier to do remote updates of server configuration.
The XML structure looks something like this:
<server>
<mbean name="DefaultDomain:service=Logging,type=Console">
<attribute name="Format">[{2}] {4}</attribute>
</mbean>
<mbean name="DefaultDomain:service=Webserver">
<attribute name="Port">8083</attribute>
</mbean>
<mbean name="Adaptor:name=html">
<attribute name="MaxActiveClientCount">10</attribute>
<attribute name="Parser" />
<attribute name="Port">8082</attribute>
</mbean>
</server>
(Actually, this *is* the current contents of /conf/jboss.cfml)
The top node denotes the server. Then, for each MBean in the server
(named by its JMX ObjectName) there is a set of attributes containing
the values to be used. I constructed the format to be rather compact, so
as to make it easily editable in a text-editor. Of course, if you don't
like this format you can make your own configration service. The nice
thing about JMX is that things like this don't really affect how things
work.
Calling "load" will try to apply all settings it is given to the MBeans
in the server. If there are too many settings (i.e. the named MBean is
not in the server) or too few (i.e. there are MBeans in the server that
aren't in the configuration) then this will not cause the load to fail.
"save" extracts all read/write attributes from MBeans in the server. So,
for example, runtime attributes which are read-only (such as "state",
which typically denotes "started"/"stopped") are not stored. Once put
into an XML-tree it is serialized into a string and returned.
This service is used by the new jBoss bootstrap process (described in
other posting).
/Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com