|
From: Rob B. <rob...@ve...> - 2003-11-17 23:49:58
|
While your on the topic of reloading / hot swapping of beans, what are your thoughts on JMX? Reloading / hot swapping of beans & JMX would go nicely together. I've been thinking a bit about Spring & JMX lately. My original plan was to implement some sort of a custom configuration repository that the JMX Mbeans could update. A database or the like. Once the configuation changes were made, I would somehow signal my app. The app would load a second instance of spring, and then "swap" it with the original at the appropriate time in the applications cycle. Spring would be used as a "factory" for all the objects in the application, and thus when the new spring instance was loaded the new configuration would be used. I would use some sort of unit of work pattern to maintain a reference to the "old" spring instance until that unit of work was completed so there would be no issues with the config changing halfway through. The primary issue I had with this setup is singletons. If I have two instances of Spring, then I don't have a true singleton anymore (I could always revert to the "singleton" pattern if need be - yuck). This may be fine in some situations, but not ok in others. Also, I would like some way to "copy" state from the old singleton into the new one built into the framework. I just wanted to get this out there to see what people think about how to go about JMX enabling spring. Rod had said he had some thoughts on it a while ago (or in his book?). I haven't done a very good job of explaining this, but I think this would work. I can explain it better later if this is an area of interest to people. Later Rob > Yes, I think we could do this pretty easily. But I wouldn't want it to be > the default. > > Regards, > Rod > |