/** * Returns a module which creates bindings for provider methods from the given object. This is * useful notably for <a href="http://code.google.com/p/google-gin/">GIN</a> * * <p>This will skip bytecode generation for provider methods, since it is assumed that callers * are only interested in Module metadata. */ public static Module forObject(Object object) { return forObject(object, true, ProvidesMethodScanner.INSTANCE); }
/** Returns a module which creates bindings methods in the module that match the scanner. */ public static Module forModule(Object module, ModuleAnnotatedMethodScanner scanner) { return forObject(module, false, scanner); }
/** Returns a module which creates bindings for provider methods from the given module. */ public static Module forModule(Module module) { return forObject(module, false, ProvidesMethodScanner.INSTANCE); }
/** * Install a {@link Jooby.Module}. * * @param log Logger. * @param module The module to install. * @param env Application env. * @param config The configuration object. * @param binder A Guice binder. * @throws Throwable If module bootstrap fails. */ private static void install(final Logger log, final Jooby.Module module, final Env env, final Config config, final Binder binder) throws Throwable { module.configure(env, config, binder); try { binder.install(ProviderMethodsModule.forObject(module)); } catch (NoClassDefFoundError x) { // Allow dynamic linking of optional dependencies (required by micrometer module), we ignore // missing classes here, if there is a missing class Jooby is going to fails early (not here) log.debug("ignoring class not found from guice provider method", x); } }
/** * Returns a module which creates bindings for provider methods from the given object. * This is useful notably for <a href="http://code.google.com/p/google-gin/">GIN</a> * * <p>This will skip bytecode generation for provider methods, since it is assumed that callers * are only interested in Module metadata. */ public static Module forObject(Object object) { return forObject(object, true, PROVIDES_BUILDER); }
/** * Returns a module which creates bindings for provider methods from the given module. */ public static Module forModule(Module module) { return forObject(module); }
/** * Returns a module which creates bindings for provider methods from the given object. This is * useful notably for <a href="http://code.google.com/p/google-gin/">GIN</a> * * <p>This will skip bytecode generation for provider methods, since it is assumed that callers * are only interested in Module metadata. */ public static Module forObject(Object object) { return forObject(object, true, ProvidesMethodScanner.INSTANCE); }
/** * Returns a module which creates bindings for provider methods from the given object. This is * useful notably for <a href="http://code.google.com/p/google-gin/">GIN</a> * * <p>This will skip bytecode generation for provider methods, since it is assumed that callers * are only interested in Module metadata. */ public static Module forObject(Object object) { return forObject(object, true, ProvidesMethodScanner.INSTANCE); }
/** * Returns a module which creates bindings for provider methods from the given module. */ public static Module forModule(Module module) { return forObject(module); }
/** * Returns a module which creates bindings for provider methods from the given module. */ public static Module forModule(Module module) { return forObject(module, false, PROVIDES_BUILDER); }
/** * Returns a module which creates bindings methods in the module that match the scanner. */ public static Module forModule(Object module, ModuleAnnotatedMethodScanner scanner) { return forObject(module, false, scanner); }
/** * Returns a module which creates bindings for provider methods from the given module. */ public static Module forModule(Module module) { return forObject(module); }
/** Returns a module which creates bindings for provider methods from the given module. */ public static Module forModule(Module module) { return forObject(module, false, ProvidesMethodScanner.INSTANCE); }
/** Returns a module which creates bindings methods in the module that match the scanner. */ public static Module forModule(Object module, ModuleAnnotatedMethodScanner scanner) { return forObject(module, false, scanner); }
/** Returns a module which creates bindings for provider methods from the given module. */ public static Module forModule(Module module) { return forObject(module, false, ProvidesMethodScanner.INSTANCE); }
/** Returns a module which creates bindings methods in the module that match the scanner. */ public static Module forModule(Object module, ModuleAnnotatedMethodScanner scanner) { return forObject(module, false, scanner); }
/** * Install a {@link Jooby.Module}. * * @param log Logger. * @param module The module to install. * @param env Application env. * @param config The configuration object. * @param binder A Guice binder. * @throws Throwable If module bootstrap fails. */ private static void install(final Logger log, final Jooby.Module module, final Env env, final Config config, final Binder binder) throws Throwable { module.configure(env, config, binder); try { binder.install(ProviderMethodsModule.forObject(module)); } catch (NoClassDefFoundError x) { // Allow dynamic linking of optional dependencies (required by micrometer module), we ignore // missing classes here, if there is a missing class Jooby is going to fails early (not here) log.debug("ignoring class not found from guice provider method", x); } }
public void configure(Binder binder) { // For Guice error reporting, ignore the adapters binder = binder.skipSources(GinModuleAdapter.class, BinderAdapter.class, AbstractGinModule.class); ginModule.configure(new BinderAdapter(binder, bindings)); // Install provider methods from the GinModule binder.install(ProviderMethodsModule.forObject(ginModule)); }
public void configure() { Binder binder = binder().skipSources(PrivateGinModuleAdapter.class, BinderAdapter.class, PrivateBinderAdapter.class, PrivateGinModule.class); ginModule.configure(new PrivateBinderAdapter((PrivateBinder) binder, bindings == null ? null : bindings.createChildGinjectorBindings(ginModule.getClass()))); // Install provider methods from the GinModule binder.install(ProviderMethodsModule.forObject(ginModule)); }