grails如何处理动态类重载?
I did a little digging around, now this may not be perfect and will not include all the little details, however at a broad level I think this is what goes on:
If an artifact has been changed, then this bit of code is run which I think does the magic:
GroovyClassLoader gcl = new GroovyClassLoader(application.getClassLoader()); initialisePlugin(gcl.parseClass(DefaultGroovyMethods.getText(conn.getInputStream())));
I got this by looking around DefaultGrailsPlugin which is part of grails core.
Everything in Grails is treated as a plugin even the service,domain,controllers and so on.
With a custom ClassLoader. Probably to vague a question and requires too in-depth of an answer for a site like SO. Might be better suited for the Grails mailing list.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.