- Dynamic reloading on code change won't work in non-artefact classes :-(
- Whenever I introduce a new module, I have to manually register it with a service handler.
The only thing I have done differently was in the last step, when I access the modules like this:
def grailsApplication def modules = grailsApplication.getModuleClasses().collect { it.referenceInstance }
The thing is, getModuleClasses() returns 'GrailsClasses' and not java.lang.classes. At first I took the wrong road from there, trying to use it.class, which is then the DefaultModuleClass that you had to define with no abilities. I wondered how to obtain the underlying 'real' module class. Looking into the properties of the GrailsClass I found out that you can get the class of the module by accessing 'class'. But you can do even better: A instance is already attached and can be accessed by it.referenceInstance.
Happy artefacting!
No comments:
Post a Comment