The replacement for FactoryProvider is FactoryModuleBuilder. It will return a Module to install
, instead, but in your Module you can call getProvider
to get a valid-at-Injector-creation Provider for your type.
In theory you should not want to access your types until the Injector is created (as some dependencies might be bound in other modules, for instance); this may require you to refactor to use a Provider in your MethodInterceptor, or install your interceptor in a child injector so you can get an instance of your Factory from a "parent" injector.
install(new FactoryModuleBuilder().build(WindowedCounterFactory.class));
bindInterceptor(Matchers.any(), Matchers.annotatedWith(RateLimited.class),
new RateLimitingInterceptor(getProvider(WindowedCounterFactory.class)));