Costin Manolache wrote:
Remy Maucherat wrote:
Hi,
I'd like to make this feature less hardcoded (right now, it's ugly ;) ). A first step would be to extract the code to another helper class, but that's all I can think of. Does anyone have any ideas ?
What I tried earlier ( but didn't finish ), and I still think is a good idea - use the old DOM, and have config changes reflected to the config tree _when they are done_, instead of pulling every property from each mbean.
That's the idea.
The major problem is intercepting the changes. It can be done: - inside the jmx impl ( interceptors, etc )
Yeah, well, I'm not too hot about that. We'd have to use broadcasters everywhere, etc. That code isn't especially nice if we have to do it for every single property event. I may have performance issues (on the listener side, you can use regexps for registration and filters: this looks rather expensive to me). So it might work, but I'm not sure about it right now.
- using the property changed events
Big advantage: they're already there, and we're sucessfully using them for stuff we really shouldn't (the naming context updates).
- by wrapping each mbean when it is registered.
But we'd have to do all property changes through JMX then, which is quite annoying.
Actually, this DOM syncing would be a good job for some aspect ;)
One important question is if we need to save server.xml, or
just say that server.xml is for legacy manual config, and use a different jmx-oriented format for settings.
That's a good question. I like the current server.xml, since it represents well the structure of the server. I don't see the JMX configuration as being that much simpler to save (and it's definitely more verbose). The advantage is that it faithfully represents the init process, and you could do the same in a Java program to instantiate the same server.
Another radical approach is to use java settings api for storing/retrieving the settings - again, deprecate server.xml and you also need to intercept settings from jmx.
java.util.prefs ?
Rémy
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]