Skip to content
Pierre T. edited this page Jan 12, 2015 · 1 revision

Plugin can register a native unit module using the following method:

@Override
public Object nativeUnitModule() {
    return new MyModule(classesToBind); // Could be a Guice Module
}

Native unit module are by default GuiceModule but they can be other class if you don’t use Guice as DI framework.

This module will the be added to the object graph (the injector for Guice) by the kernel.

The usual workflow when developing Nuun Plugin is to do some classpath scan request with the [[Request API]]. For instance, get all the classes annotated by @Service. Then pass them to a native module which will bind them. In order to be injectable.

Content

Clone this wiki locally