public class GuiceyBootstrap
extends java.lang.Object
GuiceBundle.Builder
. Also, contains dropwizard configuration and
environment objects (in case if they are required).Constructor and Description |
---|
GuiceyBootstrap(java.util.List<com.google.inject.Module> modules,
InstallerConfig installerConfig,
io.dropwizard.Configuration configuration,
io.dropwizard.setup.Environment environment) |
Modifier and Type | Method and Description |
---|---|
<T extends io.dropwizard.Configuration> |
configuration() |
GuiceyBootstrap |
disableInstallers(java.lang.Class<? extends FeatureInstaller>... installers) |
io.dropwizard.setup.Environment |
environment() |
GuiceyBootstrap |
extensions(java.lang.Class<?>... extensionClasses)
Beans could be registered automatically when auto scan enabled,
but if you don't want to use it, you can register beans manually.
|
GuiceyBootstrap |
installers(java.lang.Class<? extends FeatureInstaller>... installers)
Feature installers registered automatically when auto scan enabled,
but if you don't want to use it, you can register installers manually (note: without auto scan default
installers will not be registered).
|
GuiceyBootstrap |
modules(com.google.inject.Module... modules)
NOTE: if module implements *AwareModule interfaces, objects will be set just before configuration start.
|
public GuiceyBootstrap(java.util.List<com.google.inject.Module> modules, InstallerConfig installerConfig, io.dropwizard.Configuration configuration, io.dropwizard.setup.Environment environment)
public <T extends io.dropwizard.Configuration> T configuration()
T
- configuration typepublic io.dropwizard.setup.Environment environment()
public GuiceyBootstrap modules(com.google.inject.Module... modules)
modules
- one or more juice modulesBootstrapAwareModule
,
ConfigurationAwareModule
,
EnvironmentAwareModule
,
DropwizardAwareModule
@SafeVarargs public final GuiceyBootstrap disableInstallers(java.lang.Class<? extends FeatureInstaller>... installers)
installers
- feature installer types to disable@SafeVarargs public final GuiceyBootstrap installers(java.lang.Class<? extends FeatureInstaller>... installers)
Also, could be used to add installers from packages not included in auto scanning.
installers
- feature installer classes to registerpublic GuiceyBootstrap extensions(java.lang.Class<?>... extensionClasses)
Guice injector will instantiate beans and registered installers will be used to recognize and properly register provided extension beans.
Also, could be used to add beans from packages not included in auto scanning.
NOTE: startup will fail if bean not recognized by installers.
NOTE: Don't register commands here: either enable auto scan, which will install commands automatically or register command directly to bootstrap object and dependencies will be injected to them after injector creation.
extensionClasses
- extension bean classes to register