Each extension is a Groovy class extending a Java abstract adapter class that provides default implementations of all but one of the methods in a Java interface (ScriptingInterface). The Java code used to load the extension gets a GroovyClassLoader using the following code:
GroovyClassLoader loader = new GroovyClassLoader(getClass().getClassLoader());
I use the following code to get the relevant class and instantiate it via its no-arg constructor, catching the (entertainingly-named) MultipleCompilationErrorsException along with several other exceptions:
String code = "<Groovy>"; Class<? extends ScriptingInterface> clazz = loader.parseClass(code); ScriptingInterface script = clazz.newInstance();
Does that sound like a reasonable way to do it? It definitely works, but I'm not sure it's the best way.
Update: Ack! For some reason, my Blogger settings changed from "New Posts Have Comments" to "New Posts Do Not Have Comments" through no action of my own! While I try to figure out how to fix it (now that this post is no longer new), you can add any comments to this post's listing on DZone.
Update2: Problem fixed. It turned out to be possible to turn on comments for a single post via the Blogger post editor.