- boolean startupFailed = true;
- try {
- /* create freenet interface. */
- FreenetInterface freenetInterface = new FreenetInterface(pluginRespirator.getNode());
-
- /* create web of trust connector. */
- PluginConnector pluginConnector = new PluginConnector(pluginRespirator);
- webOfTrustConnector = new WebOfTrustConnector(pluginConnector);
- identityManager = new IdentityManager(webOfTrustConnector);
- identityManager.setContext("Sone");
-
- /* create core. */
- core = new Core(oldConfiguration, freenetInterface, identityManager);
-
- /* create the web interface. */
- webInterface = new WebInterface(this);
- core.addCoreListener(webInterface);
-
- /* create FCP interface. */
- fcpInterface = new FcpInterface(core);
- core.setFcpInterface(fcpInterface);
-
- /* create the identity manager. */
- identityManager.addIdentityListener(core);
-
- /* start core! */
- core.start();
- if ((newConfiguration != null) && (oldConfiguration != newConfiguration)) {
- logger.log(Level.INFO, "Setting configuration to file-based configuration.");
- core.setConfiguration(newConfiguration);
+ final Configuration startConfiguration;
+ if ((newConfiguration != null) && (oldConfiguration != newConfiguration)) {
+ logger.log(Level.INFO, "Setting configuration to file-based configuration.");
+ startConfiguration = newConfiguration;
+ } else {
+ startConfiguration = oldConfiguration;
+ }
+ final EventBus eventBus = new EventBus();
+
+ /* Freenet injector configuration. */
+ AbstractModule freenetModule = new AbstractModule() {
+
+ @Override
+ @SuppressWarnings("synthetic-access")
+ protected void configure() {
+ bind(PluginRespirator.class).toInstance(SonePlugin.this.pluginRespirator);
+ bind(Node.class).toInstance(SonePlugin.this.pluginRespirator.getNode());