Adding ResourceHandlers at runtime
I have a Spring 3.1 MVC application with a multi-tenant design (multiple customers supported by one application). Each customer has their own ResourceHandler mapping for static resource paths (CSS files etc.). These ResourceHandlers are added programatically in a WebMvcConfigurerAdapter subclass (based on directories on disk), via addResourceHandlers(ResourceHandlerRegistry registry). This is all annotation driven.
I would like to add support for updating the customer resource path mappings at runtime via an "admin" controller. The problem I have is that I'm not sure how to get access to the WebMvcConfigurerAdapter subclass instance in my controller, or how to access the ResourceHandlerRegistry instance in order to call addResourceHandlers.
Any pointers much appreciated.