...
Now the Activator can create an instance of GroovyGreeterImpl and register it with the container as a GroovyGreeter provider. In Java, you'd need one line to call BundleContext.registerService(String, Object, Dictionary), but in Java Groovy we need to change the ContextClassLoader while we do this. Here is a complete and correct Activator:
...