/*
- * Sone - SonePlugin.java - Copyright © 2010–2019 David Roden
+ * Sone - SonePlugin.java - Copyright © 2010–2020 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/** The core. */
private Core core;
+ /** The event bus. */
+ private EventBus eventBus;
+
/** The web interface. */
private WebInterface webInterface;
/* we need to request this to install all notification handlers. */
injector.getInstance(NotificationHandler.class);
+ /* and this is required to shutdown all tickers. */
+ injector.getInstance(TickerShutdown.class);
+
/* start core! */
core.start();
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();