Class PropertyBundleLookup
java.lang.Object
ru.vyarus.dropwizard.guice.bundle.lookup.PropertyBundleLookup
- All Implemented Interfaces:
GuiceyBundleLookup
Use 'guicey.bundles' system property to lookup bundles. Property value must contain comma-separated list of
complete bundle class names. Each bundle in list must have default no-args constructor.
Example: -Dguicey.bundles=com.foo.MyBundle1,com.foo.MyBundle2.
Static shortcut method may be used to set property value from code (for example, in unit tests to enable
specific debug bundle): PropertyBundleLookup.enableBundles(MyBundle1.class, MyBundle2.class).
For example, last approach is used in guicey tests to enable
HK2DebugBundle to check beans boundaries during tests.
- Since:
- 16.01.2016
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidenableBundles(Class<? extends GuiceyBundle>... bundles) Sets system property value to provided classes.lookup()Called before guice injector creation to lookup additional bundles (in dropwizard run phase).
-
Field Details
-
BUNDLES_PROPERTY
Bundles system property.- See Also:
-
-
Constructor Details
-
PropertyBundleLookup
public PropertyBundleLookup()
-
-
Method Details
-
lookup
Description copied from interface:GuiceyBundleLookupCalled before guice injector creation to lookup additional bundles (in dropwizard run phase).- Specified by:
lookupin interfaceGuiceyBundleLookup- Returns:
- list of found bundles or empty list
-
enableBundles
Sets system property value to provided classes. Shortcut is useful to set property from code, for example, in unit tests.- Parameters:
bundles- bundles to enable
-