Currently, we store datasource definitions in the Tomcat container inside server.xml and expose environment variables through context.xml.
Any time we change an environment variable or datasource, it requires a server restart for those changes to be live.
Is there a way that we could create a web application to manage these things? Instead of storing them in the server context.xml and server.xml files, we could store them in another file and have them be modifiable through the webapp. When an application wants a datasource, it could request it from the webapp (maybe through messaging). I had thought about modifying the jndi elements at runtime and saving the changes in a file, but found that Tomcat does not allow that.
If it's not obvious, I have only a little experience with the technologies involved, but would like a direction to head in. I don't want to do anything hackish and would like to follow standards.
Would it be correct to have a webapp that handles global datasource and global variable management, requiring you to request these objects through messaging? If not, what are some preferable alternatives?