Package org.apache.druid.guice
Class DruidInjectorBuilder
java.lang.Object
org.apache.druid.guice.DruidInjectorBuilder
- Direct Known Subclasses:
CoreInjectorBuilder,ExtensionInjectorBuilder,ServiceInjectorBuilder
Druid-enabled injector builder which supports
DruidModules, module classes
created from the base injector, and filtering based on properties and LoadScope
annotations.
Can be used in clients and tests, in which case no module filtering is done. Presumably, the test or client has already selected the modules that it needs.
Druid injector builders can be chained with an earlier builder providing a set of modules which a later builder overrides. Again, this is typically used only in the server, not in clients or tests.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDruidInjectorBuilder(com.google.inject.Injector baseInjector) DruidInjectorBuilder(com.google.inject.Injector baseInjector, Set<NodeRole> nodeRoles) -
Method Summary
Modifier and TypeMethodDescriptionAdd an arbitrary set of modules.Add an arbitraryModule,DruidModuleinstance, or a subclass of these classes.addModule(com.google.inject.Module module) addModules(com.google.inject.Module... inputs) com.google.inject.Injectorcom.google.inject.Injectorbuild()Ignore load scope annotations on modules.List<com.google.inject.Module>modules()
-
Field Details
-
baseInjector
protected final com.google.inject.Injector baseInjector
-
-
Constructor Details
-
DruidInjectorBuilder
public DruidInjectorBuilder(com.google.inject.Injector baseInjector) -
DruidInjectorBuilder
-
DruidInjectorBuilder
-
-
Method Details
-
ignoreLoadScopes
Ignore load scope annotations on modules. Primarily for testing where a unit test is not any Druid node, and may wish to load a module that is annotated with a load scope. -
add
Add an arbitrary set of modules. -
addModules
-
addAll
-
addInput
Add an arbitraryModule,DruidModuleinstance, or a subclass of these classes. If a class is provided, it is instantiated using the base injector to allow dependency injection. If a module instance is provided, its members are injected. Note that such modules have visibility only to objects defined in the base injector, but not to objects defined in the injector being built. -
addModule
-
addClass
-
modules
-
build
public com.google.inject.Injector build() -
baseInjector
public com.google.inject.Injector baseInjector()
-