public class GroovyExtensionModuleRuntimeHints extends java.lang.Object implements RuntimeHintsRegistrar
Registers the classes that extend types Groovy did not declare.
A module declares them in a descriptor, and Groovy calls the method it finds there through the
metaclass rather than as a call written against the class -- so request.forwardURI reaches
a static method on an extension class reflectively. An image keeps that method only when asked,
and nothing asks: the extension class is named in a descriptor rather than in any code.
The image then refuses the call where it is made. The framework extends the servlet request, the response, the session and more this way, and those are reached while rendering a page, so what fails is a request rather than the start-up -- most visibly the error page, which is the one page that renders when something has already gone wrong.
Read from the descriptors while the hints are written, so a module added later is covered without being named here, whether it belongs to the framework, a plugin or the application.
The descriptors themselves are carried into the image too, along with the table of methods Groovy adds to every type. Both are read as the runtime starts, and an image carries a resource only when it has been asked to: without them Groovy cannot build its metaclasses at all, and fails before any application code runs.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
registerHints(RuntimeHints hints, java.lang.ClassLoader classLoader) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |