Skip to content

Instantly share code, notes, and snippets.

@niloc132
Last active December 17, 2015 05:28
Show Gist options
  • Save niloc132/5557812 to your computer and use it in GitHub Desktop.
Save niloc132/5557812 to your computer and use it in GitHub Desktop.
public class MyGinModule extends AbstractGinModule {
public void configure() {
//...
//OPTION 1 part 1
bind(Scheduler.class).toProvider(MySchedulerProvider.class);
//...
}
//OPTION 2
@Provides
public Scheduler provideScheduler() {
return Scheduler.get();
}
}
//OPTION 1 part 2
public class MySchedulerProvider implements Provider<Scheduler> {
@Override
public Scheduler get() {
return Scheduler.get();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment