Class BundleSupport
java.lang.Object
ru.vyarus.dropwizard.guice.module.installer.util.BundleSupport
Utility class to work with registered
ConfiguredBundle objects within dropwizard
Bootstrap object.- Since:
- 01.08.2015
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>findBundles(io.dropwizard.core.setup.Bootstrap bootstrap, Class<T> type) static voidinitBundles(ConfigurationContext context) Process initialization for initially registered and all transitive bundles.static voidinitBundles(ConfigurationContext context, GuiceyBootstrap bootstrap, List<Class<? extends GuiceyBundle>> path, List<GuiceyBundle> initOrder, List<GuiceyBundle> bundles) Point of root (registered in guice bundle) bundles installation.static <T> List<T>removeDuplicates(List<T> list) Remove duplicates in list by rule: only one instance of type must be present in list.static <T> List<T>removeTypes(List<T> list, List<Class<? extends T>> filter) Filter list from objects of type present in filter list.static voidrunBundles(ConfigurationContext context) Run all enabled bundles (and delayed configurations).
-
Method Details
-
initBundles
Process initialization for initially registered and all transitive bundles.- Executing initial bundles initialization (registered in
GuiceBundleand by bundle lookup) - During execution bundles may register other bundles (through
GuiceyBootstrap) - Execute registered bundles and repeat from previous step until no new bundles registered
- Parameters:
context- configuration context
- Executing initial bundles initialization (registered in
-
initBundles
public static void initBundles(ConfigurationContext context, GuiceyBootstrap bootstrap, List<Class<? extends GuiceyBundle>> path, List<GuiceyBundle> initOrder, List<GuiceyBundle> bundles) Point of root (registered in guice bundle) bundles installation. Also, called in guicey bootstrap for transitive bundles installation (immediate initialization).- Parameters:
context- configuration contextbootstrap- guicey bootstrap objectpath- transitive bundles installation pathinitOrder- bundles initialization order (appendable)bundles- bundles to install
-
runBundles
Run all enabled bundles (and delayed configurations).- Parameters:
context- bundles context- Throws:
Exception- if something goes wrong
-
removeDuplicates
Remove duplicates in list by rule: only one instance of type must be present in list.- Type Parameters:
T- required bundle type- Parameters:
list- bundles list- Returns:
- list cleared from duplicates
-
removeTypes
Filter list from objects of type present in filter list.- Type Parameters:
T- required type- Parameters:
list- list to filterfilter- types to filter- Returns:
- filtered list
-
findBundles
- Type Parameters:
T- required bundle type- Parameters:
bootstrap- dropwizard bootstrap instancetype- required bundle type (or marker interface)- Returns:
- list of bundles of specified type
-