Class HK2DebugBundle
- java.lang.Object
-
- ru.vyarus.dropwizard.guice.module.context.unique.item.UniqueGuiceyBundle
-
- ru.vyarus.dropwizard.guice.module.jersey.debug.HK2DebugBundle
-
- All Implemented Interfaces:
GuiceyBundle
@Deprecated public class HK2DebugBundle extends UniqueGuiceyBundle
Deprecated.in the next version HK2 support will be removed and bundle will become uselessBundle enables debug services to check correct extensions instantiation:JerseyManaged
annotated service must be instantiated by HK2 and not guice- Other services must be instantiated only in guice
When enabled, exception will be thrown when service instantiated outside of assumed bound (or duplicate instantiation occur).
Checked only beans registered by
JerseyInstaller
(ResourceInstaller
,JerseyProviderInstaller
or any 3rd party installer implementing jersey installer interface).Module intended to be used in tests.
ContextDebugService
collects all tracked classes instantiated by both guice and HK2 and may provide lists of classes accordingly. It may be used in test conditions.- Since:
- 15.01.2016
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HK2DebugBundle.HK2DebugModule
Deprecated.Guice module with scope validation services.
-
Constructor Summary
Constructors Constructor Description HK2DebugBundle()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
initialize(GuiceyBootstrap bootstrap)
Deprecated.Called in initialization phase.-
Methods inherited from class ru.vyarus.dropwizard.guice.module.context.unique.item.UniqueGuiceyBundle
equals, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ru.vyarus.dropwizard.guice.module.installer.bundle.GuiceyBundle
run
-
-
-
-
Method Detail
-
initialize
public void initialize(GuiceyBootstrap bootstrap)
Deprecated.Description copied from interface:GuiceyBundle
Called in initialization phase.GuiceyBootstrap
contains almost the same methods asGuiceBundle.Builder
, which allows to register installers, extensions and guice modules. Existing installer could be replaced by disabling old one and registering new.Dropwizard bundles could be also registered with
GuiceyBootstrap.dropwizardBundles(io.dropwizard.core.ConfiguredBundle[])
shortcut (or by directly accessing dropwizard bootstrap object:GuiceyBootstrap.bootstrap()
.As bundles could be registered only during initialization phase, it is not possible to avoid bundle registration based on configuration (not a good practice). But, it is possible to use guicey options instead: for example, map option from environment variable and use to to decide if some bundles should be activated.
Guicey lifecycle listeners (
GuiceyLifecycleListener
could be registered only on initialization phase (GuiceyBootstrap.listen(ru.vyarus.dropwizard.guice.module.lifecycle.GuiceyLifecycleListener...)
).- Parameters:
bootstrap
- guicey bootstrap object
-
-