Last active
December 17, 2015 05:28
-
-
Save niloc132/5557812 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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