Contract that makes Guice injector creation a pluggable strategy and allows for typed
extensions to the Injector within the context of the strategy. An InjectorCreator
may also implement post injector creation operations such as calling
LifecycleListeners
prior to returning form createInjector().
InjectorCreator can be used directly with a module,
new LifecycleInjectorCreator().createInjector(new MyApplicationModule());
Alternatively, InjectorCreator can be used in conjunction with the
InjectorBuilder DSL
LifecycleInjector injector = InjectorBuilder
.fromModule(new MyApplicationModule())
.overrideWith(new MyApplicationOverrideModule())
.combineWith(new AdditionalModule()
.createInjector(new LifecycleInjectorCreator());
}
See
SimpleInjectorCreator or
LifecycleInjectorCreator