Inject dbExecutor as ExecutorService. #189

This commit is contained in:
akwizgran
2015-12-18 11:28:18 +00:00
parent 766179ac97
commit b7fe802d5d
3 changed files with 56 additions and 19 deletions

View File

@@ -55,8 +55,13 @@ public class DatabaseModule extends AbstractModule {
}
@Provides @Singleton @DatabaseExecutor
Executor getDatabaseExecutor(LifecycleManager lifecycleManager) {
ExecutorService getDatabaseExecutor(LifecycleManager lifecycleManager) {
lifecycleManager.registerForShutdown(databaseExecutor);
return databaseExecutor;
}
@Provides @Singleton @DatabaseExecutor
Executor getDatabaseExecutor(@DatabaseExecutor ExecutorService dbExecutor) {
return dbExecutor;
}
}