I'm considering the idea of using the application context as a semi-dynamic application configuration context, e.g. an administrator creates ctx entries (which automatically became available across the whole application), removes them from the ctx etc. using some GUI. Of course, those entries should survive eventual application crashes/restarts so I have to persist them. Two options come to mind: persist objects and use StaticApplicationContext with some kind of loop to fill in the appctx, or persist that StaticApplicationContext to some XML file and load it just as any other application context. I like the second idea better.
Are there any means to easily persist (changed) application contexts in the way that saved ctx is suitable for loading by standard application context loaders, such as the classpath+xml-aware one?
Any other ideas on how to persist an application context? I have to mention that all appctx entries (beans) will be singletons and won't change their state too often (if ever).