import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
+import com.google.common.eventbus.EventBus;
import com.google.inject.Inject;
import freenet.keys.FreenetURI;
/** The core listener manager. */
private final CoreListenerManager coreListenerManager = new CoreListenerManager(this);
+ /** The event bus. */
+ private final EventBus eventBus;
+
/** The configuration. */
private Configuration configuration;
* The identity manager
* @param webOfTrustUpdater
* The WebOfTrust updater
+ * @param eventBus
+ * The event bus
*/
@Inject
- public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager, WebOfTrustUpdater webOfTrustUpdater) {
+ public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager, WebOfTrustUpdater webOfTrustUpdater, EventBus eventBus) {
super("Sone Core");
this.configuration = configuration;
this.freenetInterface = freenetInterface;
this.imageInserter = new ImageInserter(this, freenetInterface);
this.updateChecker = new UpdateChecker(freenetInterface);
this.webOfTrustUpdater = webOfTrustUpdater;
+ this.eventBus = eventBus;
}
//
import net.pterodactylus.util.logging.LoggingListener;
import net.pterodactylus.util.version.Version;
+import com.google.common.eventbus.EventBus;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
}
final Configuration startConfiguration = oldConfiguration;
+ final EventBus eventBus = new EventBus();
/* Freenet injector configuration. */
AbstractModule freenetModule = new AbstractModule() {
@Override
protected void configure() {
+ bind(EventBus.class).toInstance(eventBus);
bind(Configuration.class).toInstance(startConfiguration);
bind(FreenetInterface.class).in(Singleton.class);
bind(PluginConnector.class).in(Singleton.class);