Is it possible for an applicatioon context that has an invalid configuration to display multiple errors at once rather than only a single error? What I would like to do is, assuming the XML file has a valid format, figure out *each* bean that is invalid and display *all* of those beans.
If it is not possible, how would you suggest I go about implementing such functionality, and would the Spring team be interested in including this functionality in the Spring core? I can certainly write it and implement it.
My use case is this:
- We allow users to define multiple databases, one of which is chosen when the user logs in (kind of like Apache's BugZilla or Rational's ClearQuest). We are building a GUI that allows users to graphically add databases which our app internally stores in a Spring application context. We would like to aggregate all the problems with the databases in the application context at once. This would be useful to detect, for example, if the network was down vs. just a single database is down.
I was thinking perhaps a new interface would be beneficial. Maybe
DebuggableApplicationContext extends ConfigurableApplicationContext {
/** Returns a Map of bean names to exceptions that lists the problems that would be encountered if the application context were to have its refresh() method called */
Map testBeanDefinitions();
}


Reply With Quote