diff --git a/oxalis-commons/src/main/java/network/oxalis/commons/statistics/StatisticsModule.java b/oxalis-commons/src/main/java/network/oxalis/commons/statistics/StatisticsModule.java index 09ee47ded..952f63f94 100644 --- a/oxalis-commons/src/main/java/network/oxalis/commons/statistics/StatisticsModule.java +++ b/oxalis-commons/src/main/java/network/oxalis/commons/statistics/StatisticsModule.java @@ -25,6 +25,8 @@ import com.google.inject.Injector; import com.google.inject.Provides; import com.google.inject.Singleton; +import com.google.inject.name.Named; +import network.oxalis.api.plugin.PluginFactory; import network.oxalis.api.settings.Settings; import network.oxalis.api.statistics.StatisticsService; import network.oxalis.commons.guice.ImplLoader; @@ -44,4 +46,11 @@ protected void configure() { protected StatisticsService getStatisticsService(Injector injector, Settings settings) { return ImplLoader.get(injector, StatisticsService.class, settings, StatisticsConf.SERVICE); } + + @Provides + @Singleton + @Named("statistics-plugin") + protected StatisticsService getPluginStatisticsService(PluginFactory pluginFactory) { + return pluginFactory.newInstance(StatisticsService.class); + } }