🔀 Merge other “next” branch into this “next”
[Sone.git] / src / main / java / net / pterodactylus / sone / main / SonePlugin.java
index f2cf128..7723db1 100644 (file)
@@ -34,8 +34,10 @@ import freenet.support.*;
 import freenet.support.api.*;
 
 import com.google.common.annotations.*;
+import com.google.common.eventbus.*;
 import com.google.common.cache.*;
 import com.google.inject.*;
+import com.google.inject.Module;
 import com.google.inject.name.*;
 import kotlin.jvm.functions.*;
 
@@ -50,12 +52,13 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
        static {
                /* initialize logging. */
                soneLogger.setUseParentHandlers(false);
+               soneLogger.setLevel(Level.ALL);
                soneLogger.addHandler(new Handler() {
                        private final LoadingCache<String, Class<?>> classCache = CacheBuilder.newBuilder()
                                        .build(new CacheLoader<String, Class<?>>() {
                                                @Override
                                                public Class<?> load(String key) throws Exception {
-                                                       return Class.forName(key);
+                                                       return SonePlugin.class.getClassLoader().loadClass(key);
                                                }
                                        });
 
@@ -204,7 +207,7 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
        @VisibleForTesting
        protected Injector createInjector() {
                FreenetModule freenetModule = new FreenetModule(pluginRespirator);
-               AbstractModule soneModule = new SoneModule(this);
+               AbstractModule soneModule = new SoneModule(this, new EventBus());
                Module webInterfaceModule = new WebInterfaceModule();
 
                return createInjector(freenetModule, soneModule, webInterfaceModule);