projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
✨ Send shutdown event on termination
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
main
/
SonePlugin.java
diff --git
a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java
b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java
index
91f21eb
..
ef9f05a
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/main/SonePlugin.java
+++ b/
src/main/java/net/pterodactylus/sone/main/SonePlugin.java
@@
-110,6
+110,9
@@
public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
/** The core. */
private Core core;
/** The core. */
private Core core;
+ /** The event bus. */
+ private EventBus eventBus;
+
/** The web interface. */
private WebInterface webInterface;
/** The web interface. */
private WebInterface webInterface;
@@
-212,7
+215,7
@@
public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
webInterface.start();
/* send some events on startup */
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")))) {
/* first start? */
if (injector.getInstance(Key.get(Boolean.class, Names.named("FirstStart")))) {
@@
-247,6
+250,9
@@
public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
*/
@Override
public void terminate() {
*/
@Override
public void terminate() {
+ /* send shutdown event. */
+ eventBus.post(new Shutdown());
+
try {
/* stop the web interface. */
webInterface.stop();
try {
/* stop the web interface. */
webInterface.stop();