import java.util.logging.Logger;
import java.util.logging.*;
+import javax.annotation.Nonnull;
+
import net.pterodactylus.sone.core.*;
import net.pterodactylus.sone.core.event.*;
import net.pterodactylus.sone.fcp.*;
private final LoadingCache<String, Class<?>> classCache = CacheBuilder.newBuilder()
.build(new CacheLoader<String, Class<?>>() {
@Override
- public Class<?> load(String key) throws Exception {
+ public Class<?> load(@Nonnull String key) throws Exception {
return SonePlugin.class.getClassLoader().loadClass(key);
}
});
/** The core. */
private Core core;
+ /** The event bus. */
+ private EventBus eventBus;
+
/** The web interface. */
private WebInterface webInterface;
webInterface.start();
/* send some events on startup */
- EventBus eventBus = injector.getInstance(EventBus.class);
+ eventBus = injector.getInstance(EventBus.class);
/* first start? */
if (injector.getInstance(Key.get(Boolean.class, Names.named("FirstStart")))) {
*/
@Override
public void terminate() {
+ /* send shutdown event. */
+ eventBus.post(new Shutdown());
+
try {
/* stop the web interface. */
webInterface.stop();