- /* create core. */
- core = new Core(oldConfiguration, freenetInterface, identityManager, trustUpdater);
+ @Override
+ protected void configure() {
+ bind(EventBus.class).toInstance(eventBus);
+ bind(Configuration.class).toInstance(startConfiguration);
+ Context context = new Context("Sone");
+ bind(Context.class).toInstance(context);
+ bind(getOptionalContextTypeLiteral()).toInstance(of(context));
+ bind(SonePlugin.class).toInstance(SonePlugin.this);
+ bind(Version.class).toInstance(VERSION);
+ 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);
+ }
+ });
+ }
+ });
+ }