+ bind(Version.class).toInstance(Version.parse(getVersion()));
+ bind(PluginVersion.class).toInstance(new PluginVersion(getVersion()));
+ bind(PluginYear.class).toInstance(new PluginYear(getYear()));
+ bind(PluginHomepage.class).toInstance(new PluginHomepage(getHomepage()));
+ bind(Database.class).to(MemoryDatabase.class).in(Singleton.class);
+ bind(BaseL10n.class).toInstance(l10n.getBase());
+ bind(SoneProvider.class).to(Core.class).in(Singleton.class);
+ bind(PostProvider.class).to(Core.class).in(Singleton.class);
+ if (startConfiguration.getBooleanValue("Developer.LoadFromFilesystem").getValue(false)) {
+ String path = startConfiguration.getStringValue("Developer.FilesystemPath").getValue(null);
+ if (path != null) {
+ bind(Loaders.class).toInstance(new DebugLoaders(path));
+ }
+ }
+ bindListener(Matchers.any(), new TypeListener() {
+
+ @Override
+ public <I> void hear(TypeLiteral<I> typeLiteral, TypeEncounter<I> typeEncounter) {
+ typeEncounter.register(new InjectionListener<I>() {
+
+ @Override
+ public void afterInjection(I injectee) {
+ eventBus.register(injectee);
+ }
+ });
+ }
+ });
+ }
+
+ private TypeLiteral<Optional<Context>> getOptionalContextTypeLiteral() {
+ return new TypeLiteral<Optional<Context>>() {
+ };