if (urlCreatorCacheSize != null) {
defaultUrlMappingsHolder.setUrlCreatorMaxWeightedCacheCapacity(urlCreatorCacheSize);
}
// call initialize() after settings are in place
defaultUrlMappingsHolder.initialize();
final GrailsControllerUrlMappings grailsControllerUrlMappings = new GrailsControllerUrlMappings(grailsApplication, defaultUrlMappingsHolder);
((ConfigurableApplicationContext)applicationContext).addApplicationListener( new ApplicationListener<ArtefactAdditionEvent>() {
@Override
public void onApplicationEvent(ArtefactAdditionEvent event) {
GrailsClass artefact = event.getArtefact();
if(artefact instanceof GrailsControllerClass) {
grailsControllerUrlMappings.registerController((GrailsControllerClass)artefact);
}
}
});
urlMappingsHolder= grailsControllerUrlMappings;
}