Package org.apache.druid.initialization
Class Initialization
- java.lang.Object
-
- org.apache.druid.initialization.Initialization
-
public class Initialization extends Object
Initialize Guice for a server. This is a legacy version, kept for compatibility with existing tests. Clients and tests should use the individual builders to create a non-server environment. Clients (and tests) never load extensions, and so do not need (and, in fact, should not use) theExtensionInjectorBuilder. Instead, simple tests can useStartupInjectorBuilderdirectly, passing in any needed modules.Some tests use modules that rely on the "startup injector" to inject values into a module. In that case, tests should use two builders: the
StartupInjectorBuilderfollowed by theCoreInjectorBuilderclass to hold extra modules. Look for references toCoreInjectorBuilderto find examples of this pattern.In both cases, the injector builders have options to add the full set of server modules. Tests should not load those modules. Instead, let the injector builders provide just the required set, and then explicitly list the (small subset) of modules needed by any given test.
The server initialization formerly done here is now done in
GuiceRunnableby way of theServerInjectorBuilder.
-
-
Constructor Summary
Constructors Constructor Description Initialization()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static com.google.inject.InjectormakeInjectorWithModules(com.google.inject.Injector baseInjector, Iterable<? extends com.google.inject.Module> modules)Deprecated.
-
-
-
Method Detail
-
makeInjectorWithModules
@Deprecated public static com.google.inject.Injector makeInjectorWithModules(com.google.inject.Injector baseInjector, Iterable<? extends com.google.inject.Module> modules)
Deprecated.
-
-