public class GrailsClosureRuntimeHints extends java.lang.Object implements RuntimeHintsRegistrar
Registers the framework closures Groovy dispatches through.
Calling a closure goes through doCall, and Groovy reads its parameter types
reflectively to choose an overload. In an ahead-of-time image those types are stripped unless
something asks for them, and the call fails where the closure is used rather than at start-up.
The framework ships thousands of closures across its plugins, so naming them individually would
be neither complete nor stable.
They are found here instead, while the hints are being written. That happens during the build, on an ordinary JVM with the full classpath, so scanning is available -- it is only the image that cannot do it. A closure whose own bytecode does not resolve is skipped: the GSP compiler's Ant task is on the compile classpath but Ant is not on the runtime one, and registering it would make the image analysis parse a class whose supertype is absent, failing the build.
Where the plugins are listed is carried into the image as well, since that is read to find them at all and an image carries a resource only when it has been asked to.
| 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) |