Class DefaultBundleLookup

  • All Implemented Interfaces:
    GuiceyBundleLookup

    public class DefaultBundleLookup
    extends java.lang.Object
    implements GuiceyBundleLookup
    Default implementation of bundles lookup mechanism. Did not implement lookup logic but compose more simple lookups. Additionally, logs all resolved bundles.

    By default includes:

    Any simple lookup may be registered directly in builder instead of default lookup (the same contract).

    Additional lookups could be added using addLookup(GuiceyBundleLookup) method. Default lookup implementation could be customized by calling constructor with custom loaders list.

    Since:
    15.01.2016
    • Constructor Detail

      • DefaultBundleLookup

        public DefaultBundleLookup()
        Use predefined lookups.
      • DefaultBundleLookup

        public DefaultBundleLookup​(GuiceyBundleLookup... lookups)
        Parameters:
        lookups - lookups to use instead of defaults
    • Method Detail

      • lookup

        public java.util.List<GuiceyBundle> lookup()
        Description copied from interface: GuiceyBundleLookup
        Called before guice injector creation to lookup additional bundles (in dropwizard run phase).
        Specified by:
        lookup in interface GuiceyBundleLookup
        Returns:
        list of found bundles or empty list
      • addLookup

        public DefaultBundleLookup addLookup​(GuiceyBundleLookup lookup)
        Add additional lookup mechanism.
        Parameters:
        lookup - lookup implementation
        Returns:
        default lookup instance for chained calls