Bladeren bron

MBassador.

Change-Id: I2baa7e986ded54930093768238ed24cab8cf4bf7
Depends-On: I2cf35d5859c85c3609002f126241536fda5d588e
Reviewed-on: http://gerrit.dmdirc.com/3769
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
pull/1/head
Greg Holmes 9 jaren geleden
bovenliggende
commit
b12a0cb412
100 gewijzigde bestanden met toevoegingen van 357 en 522 verwijderingen
  1. 10
    4
      build.xml
  2. 1
    0
      ivy.xml
  3. 4
    3
      src/com/dmdirc/Channel.java
  4. 6
    5
      src/com/dmdirc/ChannelEventHandler.java
  5. 3
    3
      src/com/dmdirc/ChannelFactory.java
  6. 12
    14
      src/com/dmdirc/ClientModule.java
  7. 2
    2
      src/com/dmdirc/CustomWindow.java
  8. 10
    9
      src/com/dmdirc/FrameContainer.java
  9. 2
    2
      src/com/dmdirc/GlobalWindow.java
  10. 7
    8
      src/com/dmdirc/Main.java
  11. 5
    5
      src/com/dmdirc/MessageEncoder.java
  12. 3
    3
      src/com/dmdirc/MessageEncoderFactory.java
  13. 2
    2
      src/com/dmdirc/MessageTarget.java
  14. 5
    5
      src/com/dmdirc/ParserFactory.java
  15. 7
    7
      src/com/dmdirc/Query.java
  16. 10
    10
      src/com/dmdirc/Server.java
  17. 8
    8
      src/com/dmdirc/ServerEventHandler.java
  18. 3
    3
      src/com/dmdirc/ServerFactoryImpl.java
  19. 5
    4
      src/com/dmdirc/ServerManager.java
  20. 8
    8
      src/com/dmdirc/actions/Action.java
  21. 3
    3
      src/com/dmdirc/actions/ActionFactory.java
  22. 14
    14
      src/com/dmdirc/actions/ActionManager.java
  23. 8
    8
      src/com/dmdirc/actions/internal/WhoisNumericFormatter.java
  24. 7
    7
      src/com/dmdirc/actions/wrappers/PerformWrapper.java
  25. 5
    5
      src/com/dmdirc/commandparser/PopupManager.java
  26. 3
    3
      src/com/dmdirc/commandparser/auto/AutoCommandHandler.java
  27. 8
    8
      src/com/dmdirc/commandparser/auto/AutoCommandManager.java
  28. 3
    3
      src/com/dmdirc/commandparser/commands/global/OpenWindow.java
  29. 6
    5
      src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java
  30. 2
    2
      src/com/dmdirc/commandparser/parsers/ChannelCommandParser.java
  31. 2
    2
      src/com/dmdirc/commandparser/parsers/ChatCommandParser.java
  32. 5
    5
      src/com/dmdirc/commandparser/parsers/CommandParser.java
  33. 2
    2
      src/com/dmdirc/commandparser/parsers/GlobalCommandParser.java
  34. 2
    2
      src/com/dmdirc/commandparser/parsers/QueryCommandParser.java
  35. 2
    2
      src/com/dmdirc/commandparser/parsers/ServerCommandParser.java
  36. 18
    18
      src/com/dmdirc/config/IdentityManager.java
  37. 6
    6
      src/com/dmdirc/config/prefs/PreferencesDialogModel.java
  38. 6
    6
      src/com/dmdirc/config/prefs/PreferencesManager.java
  39. 0
    2
      src/com/dmdirc/events/ActionCreatedEvent.java
  40. 0
    2
      src/com/dmdirc/events/ActionDeletedEvent.java
  41. 0
    2
      src/com/dmdirc/events/ActionUpdatedEvent.java
  42. 0
    2
      src/com/dmdirc/events/AppErrorEvent.java
  43. 0
    2
      src/com/dmdirc/events/ChannelGotnamesEvent.java
  44. 0
    3
      src/com/dmdirc/events/ClientClosedEvent.java
  45. 0
    3
      src/com/dmdirc/events/ClientClosingEvent.java
  46. 0
    3
      src/com/dmdirc/events/ClientFocusGainedEvent.java
  47. 0
    3
      src/com/dmdirc/events/ClientFocusLostEvent.java
  48. 0
    2
      src/com/dmdirc/events/ClientFrameChangedEvent.java
  49. 0
    3
      src/com/dmdirc/events/ClientKeyPressedEvent.java
  50. 0
    2
      src/com/dmdirc/events/ClientLineAddedEvent.java
  51. 0
    3
      src/com/dmdirc/events/ClientMinimisedEvent.java
  52. 0
    3
      src/com/dmdirc/events/ClientOpenedEvent.java
  53. 0
    2
      src/com/dmdirc/events/ClientPopupGeneratedEvent.java
  54. 0
    3
      src/com/dmdirc/events/ClientPrefsClosedEvent.java
  55. 0
    2
      src/com/dmdirc/events/ClientPrefsOpenedEvent.java
  56. 0
    3
      src/com/dmdirc/events/ClientUnminimisedEvent.java
  57. 0
    2
      src/com/dmdirc/events/ClientUserInputEvent.java
  58. 3
    3
      src/com/dmdirc/events/EventUtils.java
  59. 0
    3
      src/com/dmdirc/events/FeedbackNagEvent.java
  60. 0
    2
      src/com/dmdirc/events/FrameChangedEvent.java
  61. 0
    2
      src/com/dmdirc/events/FrameIconChangedEvent.java
  62. 0
    2
      src/com/dmdirc/events/FrameNameChangedEvent.java
  63. 0
    2
      src/com/dmdirc/events/FrameTitleChangedEvent.java
  64. 0
    2
      src/com/dmdirc/events/LinkChannelClickedEvent.java
  65. 0
    2
      src/com/dmdirc/events/LinkNicknameClickedEvent.java
  66. 0
    2
      src/com/dmdirc/events/LinkUrlClickedEvent.java
  67. 0
    2
      src/com/dmdirc/events/PluginLoadedEvent.java
  68. 0
    3
      src/com/dmdirc/events/PluginRefreshEvent.java
  69. 0
    2
      src/com/dmdirc/events/PluginUnloadedEvent.java
  70. 0
    2
      src/com/dmdirc/events/QueryClosedEvent.java
  71. 0
    2
      src/com/dmdirc/events/ServerGotpingEvent.java
  72. 0
    2
      src/com/dmdirc/events/ServerNopingEvent.java
  73. 0
    2
      src/com/dmdirc/events/ServerPingsentEvent.java
  74. 0
    2
      src/com/dmdirc/events/UserErrorEvent.java
  75. 2
    2
      src/com/dmdirc/interfaces/GroupChat.java
  76. 6
    7
      src/com/dmdirc/logger/ErrorManager.java
  77. 5
    5
      src/com/dmdirc/plugins/CorePluginExtractor.java
  78. 5
    5
      src/com/dmdirc/plugins/LegacyServiceLocator.java
  79. 16
    17
      src/com/dmdirc/plugins/PluginInfo.java
  80. 3
    3
      src/com/dmdirc/plugins/PluginInjectorInitialiser.java
  81. 17
    18
      src/com/dmdirc/plugins/PluginManager.java
  82. 12
    12
      src/com/dmdirc/ui/core/util/URLHandler.java
  83. 5
    5
      src/com/dmdirc/ui/input/InputHandler.java
  84. 6
    6
      src/com/dmdirc/ui/themes/Theme.java
  85. 7
    6
      src/com/dmdirc/ui/themes/ThemeManager.java
  86. 8
    8
      src/com/dmdirc/updater/UpdateChecker.java
  87. 2
    2
      src/com/dmdirc/updater/UpdaterModule.java
  88. 0
    37
      src/com/dmdirc/util/AsyncEvent.java
  89. 12
    11
      src/com/dmdirc/util/ChildEventBusManager.java
  90. 0
    55
      src/com/dmdirc/util/DynamicAsyncEventBus.java
  91. 10
    10
      src/com/dmdirc/util/URLBuilder.java
  92. 2
    2
      test/com/dmdirc/ServerManagerTest.java
  93. 2
    2
      test/com/dmdirc/ServerTest.java
  94. 2
    2
      test/com/dmdirc/WritableFrameContainerTest.java
  95. 2
    2
      test/com/dmdirc/actions/ActionTest.java
  96. 2
    2
      test/com/dmdirc/commandparser/parsers/CommandParserTest.java
  97. 5
    5
      test/com/dmdirc/config/prefs/PreferencesDialogModelTest.java
  98. 6
    6
      test/com/dmdirc/config/prefs/PreferencesManagerTest.java
  99. 2
    2
      test/com/dmdirc/harness/TestCommandParser.java
  100. 0
    0
      test/com/dmdirc/harness/TestWritableFrameContainer.java

+ 10
- 4
build.xml Bestand weergeven

@@ -75,9 +75,15 @@
75 75
     </target>
76 76
 
77 77
     <target name="-bundle-guava">
78
-      <jar destfile="${dist.jar}" update="true">
79
-          <zipfileset src="lib/main/guava.jar" includes="com/google/**"/>
80
-      </jar>
78
+        <jar destfile="${dist.jar}" update="true">
79
+            <zipfileset src="lib/main/guava.jar" includes="com/google/**"/>
80
+        </jar>
81
+    </target>
82
+
83
+    <target name="-bundle-mbassador">
84
+        <jar destfile="${dist.jar}" update="true">
85
+            <zipfileset src="lib/main/mbassador.jar" includes="net/engio/**"/>
86
+        </jar>
81 87
     </target>
82 88
 
83 89
     <target name="-bundle-yamlreader">
@@ -93,6 +99,6 @@
93 99
     <target name="-pre-init" depends="-init-dependencies,-init-submodule-dependencies,-init-private-properties"/>
94 100
     <target name="-post-compile" depends="-write-version, build-plugins"/>
95 101
     <target name="-post-test-run" depends="-do-test-reports"/>
96
-    <target name="-post-jar" depends="-update-bundled-plugins,-bundle-slf4j,-bundle-dagger,-bundle-base64,-bundle-guava,-bundle-raven,-bundle-yamlreader"/>
102
+    <target name="-post-jar" depends="-update-bundled-plugins,-bundle-slf4j,-bundle-dagger,-bundle-base64,-bundle-guava,-bundle-mbassador,-bundle-raven,-bundle-yamlreader"/>
97 103
 
98 104
 </project>

+ 1
- 0
ivy.xml Bestand weergeven

@@ -30,6 +30,7 @@
30 30
         <dependency org="net.kencochrane.raven" name="raven" rev="4.+" conf="bundled,main->default" />
31 31
 
32 32
         <dependency org="com.google.guava" name="guava" rev="17.+" conf="bundled,main->default" />
33
+        <dependency org="net.engio" name="mbassador" rev="1.1.10" conf="bundled,main->default" />
33 34
 
34 35
         <dependency org="junit" name="junit" rev="4.+" conf="test->default" />
35 36
         <dependency org="org.mockito" name="mockito-all" rev="1.+" conf="test->default" />

+ 4
- 3
src/com/dmdirc/Channel.java Bestand weergeven

@@ -51,7 +51,6 @@ import com.dmdirc.util.collections.ListenerList;
51 51
 import com.dmdirc.util.collections.RollingList;
52 52
 
53 53
 import com.google.common.base.Optional;
54
-import com.google.common.eventbus.EventBus;
55 54
 
56 55
 import java.util.ArrayList;
57 56
 import java.util.Arrays;
@@ -62,6 +61,8 @@ import java.util.Map;
62 61
 
63 62
 import javax.annotation.Nonnull;
64 63
 
64
+import net.engio.mbassy.bus.MBassador;
65
+
65 66
 /**
66 67
  * The Channel class represents the client's view of the channel. It handles callbacks for channel
67 68
  * events from the parser, maintains the corresponding ChannelWindow, and handles user input for the
@@ -113,7 +114,7 @@ public class Channel extends MessageTarget implements GroupChat {
113 114
             final CommandController commandController,
114 115
             final MessageSinkManager messageSinkManager,
115 116
             final URLBuilder urlBuilder,
116
-            final EventBus eventBus) {
117
+            final MBassador eventBus) {
117 118
         super(newServer, "channel-inactive", newChannelInfo.getName(),
118 119
                 Styliser.stipControlCodes(newChannelInfo.getName()),
119 120
                 configMigrator.getConfigProvider(),
@@ -307,7 +308,7 @@ public class Channel extends MessageTarget implements GroupChat {
307 308
         }
308 309
 
309 310
         // Trigger action for the window closing
310
-        getEventBus().post(new ChannelClosedEvent(this));
311
+        getEventBus().publish(new ChannelClosedEvent(this));
311 312
 
312 313
         // Inform any parents that the window is closing
313 314
         server.delChannel(channelInfo.getName());

+ 6
- 5
src/com/dmdirc/ChannelEventHandler.java Bestand weergeven

@@ -72,12 +72,13 @@ import com.dmdirc.parser.interfaces.callbacks.OtherAwayStateListener;
72 72
 
73 73
 import com.google.common.base.Optional;
74 74
 import com.google.common.base.Strings;
75
-import com.google.common.eventbus.EventBus;
76 75
 
77 76
 import java.util.Date;
78 77
 
79 78
 import javax.annotation.Nonnull;
80 79
 
80
+import net.engio.mbassy.bus.MBassador;
81
+
81 82
 /**
82 83
  * Handles events for channel objects.
83 84
  */
@@ -93,9 +94,9 @@ public class ChannelEventHandler extends EventHandler implements
93 94
     /** The channel that owns this event handler. */
94 95
     private final Channel owner;
95 96
     /** Event bus to send events on. */
96
-    private final EventBus eventBus;
97
+    private final MBassador eventBus;
97 98
 
98
-    public ChannelEventHandler(final Channel owner, final EventBus eventBus) {
99
+    public ChannelEventHandler(final Channel owner, final MBassador eventBus) {
99 100
         this.owner = owner;
100 101
         this.eventBus = eventBus;
101 102
     }
@@ -145,7 +146,7 @@ public class ChannelEventHandler extends EventHandler implements
145 146
         checkParser(parser);
146 147
 
147 148
         owner.setClients(channel.getChannelClients());
148
-        eventBus.post(new ChannelGotnamesEvent(owner));
149
+        eventBus.publishAsync(new ChannelGotnamesEvent(owner));
149 150
     }
150 151
 
151 152
     @Override
@@ -173,7 +174,7 @@ public class ChannelEventHandler extends EventHandler implements
173 174
             final String format = EventUtils.postDisplayable(eventBus, event,
174 175
                     Strings.isNullOrEmpty(channel.getTopic())
175 176
                     ? "channelTopicRemoved" : "channelTopicChanged");
176
-            eventBus.post(event);
177
+            eventBus.publish(event);
177 178
             owner.doNotification(date, format, channel.getChannelClient(channel.getTopicSetter(),
178 179
                     true), channel.getTopic());
179 180
         }

+ 3
- 3
src/com/dmdirc/ChannelFactory.java Bestand weergeven

@@ -29,7 +29,7 @@ import com.dmdirc.parser.interfaces.ChannelInfo;
29 29
 import com.dmdirc.ui.input.TabCompleterFactory;
30 30
 import com.dmdirc.util.URLBuilder;
31 31
 
32
-import com.google.common.eventbus.EventBus;
32
+import net.engio.mbassy.bus.MBassador;
33 33
 
34 34
 import javax.inject.Inject;
35 35
 import javax.inject.Singleton;
@@ -44,12 +44,12 @@ public class ChannelFactory {
44 44
     private final CommandController commandController;
45 45
     private final MessageSinkManager messageSinkManager;
46 46
     private final URLBuilder urlBuilder;
47
-    private final EventBus eventBus;
47
+    private final MBassador eventBus;
48 48
 
49 49
     @Inject
50 50
     public ChannelFactory(final TabCompleterFactory tabCompleterFactory,
51 51
             final CommandController commandController, final MessageSinkManager messageSinkManager,
52
-            final URLBuilder urlBuilder, final EventBus eventBus) {
52
+            final URLBuilder urlBuilder, final MBassador eventBus) {
53 53
         this.tabCompleterFactory = tabCompleterFactory;
54 54
         this.commandController = commandController;
55 55
         this.messageSinkManager = messageSinkManager;

+ 12
- 14
src/com/dmdirc/ClientModule.java Bestand weergeven

@@ -61,18 +61,14 @@ import com.dmdirc.ui.messages.ColourManager;
61 61
 import com.dmdirc.ui.themes.ThemeManager;
62 62
 import com.dmdirc.updater.UpdaterModule;
63 63
 import com.dmdirc.updater.manager.UpdateManager;
64
-import com.dmdirc.util.DynamicAsyncEventBus;
65 64
 import com.dmdirc.util.URLBuilder;
66 65
 import com.dmdirc.util.io.Downloader;
67 66
 
68
-import com.google.common.eventbus.EventBus;
69
-
70 67
 import java.awt.GraphicsEnvironment;
71 68
 import java.io.File;
72 69
 import java.text.SimpleDateFormat;
73 70
 import java.util.Date;
74 71
 import java.util.Set;
75
-import java.util.concurrent.Executors;
76 72
 
77 73
 import javax.inject.Provider;
78 74
 import javax.inject.Qualifier;
@@ -81,6 +77,8 @@ import javax.inject.Singleton;
81 77
 import dagger.Module;
82 78
 import dagger.ObjectGraph;
83 79
 import dagger.Provides;
80
+import net.engio.mbassy.bus.MBassador;
81
+import net.engio.mbassy.bus.config.BusConfiguration;
84 82
 
85 83
 /**
86 84
  * Provides dependencies for the client.
@@ -116,6 +114,12 @@ public class ClientModule {
116 114
     /** The object graph to inject where necessary. */
117 115
     private ObjectGraph objectGraph;
118 116
 
117
+    @Provides
118
+    @Singleton
119
+    public MBassador getMBassador() {
120
+        return new MBassador(BusConfiguration.Default());
121
+    }
122
+
119 123
     @Provides
120 124
     @Singleton
121 125
     public IdentityManager getIdentityManager(
@@ -123,7 +127,7 @@ public class ClientModule {
123 127
             @Directory(DirectoryType.IDENTITIES) final String identitiesDirectory,
124 128
             @Directory(DirectoryType.ERRORS) final String errorsDirectory,
125 129
             final CommandLineParser commandLineParser,
126
-            final EventBus eventBus) {
130
+            final MBassador eventBus) {
127 131
         final IdentityManager identityManager = new IdentityManager(baseDirectory,
128 132
                 identitiesDirectory, eventBus);
129 133
         ErrorManager.getErrorManager()
@@ -182,7 +186,7 @@ public class ClientModule {
182 186
             final ActionFactory actionFactory,
183 187
             final Provider<Set<ActionGroup>> actionWrappersProvider,
184 188
             final Provider<UpdateManager> updateManagerProvider,
185
-            final EventBus eventBus,
189
+            final MBassador eventBus,
186 190
             @Directory(DirectoryType.ACTIONS) final String directory) {
187 191
         final ActionManager actionManager = new ActionManager(identityController,
188 192
                 actionFactory, actionWrappersProvider, updateManagerProvider, eventBus, directory);
@@ -218,7 +222,7 @@ public class ClientModule {
218 222
     @Provides
219 223
     @Singleton
220 224
     public PluginManager getPluginManager(
221
-            final EventBus eventBus,
225
+            final MBassador eventBus,
222 226
             final IdentityController identityController,
223 227
             final UpdateManager updateManager,
224 228
             final Provider<PluginInjectorInitialiser> initialiserProvider,
@@ -251,7 +255,7 @@ public class ClientModule {
251 255
     @Provides
252 256
     @Singleton
253 257
     public ThemeManager getThemeManager(
254
-            final EventBus eventBus,
258
+            final MBassador eventBus,
255 259
             final IdentityController controller,
256 260
             @Directory(DirectoryType.THEMES) final String directory) {
257 261
         final ThemeManager manager = new ThemeManager(eventBus, controller, directory);
@@ -286,12 +290,6 @@ public class ClientModule {
286 290
         return locator;
287 291
     }
288 292
 
289
-    @Provides
290
-    @Singleton
291
-    public EventBus getEventBus() {
292
-        return new DynamicAsyncEventBus(Executors.newSingleThreadExecutor());
293
-    }
294
-
295 293
     @Provides
296 294
     public Downloader getDownloader() {
297 295
         return new Downloader();

+ 2
- 2
src/com/dmdirc/CustomWindow.java Bestand weergeven

@@ -28,7 +28,7 @@ import com.dmdirc.ui.core.components.WindowComponent;
28 28
 import com.dmdirc.util.URLBuilder;
29 29
 
30 30
 import com.google.common.base.Optional;
31
-import com.google.common.eventbus.EventBus;
31
+import net.engio.mbassy.bus.MBassador;
32 32
 
33 33
 import java.util.Arrays;
34 34
 
@@ -69,7 +69,7 @@ public class CustomWindow extends FrameContainer {
69 69
             final String title,
70 70
             final AggregateConfigProvider configProvider,
71 71
             final URLBuilder urlBuilder,
72
-            final EventBus eventBus) {
72
+            final MBassador eventBus) {
73 73
         super(null, "custom", name, title, configProvider, urlBuilder, eventBus,
74 74
                 Arrays.asList(WindowComponent.TEXTAREA.getIdentifier()));
75 75
     }

+ 10
- 9
src/com/dmdirc/FrameContainer.java Bestand weergeven

@@ -47,7 +47,6 @@ import com.dmdirc.util.URLBuilder;
47 47
 import com.dmdirc.util.collections.ListenerList;
48 48
 
49 49
 import com.google.common.base.Optional;
50
-import com.google.common.eventbus.EventBus;
51 50
 
52 51
 import java.util.ArrayList;
53 52
 import java.util.Collection;
@@ -62,6 +61,8 @@ import java.util.concurrent.CopyOnWriteArrayList;
62 61
 import javax.annotation.Nonnull;
63 62
 import javax.annotation.Nullable;
64 63
 
64
+import net.engio.mbassy.bus.MBassador;
65
+
65 66
 import static com.google.common.base.Preconditions.checkState;
66 67
 
67 68
 /**
@@ -101,7 +102,7 @@ public abstract class FrameContainer {
101 102
     /** The manager to use to manage our event bus. */
102 103
     private final ChildEventBusManager eventBusManager;
103 104
     /** Event bus to dispatch events to. */
104
-    private final EventBus eventBus;
105
+    private final MBassador eventBus;
105 106
     /** The icon manager to use for this container. */
106 107
     private final IconManager iconManager;
107 108
     /** Whether or not this container is writable. */
@@ -146,7 +147,7 @@ public abstract class FrameContainer {
146 147
             final String title,
147 148
             final AggregateConfigProvider config,
148 149
             final URLBuilder urlBuilder,
149
-            final EventBus eventBus,
150
+            final MBassador eventBus,
150 151
             final Collection<String> components) {
151 152
         this.parent = Optional.fromNullable(parent);
152 153
         this.configManager = config;
@@ -193,7 +194,7 @@ public abstract class FrameContainer {
193 194
             final CommandParser commandParser,
194 195
             final TabCompleter tabCompleter,
195 196
             final MessageSinkManager messageSinkManager,
196
-            final EventBus eventBus,
197
+            final MBassador eventBus,
197 198
             final Collection<String> components) {
198 199
         this.parent = Optional.fromNullable(parent);
199 200
         this.configManager = config;
@@ -238,7 +239,7 @@ public abstract class FrameContainer {
238 239
         return configManager;
239 240
     }
240 241
 
241
-    public EventBus getEventBus() {
242
+    public MBassador getEventBus() {
242 243
         return eventBus;
243 244
     }
244 245
 
@@ -313,7 +314,7 @@ public abstract class FrameContainer {
313 314
     protected void setName(final String name) {
314 315
         this.name = name;
315 316
 
316
-        eventBus.post(new FrameNameChangedEvent(this, name));
317
+        eventBus.publishAsync(new FrameNameChangedEvent(this, name));
317 318
         listeners.getCallable(FrameInfoListener.class).nameChanged(this, name);
318 319
     }
319 320
 
@@ -326,7 +327,7 @@ public abstract class FrameContainer {
326 327
     public void setTitle(final String title) {
327 328
         this.title = title;
328 329
 
329
-        eventBus.post(new FrameTitleChangedEvent(this, title));
330
+        eventBus.publishAsync(new FrameTitleChangedEvent(this, title));
330 331
         listeners.getCallable(FrameInfoListener.class).titleChanged(this, title);
331 332
     }
332 333
 
@@ -409,7 +410,7 @@ public abstract class FrameContainer {
409 410
      * Called when this container's icon is updated.
410 411
      */
411 412
     private void iconUpdated() {
412
-        eventBus.post(new FrameIconChangedEvent(this, icon));
413
+        eventBus.publish(new FrameIconChangedEvent(this, icon));
413 414
         listeners.getCallable(FrameInfoListener.class).iconChanged(this, icon);
414 415
     }
415 416
 
@@ -535,7 +536,7 @@ public abstract class FrameContainer {
535 536
                 lines.add(new String[]{myLine});
536 537
             }
537 538
 
538
-            eventBus.post(new ClientLineAddedEvent(this, myLine));
539
+            eventBus.publishAsync(new ClientLineAddedEvent(this, myLine));
539 540
         }
540 541
 
541 542
         getDocument().addText(lines);

+ 2
- 2
src/com/dmdirc/GlobalWindow.java Bestand weergeven

@@ -35,7 +35,7 @@ import com.dmdirc.ui.core.components.WindowComponent;
35 35
 import com.dmdirc.ui.input.TabCompleterFactory;
36 36
 import com.dmdirc.util.URLBuilder;
37 37
 
38
-import com.google.common.eventbus.EventBus;
38
+import net.engio.mbassy.bus.MBassador;
39 39
 
40 40
 import java.util.Arrays;
41 41
 
@@ -66,7 +66,7 @@ public class GlobalWindow extends FrameContainer {
66 66
             final TabCompleterFactory tabCompleterFactory,
67 67
             final MessageSinkManager messageSinkManager,
68 68
             final URLBuilder urlBuilder,
69
-            final EventBus eventBus) {
69
+            final MBassador eventBus) {
70 70
         super(null, "icon", "Global", "(Global)", config, urlBuilder, parser,
71 71
                 tabCompleterFactory.getTabCompleter(config, CommandType.TYPE_GLOBAL),
72 72
                 messageSinkManager, eventBus,

+ 7
- 8
src/com/dmdirc/Main.java Bestand weergeven

@@ -45,8 +45,6 @@ import com.dmdirc.plugins.Service;
45 45
 import com.dmdirc.plugins.ServiceProvider;
46 46
 import com.dmdirc.ui.WarningDialog;
47 47
 
48
-import com.google.common.eventbus.EventBus;
49
-
50 48
 import java.awt.GraphicsEnvironment;
51 49
 import java.security.Policy;
52 50
 import java.util.Collection;
@@ -59,6 +57,7 @@ import java.util.TimerTask;
59 57
 import javax.inject.Inject;
60 58
 
61 59
 import dagger.ObjectGraph;
60
+import net.engio.mbassy.bus.MBassador;
62 61
 
63 62
 /**
64 63
  * Main class, handles initialisation.
@@ -92,7 +91,7 @@ public class Main {
92 91
     /** The set of migrators to execute on startup. */
93 92
     private final Set<Migrator> migrators;
94 93
     /** The event bus to dispatch events on. */
95
-    private final EventBus eventBus;
94
+    private final MBassador eventBus;
96 95
     /** The commands to load into the command manager. */
97 96
     private final Set<CommandDetails> commands;
98 97
 
@@ -126,7 +125,7 @@ public class Main {
126 125
             final ColourActionComparison colourActionComparison,
127 126
             final Set<SystemLifecycleComponent> lifecycleComponents,
128 127
             final Set<Migrator> migrators,
129
-            final EventBus eventBus,
128
+            final MBassador eventBus,
130 129
             final Set<CommandDetails> commands) {
131 130
         this.identityManager = identityManager;
132 131
         this.serverManager = serverManager;
@@ -197,7 +196,7 @@ public class Main {
197 196
         actionManager.initialise(colourActionComparison);
198 197
         pluginManager.doAutoLoad();
199 198
         actionManager.loadUserActions();
200
-        eventBus.post(new ClientOpenedEvent());
199
+        eventBus.publishAsync(new ClientOpenedEvent());
201 200
 
202 201
         commandLineParser.processArguments(serverManager);
203 202
 
@@ -211,7 +210,7 @@ public class Main {
211 210
                     component.shutDown();
212 211
                 }
213 212
 
214
-                eventBus.post(new ClientClosedEvent());
213
+                eventBus.publishAsync(new ClientClosedEvent());
215 214
                 serverManager.disconnectAll("Unexpected shutdown");
216 215
                 identityManager.saveAll();
217 216
             }
@@ -289,13 +288,13 @@ public class Main {
289 288
     private void doFirstRun() {
290 289
         if (identityManager.getGlobalConfiguration().getOptionBool("general", "firstRun")) {
291 290
             identityManager.getUserSettings().setOption("general", "firstRun", "false");
292
-            eventBus.post(new FirstRunEvent());
291
+            eventBus.publish(new FirstRunEvent());
293 292
 
294 293
             new Timer().schedule(new TimerTask() {
295 294
 
296 295
                 @Override
297 296
                 public void run() {
298
-                    eventBus.post(new FeedbackNagEvent());
297
+                    eventBus.publishAsync(new FeedbackNagEvent());
299 298
                 }
300 299
             }, FEEDBACK_DELAY);
301 300
         }

+ 5
- 5
src/com/dmdirc/MessageEncoder.java Bestand weergeven

@@ -27,10 +27,10 @@ import com.dmdirc.logger.ErrorLevel;
27 27
 import com.dmdirc.parser.interfaces.Encoder;
28 28
 import com.dmdirc.parser.interfaces.Parser;
29 29
 
30
-import com.google.common.eventbus.EventBus;
31
-
32 30
 import java.io.UnsupportedEncodingException;
33 31
 
32
+import net.engio.mbassy.bus.MBassador;
33
+
34 34
 /**
35 35
  * An {@link Encoder} implementation that reads the desired encoding from the relevant target's
36 36
  * config file.
@@ -42,7 +42,7 @@ public class MessageEncoder implements Encoder {
42 42
     /** The parser that this encoder will work for. */
43 43
     private final Parser parser;
44 44
     /** The event bus to post errors to. */
45
-    private final EventBus eventBus;
45
+    private final MBassador eventBus;
46 46
 
47 47
     /**
48 48
      * Creates a new instance of {@link MessageEncoder}.
@@ -52,7 +52,7 @@ public class MessageEncoder implements Encoder {
52 52
      * @param eventBus The event bus to post errors to.
53 53
      */
54 54
     public MessageEncoder(final Server server, final Parser parser,
55
-            final EventBus eventBus) {
55
+            final MBassador eventBus) {
56 56
         this.server = server;
57 57
         this.parser = parser;
58 58
         this.eventBus = eventBus;
@@ -71,7 +71,7 @@ public class MessageEncoder implements Encoder {
71 71
         try {
72 72
             return new String(message, offset, length, encoding);
73 73
         } catch (UnsupportedEncodingException ex) {
74
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
74
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
75 75
                     "Unsupported character encoding: " + encoding, ""));
76 76
             return new String(message, offset, length);
77 77
         }

+ 3
- 3
src/com/dmdirc/MessageEncoderFactory.java Bestand weergeven

@@ -2,7 +2,7 @@ package com.dmdirc;
2 2
 
3 3
 import com.dmdirc.parser.interfaces.Parser;
4 4
 
5
-import com.google.common.eventbus.EventBus;
5
+import net.engio.mbassy.bus.MBassador;
6 6
 
7 7
 import javax.inject.Inject;
8 8
 import javax.inject.Singleton;
@@ -13,10 +13,10 @@ import javax.inject.Singleton;
13 13
 @Singleton
14 14
 public class MessageEncoderFactory {
15 15
 
16
-    private final EventBus eventBus;
16
+    private final MBassador eventBus;
17 17
 
18 18
     @Inject
19
-    public MessageEncoderFactory(final EventBus eventBus) {
19
+    public MessageEncoderFactory(final MBassador eventBus) {
20 20
         this.eventBus = eventBus;
21 21
     }
22 22
 

+ 2
- 2
src/com/dmdirc/MessageTarget.java Bestand weergeven

@@ -28,7 +28,7 @@ import com.dmdirc.messages.MessageSinkManager;
28 28
 import com.dmdirc.ui.input.TabCompleter;
29 29
 import com.dmdirc.util.URLBuilder;
30 30
 
31
-import com.google.common.eventbus.EventBus;
31
+import net.engio.mbassy.bus.MBassador;
32 32
 
33 33
 import java.util.Collection;
34 34
 
@@ -66,7 +66,7 @@ public abstract class MessageTarget extends FrameContainer {
66 66
             final TabCompleter tabCompleter,
67 67
             final MessageSinkManager messageSinkManager,
68 68
             final URLBuilder urlBuilder,
69
-            final EventBus eventBus,
69
+            final MBassador eventBus,
70 70
             final Collection<String> components) {
71 71
         super(parent, icon, name, title, config, urlBuilder, parser, tabCompleter,
72 72
                 messageSinkManager, eventBus, components);

+ 5
- 5
src/com/dmdirc/ParserFactory.java Bestand weergeven

@@ -32,12 +32,12 @@ import com.dmdirc.plugins.PluginManager;
32 32
 import com.dmdirc.plugins.Service;
33 33
 import com.dmdirc.plugins.ServiceProvider;
34 34
 
35
-import com.google.common.eventbus.EventBus;
36
-
37 35
 import java.net.URI;
38 36
 
39 37
 import javax.inject.Inject;
40 38
 
39
+import net.engio.mbassy.bus.MBassador;
40
+
41 41
 /**
42 42
  * Provides a method to retrieve a parser.
43 43
  *
@@ -48,7 +48,7 @@ public class ParserFactory {
48 48
     /** PluginManager used by this ParserFactory */
49 49
     private final PluginManager pluginManager;
50 50
     /** The event bus to post events to. */
51
-    private final EventBus eventBus;
51
+    private final MBassador eventBus;
52 52
 
53 53
     /**
54 54
      * Creates a new instance of {@link ParserFactory}.
@@ -58,7 +58,7 @@ public class ParserFactory {
58 58
      */
59 59
     @Inject
60 60
     public ParserFactory(final PluginManager pluginManager,
61
-            final EventBus eventBus) {
61
+            final MBassador eventBus) {
62 62
         this.pluginManager = pluginManager;
63 63
         this.eventBus = eventBus;
64 64
     }
@@ -132,7 +132,7 @@ public class ParserFactory {
132 132
                 }
133 133
             }
134 134
         } catch (NoSuchProviderException nspe) {
135
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, nspe,
135
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, nspe,
136 136
                     "No parser found for: " + address.getScheme(), ""));
137 137
         }
138 138
 

+ 7
- 7
src/com/dmdirc/Query.java Bestand weergeven

@@ -137,7 +137,7 @@ public class Query extends MessageTarget implements PrivateActionListener,
137 137
                 final DisplayableEvent event = new QuerySelfMessageEvent(this, server.getParser().
138 138
                         getLocalClient(), part);
139 139
                 event.setDisplayFormat("querySelfMessage");
140
-                getEventBus().post(event);
140
+                getEventBus().publish(event);
141 141
             }
142 142
         }
143 143
     }
@@ -177,7 +177,7 @@ public class Query extends MessageTarget implements PrivateActionListener,
177 177
             doNotification("querySelfAction", client, action);
178 178
             final DisplayableEvent event = new QuerySelfActionEvent(this, client, action);
179 179
             event.setDisplayFormat("querySelfAction");
180
-            getEventBus().post(event);
180
+            getEventBus().publish(event);
181 181
         } else {
182 182
             addLine("actionTooLong", action.length());
183 183
         }
@@ -192,7 +192,7 @@ public class Query extends MessageTarget implements PrivateActionListener,
192 192
 
193 193
         final DisplayableEvent event = new QueryMessageEvent(this, parser.getClient(host), message);
194 194
         event.setDisplayFormat(buff.toString());
195
-        getEventBus().post(event);
195
+        getEventBus().publish(event);
196 196
 
197 197
         addLine(buff, parts[0], parts[1], parts[2], message);
198 198
     }
@@ -206,7 +206,7 @@ public class Query extends MessageTarget implements PrivateActionListener,
206 206
 
207 207
         final DisplayableEvent event = new QueryActionEvent(this, parser.getClient(host), message);
208 208
         event.setDisplayFormat(buff.toString());
209
-        getEventBus().post(event);
209
+        getEventBus().publish(event);
210 210
 
211 211
         addLine(buff, parts[0], parts[1], parts[2], message);
212 212
     }
@@ -260,7 +260,7 @@ public class Query extends MessageTarget implements PrivateActionListener,
260 260
 
261 261
             final DisplayableEvent event = new QueryNickchangeEvent(this, oldNick);
262 262
             event.setDisplayFormat("queryNickChanged");
263
-            getEventBus().post(event);
263
+            getEventBus().publish(event);
264 264
 
265 265
             server.updateQuery(this, oldNick, client.getNickname());
266 266
 
@@ -283,7 +283,7 @@ public class Query extends MessageTarget implements PrivateActionListener,
283 283
 
284 284
             final DisplayableEvent event = new QueryQuitEvent(this, reason);
285 285
             event.setDisplayFormat(format.toString());
286
-            getEventBus().post(event);
286
+            getEventBus().publish(event);
287 287
 
288 288
             addLine(format, client.getNickname(),
289 289
                     client.getUsername(), client.getHostname(), reason);
@@ -316,7 +316,7 @@ public class Query extends MessageTarget implements PrivateActionListener,
316 316
         }
317 317
 
318 318
         // Trigger action for the window closing
319
-        getEventBus().post(new QueryClosedEvent(this));
319
+        getEventBus().publishAsync(new QueryClosedEvent(this));
320 320
 
321 321
         // Inform any parents that the window is closing
322 322
         server.delQuery(this);

+ 10
- 10
src/com/dmdirc/Server.java Bestand weergeven

@@ -67,8 +67,6 @@ import com.dmdirc.ui.input.TabCompletionType;
67 67
 import com.dmdirc.ui.messages.Formatter;
68 68
 import com.dmdirc.util.URLBuilder;
69 69
 
70
-import com.google.common.eventbus.EventBus;
71
-
72 70
 import java.net.URI;
73 71
 import java.net.URISyntaxException;
74 72
 import java.security.cert.CertificateException;
@@ -95,6 +93,8 @@ import javax.net.ssl.TrustManager;
95 93
 
96 94
 import org.slf4j.LoggerFactory;
97 95
 
96
+import net.engio.mbassy.bus.MBassador;
97
+
98 98
 import static com.google.common.base.Preconditions.checkArgument;
99 99
 import static com.google.common.base.Preconditions.checkNotNull;
100 100
 
@@ -223,7 +223,7 @@ public class Server extends FrameContainer implements ConfigChangeListener,
223 223
             final QueryFactory queryFactory,
224 224
             final RawFactory rawFactory,
225 225
             final URLBuilder urlBuilder,
226
-            final EventBus eventBus,
226
+            final MBassador eventBus,
227 227
             final MessageEncoderFactory messageEncoderFactory,
228 228
             final ConfigProvider userSettings,
229 229
             final ScheduledExecutorService executorService,
@@ -379,7 +379,7 @@ public class Server extends FrameContainer implements ConfigChangeListener,
379 379
             }
380 380
         }
381 381
 
382
-        getEventBus().post(new ServerConnectingEvent(this));
382
+        getEventBus().publish(new ServerConnectingEvent(this));
383 383
     }
384 384
 
385 385
     @Override
@@ -535,7 +535,7 @@ public class Server extends FrameContainer implements ConfigChangeListener,
535 535
             final Query newQuery = queryFactory.getQuery(this, host);
536 536
 
537 537
             windowManager.addWindow(this, newQuery, focus);
538
-            getEventBus().post(new QueryOpenedEvent(newQuery));
538
+            getEventBus().publish(new QueryOpenedEvent(newQuery));
539 539
 
540 540
             getTabCompleter().addEntry(TabCompletionType.QUERY_NICK, nick);
541 541
             queries.put(lnick, newQuery);
@@ -619,7 +619,7 @@ public class Server extends FrameContainer implements ConfigChangeListener,
619 619
             final Channel newChan = channelFactory.getChannel(this, chan, channelConfig);
620 620
 
621 621
             windowManager.addWindow(this, newChan, focus);
622
-            getEventBus().post(new ChannelOpenedEvent(newChan));
622
+            getEventBus().publish(new ChannelOpenedEvent(newChan));
623 623
 
624 624
             getTabCompleter().addEntry(TabCompletionType.CHANNEL, chan.getName());
625 625
             channels.add(newChan);
@@ -1198,7 +1198,7 @@ public class Server extends FrameContainer implements ConfigChangeListener,
1198 1198
 
1199 1199
         handleNotification("socketClosed", getAddress());
1200 1200
 
1201
-        getEventBus().post(new ServerDisconnectedEvent(this));
1201
+        getEventBus().publish(new ServerDisconnectedEvent(this));
1202 1202
 
1203 1203
         eventHandler.unregisterCallbacks();
1204 1204
 
@@ -1303,7 +1303,7 @@ public class Server extends FrameContainer implements ConfigChangeListener,
1303 1303
                 }
1304 1304
             }
1305 1305
 
1306
-            getEventBus().post(new ServerConnectErrorEvent(this, description));
1306
+            getEventBus().publish(new ServerConnectErrorEvent(this, description));
1307 1307
 
1308 1308
             handleNotification("connectError", getAddress(), description);
1309 1309
 
@@ -1323,7 +1323,7 @@ public class Server extends FrameContainer implements ConfigChangeListener,
1323 1323
                 + ((int) (Math.floor(parser.getPingTime() / 1000.0)))
1324 1324
                 + " seconds.", getConfigManager()));
1325 1325
 
1326
-        getEventBus().post(new ServerNopingEvent(this, parser.getPingTime()));
1326
+        getEventBus().publishAsync(new ServerNopingEvent(this, parser.getPingTime()));
1327 1327
 
1328 1328
         if (parser.getPingTime()
1329 1329
                 >= getConfigManager().getOptionInt(DOMAIN_SERVER, "pingtimeout")) {
@@ -1370,7 +1370,7 @@ public class Server extends FrameContainer implements ConfigChangeListener,
1370 1370
                     channels.getWhoRunnable(), whoTime, whoTime, TimeUnit.MILLISECONDS);
1371 1371
         }
1372 1372
 
1373
-        getEventBus().post(new ServerConnectedEvent(this));
1373
+        getEventBus().publish(new ServerConnectedEvent(this));
1374 1374
     }
1375 1375
 
1376 1376
     /**

+ 8
- 8
src/com/dmdirc/ServerEventHandler.java Bestand weergeven

@@ -92,12 +92,12 @@ import com.dmdirc.parser.interfaces.callbacks.WallDesyncListener;
92 92
 import com.dmdirc.parser.interfaces.callbacks.WallopListener;
93 93
 import com.dmdirc.parser.interfaces.callbacks.WalluserListener;
94 94
 
95
-import com.google.common.eventbus.EventBus;
96
-
97 95
 import java.util.Date;
98 96
 
99 97
 import javax.annotation.Nonnull;
100 98
 
99
+import net.engio.mbassy.bus.MBassador;
100
+
101 101
 
102 102
 /**
103 103
  * Handles parser events for a Server object.
@@ -118,7 +118,7 @@ public class ServerEventHandler extends EventHandler implements
118 118
     /** The server instance that owns this event handler. */
119 119
     private final Server owner;
120 120
     /** Event bus to post events to. */
121
-    private final EventBus eventBus;
121
+    private final MBassador eventBus;
122 122
 
123 123
     /**
124 124
      * Creates a new instance of ServerEventHandler.
@@ -126,7 +126,7 @@ public class ServerEventHandler extends EventHandler implements
126 126
      * @param owner    The Server instance that we're handling events for
127 127
      * @param eventBus The event bus to post events to
128 128
      */
129
-    public ServerEventHandler(final Server owner, final EventBus eventBus) {
129
+    public ServerEventHandler(final Server owner, final MBassador eventBus) {
130 130
         this.owner = owner;
131 131
         this.eventBus = eventBus;
132 132
     }
@@ -192,9 +192,9 @@ public class ServerEventHandler extends EventHandler implements
192 192
                 : new Exception(errorString.toString()); // NOPMD
193 193
 
194 194
         if (errorInfo.isUserError()) {
195
-            eventBus.post(new UserErrorEvent(errorLevel, ex, errorInfo.getData(), ""));
195
+            eventBus.publishAsync(new UserErrorEvent(errorLevel, ex, errorInfo.getData(), ""));
196 196
         } else {
197
-            eventBus.post(new AppErrorEvent(errorLevel, ex, errorInfo.getData(), ""));
197
+            eventBus.publishAsync(new AppErrorEvent(errorLevel, ex, errorInfo.getData(), ""));
198 198
         }
199 199
     }
200 200
 
@@ -297,14 +297,14 @@ public class ServerEventHandler extends EventHandler implements
297 297
     public void onPingSent(final Parser parser, final Date date) {
298 298
         checkParser(parser);
299 299
 
300
-        eventBus.post(new ServerPingsentEvent(owner));
300
+        eventBus.publishAsync(new ServerPingsentEvent(owner));
301 301
     }
302 302
 
303 303
     @Override
304 304
     public void onPingSuccess(final Parser parser, final Date date) {
305 305
         checkParser(parser);
306 306
 
307
-        eventBus.post(new ServerGotpingEvent(owner, owner.getParser().getServerLatency()));
307
+        eventBus.publishAsync(new ServerGotpingEvent(owner, owner.getParser().getServerLatency()));
308 308
     }
309 309
 
310 310
     @Override

+ 3
- 3
src/com/dmdirc/ServerFactoryImpl.java Bestand weergeven

@@ -32,7 +32,7 @@ import com.dmdirc.ui.core.components.StatusBarManager;
32 32
 import com.dmdirc.ui.input.TabCompleterFactory;
33 33
 import com.dmdirc.util.URLBuilder;
34 34
 
35
-import com.google.common.eventbus.EventBus;
35
+import net.engio.mbassy.bus.MBassador;
36 36
 
37 37
 import java.net.URI;
38 38
 import java.util.concurrent.ScheduledExecutorService;
@@ -58,7 +58,7 @@ public class ServerFactoryImpl {
58 58
     private final Provider<QueryFactory> queryFactory;
59 59
     private final Provider<RawFactory> rawFactory;
60 60
     private final URLBuilder urlBuilder;
61
-    private final EventBus eventBus;
61
+    private final MBassador eventBus;
62 62
     private final MessageEncoderFactory messageEncoderFactory;
63 63
     private final ConfigProvider userSettings;
64 64
 
@@ -75,7 +75,7 @@ public class ServerFactoryImpl {
75 75
             final Provider<QueryFactory> queryFactory,
76 76
             final Provider<RawFactory> rawFactory,
77 77
             final URLBuilder urlBuilder,
78
-            final EventBus eventBus,
78
+            final MBassador eventBus,
79 79
             final MessageEncoderFactory messageEncoderFactory,
80 80
             @ClientModule.UserConfig final ConfigProvider userSettings) {
81 81
         this.manager = manager;

+ 5
- 4
src/com/dmdirc/ServerManager.java Bestand weergeven

@@ -34,7 +34,6 @@ import com.dmdirc.logger.ErrorLevel;
34 34
 import com.dmdirc.parser.common.ChannelJoinRequest;
35 35
 import com.dmdirc.ui.WindowManager;
36 36
 
37
-import com.google.common.eventbus.EventBus;
38 37
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
39 38
 
40 39
 import java.net.URI;
@@ -50,6 +49,8 @@ import javax.inject.Inject;
50 49
 import javax.inject.Provider;
51 50
 import javax.inject.Singleton;
52 51
 
52
+import net.engio.mbassy.bus.MBassador;
53
+
53 54
 import static com.google.common.base.Preconditions.checkArgument;
54 55
 
55 56
 /**
@@ -72,7 +73,7 @@ public class ServerManager implements ServerFactory {
72 73
     /** Concrete server factory to use. */
73 74
     private final ServerFactoryImpl serverFactoryImpl;
74 75
     /** Event bus for servers. */
75
-    private final EventBus eventBus;
76
+    private final MBassador eventBus;
76 77
 
77 78
     /**
78 79
      * Creates a new instance of ServerManager.
@@ -91,7 +92,7 @@ public class ServerManager implements ServerFactory {
91 92
             final Provider<CommandController> commandController,
92 93
             final WindowManager windowManager,
93 94
             final ServerFactoryImpl serverFactory,
94
-            final EventBus eventBus) {
95
+            final MBassador eventBus) {
95 96
         this.identityController = identityController;
96 97
         this.identityFactory = identityFactory;
97 98
         this.commandController = commandController;
@@ -277,7 +278,7 @@ public class ServerManager implements ServerFactory {
277 278
             try {
278 279
                 connectToAddress(new URI("irc://irc.quakenet.org/DMDirc"));
279 280
             } catch (URISyntaxException ex) {
280
-                eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
281
+                eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
281 282
                         "Unable to construct new server", ""));
282 283
             }
283 284
         } else {

+ 8
- 8
src/com/dmdirc/actions/Action.java Bestand weergeven

@@ -40,8 +40,6 @@ import com.dmdirc.updater.Version;
40 40
 import com.dmdirc.util.io.ConfigFile;
41 41
 import com.dmdirc.util.io.InvalidConfigFileException;
42 42
 
43
-import com.google.common.eventbus.EventBus;
44
-
45 43
 import java.io.IOException;
46 44
 import java.nio.file.FileSystem;
47 45
 import java.nio.file.Files;
@@ -53,6 +51,8 @@ import java.util.Map;
53 51
 
54 52
 import javax.inject.Provider;
55 53
 
54
+import net.engio.mbassy.bus.MBassador;
55
+
56 56
 /**
57 57
  * Describes a single action.
58 58
  */
@@ -79,7 +79,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
79 79
     /** The controller to use to retrieve components, comparisons, etc. */
80 80
     private final ActionController actionController;
81 81
     /** Event bus to post events to. */
82
-    private final EventBus eventBus;
82
+    private final MBassador eventBus;
83 83
     /** The file system to read/write actions to. */
84 84
     private final FileSystem filesystem;
85 85
     /** The config file we're using. */
@@ -101,7 +101,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
101 101
      * @param group                       The group the action belongs to
102 102
      * @param name                        The name of the action
103 103
      */
104
-    public Action(final FileSystem filesystem, final EventBus eventBus,
104
+    public Action(final FileSystem filesystem, final MBassador eventBus,
105 105
             final Provider<GlobalWindow> globalWindowProvider,
106 106
             final ActionSubstitutorFactory substitutorFactory,
107 107
             final ActionController actionController, final IdentityController identityController,
@@ -149,7 +149,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
149 149
      * @param conditionTree               The condition tree to use
150 150
      * @param newFormat                   The new formatter to use
151 151
      */
152
-    public Action(final FileSystem filesystem, final EventBus eventBus,
152
+    public Action(final FileSystem filesystem, final MBassador eventBus,
153 153
             final Provider<GlobalWindow> globalWindowProvider,
154 154
             final ActionSubstitutorFactory substitutorFactory,
155 155
             final ActionController actionController, final IdentityController identityController,
@@ -182,7 +182,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
182 182
 
183 183
         actionController.addAction(this);
184 184
         //TODO This needs to be done somewhere else, remove eventbus when it is.
185
-        eventBus.post(new ActionCreatedEvent(this));
185
+        eventBus.publishAsync(new ActionCreatedEvent(this));
186 186
     }
187 187
 
188 188
     /**
@@ -415,7 +415,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
415 415
                     + group + "/" + name + ": " + ex.getMessage());
416 416
         }
417 417
 
418
-        eventBus.post(new ActionUpdatedEvent(this));
418
+        eventBus.publishAsync(new ActionUpdatedEvent(this));
419 419
     }
420 420
 
421 421
     /**
@@ -587,7 +587,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
587 587
      * Deletes this action.
588 588
      */
589 589
     public void delete() {
590
-        eventBus.post(new ActionDeletedEvent(actionController.getOrCreateGroup(getGroup()), this));
590
+        eventBus.publishAsync(new ActionDeletedEvent(actionController.getOrCreateGroup(getGroup()), this));
591 591
         try {
592 592
             Files.delete(filesystem.getPath(location));
593 593
         } catch (IOException ex) {

+ 3
- 3
src/com/dmdirc/actions/ActionFactory.java Bestand weergeven

@@ -29,7 +29,7 @@ import com.dmdirc.interfaces.ActionController;
29 29
 import com.dmdirc.interfaces.actions.ActionType;
30 30
 import com.dmdirc.interfaces.config.IdentityController;
31 31
 
32
-import com.google.common.eventbus.EventBus;
32
+import net.engio.mbassy.bus.MBassador;
33 33
 
34 34
 import java.nio.file.FileSystem;
35 35
 import java.nio.file.FileSystems;
@@ -56,7 +56,7 @@ public class ActionFactory {
56 56
     /** The base directory to store actions in. */
57 57
     private final String actionsDirectory;
58 58
     /** Event bus to post events on. */
59
-    private final EventBus eventBus;
59
+    private final MBassador eventBus;
60 60
     /** The file system to read/write actions to. */
61 61
     private final FileSystem filesystem;
62 62
 
@@ -71,7 +71,7 @@ public class ActionFactory {
71 71
      * @param actionsDirectory            The base directory to store actions in.
72 72
      */
73 73
     @Inject
74
-    public ActionFactory(final EventBus eventBus, final Provider<ActionController> actionController,
74
+    public ActionFactory(final MBassador eventBus, final Provider<ActionController> actionController,
75 75
             final Provider<IdentityController> identityController,
76 76
             final Provider<GlobalWindow> globalWindowProvider,
77 77
             final ActionSubstitutorFactory substitutorFactory,

+ 14
- 14
src/com/dmdirc/actions/ActionManager.java Bestand weergeven

@@ -42,9 +42,6 @@ import com.dmdirc.updater.manager.UpdateManager;
42 42
 import com.dmdirc.util.collections.MapList;
43 43
 import com.dmdirc.util.resourcemanager.ZipResourceManager;
44 44
 
45
-import com.google.common.eventbus.EventBus;
46
-import com.google.common.eventbus.Subscribe;
47
-
48 45
 import java.io.File;
49 46
 import java.io.IOException;
50 47
 import java.lang.reflect.Method;
@@ -59,6 +56,9 @@ import javax.inject.Provider;
59 56
 
60 57
 import org.slf4j.LoggerFactory;
61 58
 
59
+import net.engio.mbassy.bus.MBassador;
60
+import net.engio.mbassy.listener.Handler;
61
+
62 62
 import static com.google.common.base.Preconditions.checkArgument;
63 63
 import static com.google.common.base.Preconditions.checkNotNull;
64 64
 
@@ -95,7 +95,7 @@ public class ActionManager implements ActionController {
95 95
     /** The listeners that we have registered. */
96 96
     private final MapList<ActionType, ActionListener> listeners = new MapList<>();
97 97
     /** The global event bus to monitor. */
98
-    private final EventBus eventBus;
98
+    private final MBassador eventBus;
99 99
     /** The directory to load and save actions in. */
100 100
     private final String directory;
101 101
     /** Indicates whether or not user actions should be killed (not processed). */
@@ -117,7 +117,7 @@ public class ActionManager implements ActionController {
117 117
             final ActionFactory factory,
118 118
             final Provider<Set<ActionGroup>> actionWrappersProvider,
119 119
             final Provider<UpdateManager> updateManagerProvider,
120
-            final EventBus eventBus,
120
+            final MBassador eventBus,
121 121
             final String directory) {
122 122
         this.identityManager = identityManager;
123 123
         this.factory = factory;
@@ -170,7 +170,7 @@ public class ActionManager implements ActionController {
170 170
 
171 171
         new WhoisNumericFormatter(identityManager.getAddonSettings(), eventBus).register();
172 172
 
173
-        eventBus.register(this);
173
+        eventBus.subscribe(this);
174 174
     }
175 175
 
176 176
     @Override
@@ -187,7 +187,7 @@ public class ActionManager implements ActionController {
187 187
      *
188 188
      * @param event The event that was raised.
189 189
      */
190
-    @Subscribe
190
+    @Handler
191 191
     public void handleClientClosed(final ClientClosedEvent event) {
192 192
         LOG.debug("Client closed - saving all actions");
193 193
         saveAllActions();
@@ -262,13 +262,13 @@ public class ActionManager implements ActionController {
262 262
                 dir.mkdirs();
263 263
                 dir.createNewFile();
264 264
             } catch (IOException ex) {
265
-                eventBus.post(new UserErrorEvent(ErrorLevel.HIGH, null,
265
+                eventBus.publishAsync(new UserErrorEvent(ErrorLevel.HIGH, null,
266 266
                         "I/O error when creating actions directory: " + ex.getMessage(), ""));
267 267
             }
268 268
         }
269 269
 
270 270
         if (dir.listFiles() == null) {
271
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
271
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, null,
272 272
                     "Unable to load user action files", ""));
273 273
         } else {
274 274
             for (File file : dir.listFiles()) {
@@ -371,7 +371,7 @@ public class ActionManager implements ActionController {
371 371
                 try {
372 372
                     listener.processEvent(type, format, arguments);
373 373
                 } catch (Exception e) {
374
-                    eventBus.post(new AppErrorEvent(ErrorLevel.MEDIUM, e,
374
+                    eventBus.publishAsync(new AppErrorEvent(ErrorLevel.MEDIUM, e,
375 375
                             "Error processing action: " + e.getMessage(), ""));
376 376
                 }
377 377
             }
@@ -420,7 +420,7 @@ public class ActionManager implements ActionController {
420 420
                         }
421 421
                     }
422 422
                 } catch (LinkageError | Exception e) {
423
-                    eventBus.post(new AppErrorEvent(ErrorLevel.MEDIUM, e,
423
+                    eventBus.publishAsync(new AppErrorEvent(ErrorLevel.MEDIUM, e,
424 424
                             "Error processing action: " + e.getMessage(), ""));
425 425
                 }
426 426
             }
@@ -434,7 +434,7 @@ public class ActionManager implements ActionController {
434 434
      *
435 435
      * @param event The event that was raised.
436 436
      */
437
-    @Subscribe
437
+    @Handler
438 438
     public void processEvent(final DMDircEvent event) {
439 439
         final ActionType type = getType(getLegacyActionTypeName(event));
440 440
         if (type == null) {
@@ -549,7 +549,7 @@ public class ActionManager implements ActionController {
549 549
         if (dir.isDirectory()) {
550 550
             for (File file : dir.listFiles()) {
551 551
                 if (!file.delete()) {
552
-                    eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
552
+                    eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, null,
553 553
                             "Unable to remove file: " + file.getAbsolutePath(), ""));
554 554
                     return;
555 555
                 }
@@ -557,7 +557,7 @@ public class ActionManager implements ActionController {
557 557
         }
558 558
 
559 559
         if (!dir.delete()) {
560
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
560
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, null,
561 561
                     "Unable to remove directory: " + dir.getAbsolutePath(), ""));
562 562
             return;
563 563
         }

+ 8
- 8
src/com/dmdirc/actions/internal/WhoisNumericFormatter.java Bestand weergeven

@@ -27,12 +27,12 @@ import com.dmdirc.events.ServerNumericEvent;
27 27
 import com.dmdirc.interfaces.Connection;
28 28
 import com.dmdirc.interfaces.config.ConfigProvider;
29 29
 
30
-import com.google.common.eventbus.EventBus;
31
-import com.google.common.eventbus.Subscribe;
32
-
33 30
 import java.util.HashMap;
34 31
 import java.util.Map;
35 32
 
33
+import net.engio.mbassy.bus.MBassador;
34
+import net.engio.mbassy.listener.Handler;
35
+
36 36
 /**
37 37
  * Listens for whois-like numeric events and automatically formats them.
38 38
  *
@@ -45,7 +45,7 @@ public class WhoisNumericFormatter {
45 45
     /** The identity to add formatters to. */
46 46
     private final ConfigProvider identity;
47 47
     /** Event bus to subscribe to events on. */
48
-    private final EventBus eventBus;
48
+    private final MBassador eventBus;
49 49
 
50 50
     /**
51 51
      * Creates a new whois numeric formatter that will add automatic formats to the specified
@@ -55,7 +55,7 @@ public class WhoisNumericFormatter {
55 55
      * @param eventBus The event bus to subscribe to events on
56 56
      */
57 57
     public WhoisNumericFormatter(final ConfigProvider identity,
58
-            final EventBus eventBus) {
58
+            final MBassador eventBus) {
59 59
         this.identity = identity;
60 60
         this.eventBus = eventBus;
61 61
     }
@@ -64,7 +64,7 @@ public class WhoisNumericFormatter {
64 64
      * Registers this this whois numeric formatter with the global actions manager.
65 65
      */
66 66
     public void register() {
67
-        eventBus.register(this);
67
+        eventBus.subscribe(this);
68 68
     }
69 69
 
70 70
     /**
@@ -73,7 +73,7 @@ public class WhoisNumericFormatter {
73 73
      *
74 74
      * @param event The server disconnected event to process
75 75
      */
76
-    @Subscribe
76
+    @Handler
77 77
     public void handleServerDisconnected(final ServerDisconnectedEvent event) {
78 78
         targets.remove(event.getConnection());
79 79
     }
@@ -86,7 +86,7 @@ public class WhoisNumericFormatter {
86 86
      *
87 87
      * @param event The server numeric event to process
88 88
      */
89
-    @Subscribe
89
+    @Handler
90 90
     public void handleNumeric(final ServerNumericEvent event) {
91 91
         final Connection server = event.getConnection();
92 92
         final int numeric = event.getNumeric();

+ 7
- 7
src/com/dmdirc/actions/wrappers/PerformWrapper.java Bestand weergeven

@@ -38,14 +38,14 @@ import com.dmdirc.interfaces.actions.ActionComponent;
38 38
 import com.dmdirc.interfaces.actions.ActionType;
39 39
 import com.dmdirc.logger.ErrorLevel;
40 40
 
41
-import com.google.common.eventbus.EventBus;
42
-
43 41
 import java.util.ArrayList;
44 42
 import java.util.List;
45 43
 
46 44
 import javax.inject.Inject;
47 45
 import javax.inject.Singleton;
48 46
 
47
+import net.engio.mbassy.bus.MBassador;
48
+
49 49
 /**
50 50
  * An action wrapper for performs.
51 51
  */
@@ -57,7 +57,7 @@ public class PerformWrapper extends ActionGroup {
57 57
     /** Factory to use for actions. */
58 58
     private final ActionFactory actionFactory;
59 59
     /** The event bus to post events to. */
60
-    private final EventBus eventBus;
60
+    private final MBassador eventBus;
61 61
 
62 62
     /**
63 63
      * Creates a new instance of PerformWrapper.
@@ -67,7 +67,7 @@ public class PerformWrapper extends ActionGroup {
67 67
      */
68 68
     @Inject
69 69
     public PerformWrapper(final ActionFactory actionFactory,
70
-            final EventBus eventBus) {
70
+            final MBassador eventBus) {
71 71
         super("performs");
72 72
 
73 73
         this.actionFactory = actionFactory;
@@ -77,15 +77,15 @@ public class PerformWrapper extends ActionGroup {
77 77
     @Override
78 78
     public void add(final Action action) {
79 79
         if (action.getTriggers().length != 1) {
80
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
80
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, null,
81 81
                     "Invalid perform action: " + action.getName(),
82 82
                     "Perform actions may only have one trigger"));
83 83
         } else if (action.getTriggers()[0] != CoreActionType.SERVER_CONNECTED) {
84
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
84
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, null,
85 85
                     "Invalid perform action: " + action.getName(),
86 86
                     "Perform actions must be triggered when a server connects"));
87 87
         } else if (!checkConditions(action.getConditions())) {
88
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
88
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, null,
89 89
                     "Invalid perform action: " + action.getName(),
90 90
                     "Perform actions must have exactly one or two conditions, "
91 91
                     + "one may target the server's name or network, and one may "

+ 5
- 5
src/com/dmdirc/commandparser/PopupManager.java Bestand weergeven

@@ -26,10 +26,10 @@ import com.dmdirc.events.ClientPopupGeneratedEvent;
26 26
 import com.dmdirc.interfaces.CommandController;
27 27
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
28 28
 
29
-import com.google.common.eventbus.EventBus;
30
-
31 29
 import javax.inject.Inject;
32 30
 
31
+import net.engio.mbassy.bus.MBassador;
32
+
33 33
 /**
34 34
  * The popup manager manages which commands should be present in popup menus.
35 35
  */
@@ -38,7 +38,7 @@ public class PopupManager {
38 38
     /** The command controller to use for items. */
39 39
     private final CommandController commandController;
40 40
     /** The bus to dispatch events on. */
41
-    private final EventBus eventBus;
41
+    private final MBassador eventBus;
42 42
 
43 43
     /**
44 44
      * Creates a new instance of PopupManager.
@@ -47,7 +47,7 @@ public class PopupManager {
47 47
      * @param eventBus          The bus to dispatch events on.
48 48
      */
49 49
     @Inject
50
-    public PopupManager(final CommandController commandController, final EventBus eventBus) {
50
+    public PopupManager(final CommandController commandController, final MBassador eventBus) {
51 51
         this.commandController = commandController;
52 52
         this.eventBus = eventBus;
53 53
     }
@@ -64,7 +64,7 @@ public class PopupManager {
64 64
     public PopupMenu getMenu(final PopupType menuType, final AggregateConfigProvider configManager) {
65 65
         final PopupMenu menu = getMenu(menuType.toString(), menuType, configManager);
66 66
 
67
-        eventBus.post(new ClientPopupGeneratedEvent(menuType, menu, configManager));
67
+        eventBus.publishAsync(new ClientPopupGeneratedEvent(menuType, menu, configManager));
68 68
 
69 69
         return menu;
70 70
     }

+ 3
- 3
src/com/dmdirc/commandparser/auto/AutoCommandHandler.java Bestand weergeven

@@ -30,7 +30,7 @@ import com.dmdirc.events.ClientOpenedEvent;
30 30
 import com.dmdirc.events.ServerConnectedEvent;
31 31
 import com.dmdirc.interfaces.CommandController;
32 32
 
33
-import com.google.common.eventbus.Subscribe;
33
+import net.engio.mbassy.listener.Handler;
34 34
 
35 35
 /**
36 36
  * Handles execution of {@link AutoCommand}s.
@@ -58,7 +58,7 @@ public class AutoCommandHandler {
58 58
      *
59 59
      * @param event The event triggering the command.
60 60
      */
61
-    @Subscribe
61
+    @Handler
62 62
     public void checkAutoCommand(final ClientOpenedEvent event) {
63 63
         if (!autoCommand.getServer().isPresent() && !autoCommand.getNetwork().isPresent()) {
64 64
             execute(globalWindow, globalCommandParser);
@@ -70,7 +70,7 @@ public class AutoCommandHandler {
70 70
      *
71 71
      * @param event The event triggering the command.
72 72
      */
73
-    @Subscribe
73
+    @Handler
74 74
     public void checkAutoCommand(final ServerConnectedEvent event) {
75 75
         if (!autoCommand.getServer().isPresent() && !autoCommand.getNetwork().isPresent()) {
76 76
             // This is a global auto command, shouldn't be executed for servers.

+ 8
- 8
src/com/dmdirc/commandparser/auto/AutoCommandManager.java Bestand weergeven

@@ -22,8 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.auto;
24 24
 
25
-import com.google.common.eventbus.EventBus;
26
-
27 25
 import java.util.Collections;
28 26
 import java.util.Map;
29 27
 import java.util.Set;
@@ -32,6 +30,8 @@ import java.util.concurrent.ConcurrentSkipListMap;
32 30
 import javax.inject.Inject;
33 31
 import javax.inject.Singleton;
34 32
 
33
+import net.engio.mbassy.bus.MBassador;
34
+
35 35
 import static com.google.common.base.Preconditions.checkNotNull;
36 36
 
37 37
 /**
@@ -41,7 +41,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
41 41
 public class AutoCommandManager {
42 42
 
43 43
     /** The bus to listen for events on. */
44
-    private final EventBus eventBus;
44
+    private final MBassador eventBus;
45 45
     /** The factory to use to create handlers. */
46 46
     private final AutoCommandHandlerFactory factory;
47 47
     /** Known auto commands, mapped on to their handlers. */
@@ -56,7 +56,7 @@ public class AutoCommandManager {
56 56
      * @param factory  The factory to use to create handlers.
57 57
      */
58 58
     @Inject
59
-    public AutoCommandManager(final EventBus eventBus, final AutoCommandHandlerFactory factory) {
59
+    public AutoCommandManager(final MBassador eventBus, final AutoCommandHandlerFactory factory) {
60 60
         this.eventBus = eventBus;
61 61
         this.factory = factory;
62 62
     }
@@ -67,7 +67,7 @@ public class AutoCommandManager {
67 67
     public void start() {
68 68
         started = true;
69 69
         for (AutoCommandHandler handler : autoCommands.values()) {
70
-            eventBus.register(handler);
70
+            eventBus.subscribe(handler);
71 71
         }
72 72
     }
73 73
 
@@ -77,7 +77,7 @@ public class AutoCommandManager {
77 77
     public void stop() {
78 78
         started = false;
79 79
         for (AutoCommandHandler handler : autoCommands.values()) {
80
-            eventBus.unregister(handler);
80
+            eventBus.subscribe(handler);
81 81
         }
82 82
     }
83 83
 
@@ -91,7 +91,7 @@ public class AutoCommandManager {
91 91
         final AutoCommandHandler handler = factory.getAutoCommandHandler(autoCommand);
92 92
 
93 93
         if (started) {
94
-            eventBus.register(handler);
94
+            eventBus.subscribe(handler);
95 95
         }
96 96
 
97 97
         autoCommands.put(autoCommand, handler);
@@ -107,7 +107,7 @@ public class AutoCommandManager {
107 107
         final AutoCommandHandler handler = autoCommands.remove(autoCommand);
108 108
 
109 109
         if (started) {
110
-            eventBus.unregister(handler);
110
+            eventBus.subscribe(handler);
111 111
         }
112 112
     }
113 113
 

+ 3
- 3
src/com/dmdirc/commandparser/commands/global/OpenWindow.java Bestand weergeven

@@ -39,7 +39,7 @@ import com.dmdirc.ui.WindowManager;
39 39
 import com.dmdirc.ui.input.AdditionalTabTargets;
40 40
 import com.dmdirc.util.URLBuilder;
41 41
 
42
-import com.google.common.eventbus.EventBus;
42
+import net.engio.mbassy.bus.MBassador;
43 43
 
44 44
 import javax.inject.Inject;
45 45
 
@@ -58,7 +58,7 @@ public class OpenWindow extends Command implements IntelligentCommand {
58 58
     /** The URL builder to use when finding icons. */
59 59
     private final URLBuilder urlBuilder;
60 60
     /** The bus to dispatch events on. */
61
-    private final EventBus eventBus;
61
+    private final MBassador eventBus;
62 62
     /** The config provider to retrieve settings from. */
63 63
     private final AggregateConfigProvider configProvider;
64 64
 
@@ -76,7 +76,7 @@ public class OpenWindow extends Command implements IntelligentCommand {
76 76
             final CommandController controller,
77 77
             final WindowManager windowManager,
78 78
             final URLBuilder urlBuilder,
79
-            final EventBus eventBus,
79
+            final MBassador eventBus,
80 80
             @GlobalConfig final AggregateConfigProvider configProvider) {
81 81
         super(controller);
82 82
 

+ 6
- 5
src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java Bestand weergeven

@@ -41,14 +41,15 @@ import com.dmdirc.ui.messages.Styliser;
41 41
 import com.dmdirc.util.collections.MapList;
42 42
 
43 43
 import com.google.common.base.Optional;
44
-import com.google.common.eventbus.EventBus;
45
-import com.google.common.eventbus.Subscribe;
46 44
 
47 45
 import java.util.ArrayList;
48 46
 import java.util.List;
49 47
 
50 48
 import javax.inject.Inject;
51 49
 
50
+import net.engio.mbassy.bus.MBassador;
51
+import net.engio.mbassy.listener.Handler;
52
+
52 53
 /**
53 54
  * Allows the user to join channels.
54 55
  *
@@ -72,9 +73,9 @@ public class JoinChannelCommand extends Command implements IntelligentCommand {
72 73
     @Inject
73 74
     public JoinChannelCommand(
74 75
             final CommandController controller,
75
-            final EventBus eventBus) {
76
+            final MBassador eventBus) {
76 77
         super(controller);
77
-        eventBus.register(this);
78
+        eventBus.subscribe(this);
78 79
     }
79 80
 
80 81
     @Override
@@ -102,7 +103,7 @@ public class JoinChannelCommand extends Command implements IntelligentCommand {
102 103
         server.join(!args.isSilent(), channels.toArray(new ChannelJoinRequest[channels.size()]));
103 104
     }
104 105
 
105
-    @Subscribe
106
+    @Handler
106 107
     public void handleClientLineAdded(final ClientLineAddedEvent event) {
107 108
         final String[] parts = event.getFrameContainer().getStyliser()
108 109
                 .doLinks(event.getLine())

+ 2
- 2
src/com/dmdirc/commandparser/parsers/ChannelCommandParser.java Bestand weergeven

@@ -33,7 +33,7 @@ import com.dmdirc.commandparser.commands.context.ChannelCommandContext;
33 33
 import com.dmdirc.commandparser.commands.context.CommandContext;
34 34
 import com.dmdirc.interfaces.CommandController;
35 35
 
36
-import com.google.common.eventbus.EventBus;
36
+import net.engio.mbassy.bus.MBassador;
37 37
 
38 38
 import javax.annotation.Nonnull;
39 39
 
@@ -57,7 +57,7 @@ public class ChannelCommandParser extends ChatCommandParser {
57 57
      * @param eventBus          Event bus to post events on
58 58
      */
59 59
     public ChannelCommandParser(final Server server, final CommandController commandController,
60
-            final EventBus eventBus) {
60
+            final MBassador eventBus) {
61 61
         super(server, commandController, eventBus);
62 62
     }
63 63
 

+ 2
- 2
src/com/dmdirc/commandparser/parsers/ChatCommandParser.java Bestand weergeven

@@ -33,7 +33,7 @@ import com.dmdirc.commandparser.commands.context.ChatCommandContext;
33 33
 import com.dmdirc.commandparser.commands.context.CommandContext;
34 34
 import com.dmdirc.interfaces.CommandController;
35 35
 
36
-import com.google.common.eventbus.EventBus;
36
+import net.engio.mbassy.bus.MBassador;
37 37
 
38 38
 import javax.annotation.Nonnull;
39 39
 
@@ -57,7 +57,7 @@ public class ChatCommandParser extends ServerCommandParser {
57 57
      * @param eventBus          Event but to post events on
58 58
      */
59 59
     public ChatCommandParser(final Server server, final CommandController commandController,
60
-            final EventBus eventBus) {
60
+            final MBassador eventBus) {
61 61
         super(server.getConfigManager(), commandController, eventBus);
62 62
         super.setOwner(server);
63 63
     }

+ 5
- 5
src/com/dmdirc/commandparser/parsers/CommandParser.java Bestand weergeven

@@ -41,14 +41,14 @@ import com.dmdirc.interfaces.Connection;
41 41
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
42 42
 import com.dmdirc.util.collections.RollingList;
43 43
 
44
-import com.google.common.eventbus.EventBus;
45
-
46 44
 import java.io.Serializable;
47 45
 import java.util.HashMap;
48 46
 import java.util.Map;
49 47
 
50 48
 import javax.annotation.Nonnull;
51 49
 
50
+import net.engio.mbassy.bus.MBassador;
51
+
52 52
 import static com.google.common.base.Preconditions.checkNotNull;
53 53
 
54 54
 /**
@@ -67,7 +67,7 @@ public abstract class CommandParser implements Serializable {
67 67
     /** Command manager to use. */
68 68
     protected final CommandController commandManager;
69 69
     /** Event bus to post events to. */
70
-    private final EventBus eventBus;
70
+    private final MBassador eventBus;
71 71
 
72 72
     /**
73 73
      * Creates a new instance of CommandParser.
@@ -78,7 +78,7 @@ public abstract class CommandParser implements Serializable {
78 78
      */
79 79
     protected CommandParser(final AggregateConfigProvider configManager,
80 80
             final CommandController commandManager,
81
-            final EventBus eventBus) {
81
+            final MBassador eventBus) {
82 82
         this.eventBus = eventBus;
83 83
         commands = new HashMap<>();
84 84
         history = new RollingList<>(configManager.getOptionInt("general", "commandhistory"));
@@ -337,7 +337,7 @@ public abstract class CommandParser implements Serializable {
337 337
     protected void handleInvalidCommand(final FrameContainer origin,
338 338
             final CommandArguments args) {
339 339
         if (origin == null) {
340
-            eventBus.post(new UnknownCommandEvent(null, args.getCommandName(), args.getArguments()));
340
+            eventBus.publish(new UnknownCommandEvent(null, args.getCommandName(), args.getArguments()));
341 341
         } else {
342 342
             final DisplayableEvent event = new UnknownCommandEvent(origin, args.getCommandName(),
343 343
                     args.getArguments());

+ 2
- 2
src/com/dmdirc/commandparser/parsers/GlobalCommandParser.java Bestand weergeven

@@ -34,7 +34,7 @@ import com.dmdirc.interfaces.config.AggregateConfigProvider;
34 34
 import com.dmdirc.logger.ErrorLevel;
35 35
 import com.dmdirc.logger.Logger;
36 36
 
37
-import com.google.common.eventbus.EventBus;
37
+import net.engio.mbassy.bus.MBassador;
38 38
 
39 39
 import javax.annotation.Nonnull;
40 40
 import javax.inject.Inject;
@@ -60,7 +60,7 @@ public class GlobalCommandParser extends CommandParser {
60 60
     public GlobalCommandParser(
61 61
             @ClientModule.GlobalConfig final AggregateConfigProvider configManager,
62 62
             final CommandController commandManager,
63
-            final EventBus eventBus) {
63
+            final MBassador eventBus) {
64 64
         super(configManager, commandManager, eventBus);
65 65
     }
66 66
 

+ 2
- 2
src/com/dmdirc/commandparser/parsers/QueryCommandParser.java Bestand weergeven

@@ -33,7 +33,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
33 33
 import com.dmdirc.commandparser.commands.context.QueryCommandContext;
34 34
 import com.dmdirc.interfaces.CommandController;
35 35
 
36
-import com.google.common.eventbus.EventBus;
36
+import net.engio.mbassy.bus.MBassador;
37 37
 
38 38
 import javax.annotation.Nonnull;
39 39
 
@@ -58,7 +58,7 @@ public class QueryCommandParser extends ChatCommandParser {
58 58
      * @param eventBus          Event bus to post events on
59 59
      */
60 60
     public QueryCommandParser(final Server server, final CommandController commandController,
61
-            final EventBus eventBus) {
61
+            final MBassador eventBus) {
62 62
         super(server, commandController, eventBus);
63 63
     }
64 64
 

+ 2
- 2
src/com/dmdirc/commandparser/parsers/ServerCommandParser.java Bestand weergeven

@@ -34,7 +34,7 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
34 34
 import com.dmdirc.interfaces.CommandController;
35 35
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
36 36
 
37
-import com.google.common.eventbus.EventBus;
37
+import net.engio.mbassy.bus.MBassador;
38 38
 
39 39
 import javax.annotation.Nonnull;
40 40
 
@@ -56,7 +56,7 @@ public class ServerCommandParser extends GlobalCommandParser {
56 56
     public ServerCommandParser(
57 57
             final AggregateConfigProvider configManager,
58 58
             final CommandController commandController,
59
-            final EventBus eventBus) {
59
+            final MBassador eventBus) {
60 60
         super(configManager, commandController, eventBus);
61 61
     }
62 62
     /**

+ 18
- 18
src/com/dmdirc/config/IdentityManager.java Bestand weergeven

@@ -38,7 +38,7 @@ import com.dmdirc.util.io.ConfigFile;
38 38
 import com.dmdirc.util.io.InvalidConfigFileException;
39 39
 import com.dmdirc.util.resourcemanager.ResourceManager;
40 40
 
41
-import com.google.common.eventbus.EventBus;
41
+import net.engio.mbassy.bus.MBassador;
42 42
 
43 43
 import java.io.File;
44 44
 import java.io.IOException;
@@ -76,7 +76,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
76 76
      */
77 77
     private final MapList<String, ConfigProvider> identities = new MapList<>();
78 78
     /** The event bus to post events to. */
79
-    private final EventBus eventBus;
79
+    private final MBassador eventBus;
80 80
     /**
81 81
      * The {@link IdentityListener}s that have registered with this manager.
82 82
      *
@@ -101,7 +101,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
101 101
      * @param eventBus            The event bus to post events to
102 102
      */
103 103
     public IdentityManager(final String baseDirectory, final String identitiesDirectory,
104
-            final EventBus eventBus) {
104
+            final MBassador eventBus) {
105 105
         this.configDirectory = baseDirectory;
106 106
         this.identitiesDirectory = identitiesDirectory;
107 107
         this.eventBus = eventBus;
@@ -138,7 +138,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
138 138
         addConfigProvider(addonConfig);
139 139
 
140 140
         if (!getGlobalConfiguration().hasOptionString("identity", "defaultsversion")) {
141
-            eventBus.post(new UserErrorEvent(ErrorLevel.FATAL, null,
141
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.FATAL, null,
142 142
                     "Default settings could not be loaded", ""));
143 143
         }
144 144
     }
@@ -158,7 +158,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
158 158
                 }
159 159
 
160 160
                 if (!success) {
161
-                    eventBus.post(new UserErrorEvent(ErrorLevel.HIGH, null,
161
+                    eventBus.publishAsync(new UserErrorEvent(ErrorLevel.HIGH, null,
162 162
                             "Unable to create directory for default settings folder ("
163 163
                             + target + ")",
164 164
                             "A file with that name already exists, and couldn't be renamed."
@@ -168,7 +168,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
168 168
             }
169 169
 
170 170
             if (!file.exists() && !file.mkdirs()) {
171
-                eventBus.post(new UserErrorEvent(ErrorLevel.FATAL, null,
171
+                eventBus.publishAsync(new UserErrorEvent(ErrorLevel.FATAL, null,
172 172
                         "Unable to create required directory '" + file.getAbsolutePath()
173 173
                         + "'. Please check file permissions or specify "
174 174
                         + "a different configuration directory.", ""));
@@ -209,7 +209,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
209 209
                     "com/dmdirc/config/defaults/default/formatter",
210 210
                     identitiesDirectory + "default/", false);
211 211
         } catch (IOException ex) {
212
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
212
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, null,
213 213
                     "Unable to extract default formatters: " + ex.getMessage(), ""));
214 214
         }
215 215
     }
@@ -225,7 +225,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
225 225
                     "com/dmdirc/config/defaults/" + target,
226 226
                     identitiesDirectory + target, false);
227 227
         } catch (IOException ex) {
228
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
228
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, null,
229 229
                     "Unable to extract default identities: " + ex.getMessage(), ""));
230 230
         }
231 231
     }
@@ -239,7 +239,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
239 239
                 dir.mkdirs();
240 240
                 dir.createNewFile();
241 241
             } catch (IOException ex) {
242
-                eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
242
+                eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
243 243
                         "Unable to create identity dir", ""));
244 244
             }
245 245
         }
@@ -261,7 +261,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
261 261
         checkArgument(dir.isDirectory());
262 262
 
263 263
         if (dir.listFiles() == null) {
264
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
264
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, null,
265 265
                     "Unable to load user identity files from " + dir.getAbsolutePath(), ""));
266 266
         } else {
267 267
             for (File file : dir.listFiles()) {
@@ -290,7 +290,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
290 290
                     try {
291 291
                         identity.reload();
292 292
                     } catch (IOException ex) {
293
-                        eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
293
+                        eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, null,
294 294
                                 "I/O error when reloading identity file: "
295 295
                                 + file.getAbsolutePath() + " (" + ex.getMessage() + ")", ""));
296 296
                     } catch (InvalidConfigFileException ex) {
@@ -305,11 +305,11 @@ public class IdentityManager implements IdentityFactory, IdentityController {
305 305
         try {
306 306
             addConfigProvider(new ConfigFileBackedConfigProvider(this, file, false));
307 307
         } catch (InvalidIdentityFileException ex) {
308
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
308
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, null,
309 309
                     "Invalid identity file: " + file.getAbsolutePath() + " ("
310 310
                     + ex.getMessage() + ")", ""));
311 311
         } catch (IOException ex) {
312
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
312
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, null,
313 313
                     "I/O error when reading identity file: " + file.getAbsolutePath(), ""));
314 314
         }
315 315
     }
@@ -353,7 +353,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
353 353
                     getResourceAsStream("/com/dmdirc/version.config"), false);
354 354
             addConfigProvider(versionConfig);
355 355
         } catch (IOException | InvalidIdentityFileException ex) {
356
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
356
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
357 357
                     "Unable to load version information", ""));
358 358
         }
359 359
     }
@@ -375,7 +375,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
375 375
             config.setOption("identity", "name", "Global config");
376 376
             addConfigProvider(config);
377 377
         } catch (IOException ex) {
378
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
378
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
379 379
                     "I/O error when loading global config: " + ex.getMessage(), ""));
380 380
         }
381 381
     }
@@ -597,7 +597,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
597 597
         try {
598 598
             return createIdentity(settings);
599 599
         } catch (InvalidIdentityFileException | IOException ex) {
600
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
600
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
601 601
                     "Unable to create identity", ""));
602 602
             return null;
603 603
         }
@@ -618,7 +618,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
618 618
         try {
619 619
             return createIdentity(settings);
620 620
         } catch (InvalidIdentityFileException | IOException ex) {
621
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
621
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
622 622
                     "Unable to create identity", ""));
623 623
             return null;
624 624
         }
@@ -634,7 +634,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
634 634
         try {
635 635
             return createIdentity(settings);
636 636
         } catch (InvalidIdentityFileException | IOException ex) {
637
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
637
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
638 638
                     "Unable to create identity", ""));
639 639
             return null;
640 640
         }

+ 6
- 6
src/com/dmdirc/config/prefs/PreferencesDialogModel.java Bestand weergeven

@@ -32,8 +32,6 @@ import com.dmdirc.util.collections.ListenerList;
32 32
 import com.dmdirc.util.validators.NumericalValidator;
33 33
 import com.dmdirc.util.validators.OptionalValidator;
34 34
 
35
-import com.google.common.eventbus.EventBus;
36
-
37 35
 import java.util.ArrayList;
38 36
 import java.util.Collections;
39 37
 import java.util.HashMap;
@@ -42,6 +40,8 @@ import java.util.Map;
42 40
 
43 41
 import javax.inject.Inject;
44 42
 
43
+import net.engio.mbassy.bus.MBassador;
44
+
45 45
 /**
46 46
  * Manages categories that should appear in the preferences dialog.
47 47
  */
@@ -66,7 +66,7 @@ public class PreferencesDialogModel {
66 66
     /** Plugin manager. */
67 67
     private final PluginManager pluginManager;
68 68
     /** Event bus to post events on. */
69
-    private final EventBus eventBus;
69
+    private final MBassador eventBus;
70 70
 
71 71
     /**
72 72
      * Creates a new instance of PreferencesDialogModel.
@@ -88,7 +88,7 @@ public class PreferencesDialogModel {
88 88
             final AggregateConfigProvider configManager,
89 89
             final ConfigProvider identity,
90 90
             final PluginManager pluginManager,
91
-            final EventBus eventBus) {
91
+            final MBassador eventBus) {
92 92
         this.pluginPanel = pluginPanel;
93 93
         this.themePanel = themePanel;
94 94
         this.updatesPanel = updatesPanel;
@@ -100,7 +100,7 @@ public class PreferencesDialogModel {
100 100
 
101 101
         addDefaultCategories();
102 102
 
103
-        eventBus.post(new ClientPrefsOpenedEvent(this));
103
+        eventBus.publishAsync(new ClientPrefsOpenedEvent(this));
104 104
     }
105 105
 
106 106
     public AggregateConfigProvider getConfigManager() {
@@ -631,7 +631,7 @@ public class PreferencesDialogModel {
631 631
      * @since 0.6
632 632
      */
633 633
     public void close() {
634
-        eventBus.post(new ClientPrefsClosedEvent());
634
+        eventBus.publishAsync(new ClientPrefsClosedEvent());
635 635
     }
636 636
 
637 637
 }

+ 6
- 6
src/com/dmdirc/config/prefs/PreferencesManager.java Bestand weergeven

@@ -29,10 +29,10 @@ import com.dmdirc.interfaces.config.ConfigProvider;
29 29
 import com.dmdirc.util.validators.NumericalValidator;
30 30
 import com.dmdirc.util.validators.OptionalValidator;
31 31
 
32
-import com.google.common.eventbus.EventBus;
33
-
34 32
 import javax.inject.Inject;
35 33
 
34
+import net.engio.mbassy.bus.MBassador;
35
+
36 36
 /**
37 37
  * Manages preferences for the client.
38 38
  *
@@ -41,10 +41,10 @@ import javax.inject.Inject;
41 41
 public class PreferencesManager {
42 42
 
43 43
     /** Event bus to public events on. */
44
-    private final EventBus eventBus;
44
+    private final MBassador eventBus;
45 45
 
46 46
     @Inject
47
-    public PreferencesManager(final EventBus eventBus) {
47
+    public PreferencesManager(final MBassador eventBus) {
48 48
         this.eventBus = eventBus;
49 49
     }
50 50
 
@@ -127,7 +127,7 @@ public class PreferencesManager {
127 127
                 "Reconnect message", "Default quit message to use when reconnecting",
128 128
                 manager, identity));
129 129
 
130
-        eventBus.post(new ConnectionPrefsRequestedEvent(category));
130
+        eventBus.publish(new ConnectionPrefsRequestedEvent(category));
131 131
 
132 132
         return category;
133 133
     }
@@ -240,7 +240,7 @@ public class PreferencesManager {
240 240
                 "Number of items of input history to keep",
241 241
                 manager, identity));
242 242
 
243
-        eventBus.post(new GroupChatPrefsRequestedEvent(category));
243
+        eventBus.publish(new GroupChatPrefsRequestedEvent(category));
244 244
 
245 245
         return category;
246 246
     }

+ 0
- 2
src/com/dmdirc/events/ActionCreatedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.actions.Action;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Fired on the creation of an action.
30 29
  */
31
-@AsyncEvent
32 30
 public class ActionCreatedEvent extends ActionEvent {
33 31
 
34 32
     public ActionCreatedEvent(final Action action) {

+ 0
- 2
src/com/dmdirc/events/ActionDeletedEvent.java Bestand weergeven

@@ -24,12 +24,10 @@ package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.actions.Action;
26 26
 import com.dmdirc.actions.ActionGroup;
27
-import com.dmdirc.util.AsyncEvent;
28 27
 
29 28
 /**
30 29
  * Fired when an action is deleted.
31 30
  */
32
-@AsyncEvent
33 31
 public class ActionDeletedEvent extends ActionEvent {
34 32
 
35 33
     private final ActionGroup group;

+ 0
- 2
src/com/dmdirc/events/ActionUpdatedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.actions.Action;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Fired when an action is updated.
30 29
  */
31
-@AsyncEvent
32 30
 public class ActionUpdatedEvent extends ActionEvent {
33 31
 
34 32
     public ActionUpdatedEvent(final Action action) {

+ 0
- 2
src/com/dmdirc/events/AppErrorEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.logger.ErrorLevel;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Event class for app errors.
30 29
  */
31
-@AsyncEvent
32 30
 public class AppErrorEvent extends ErrorEvent {
33 31
 
34 32
     public AppErrorEvent(final ErrorLevel level, final Throwable throwable, final String message,

+ 0
- 2
src/com/dmdirc/events/ChannelGotnamesEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.Channel;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Fired when a channel names event is received.
30 29
  */
31
-@AsyncEvent
32 30
 public class ChannelGotnamesEvent extends ChannelEvent {
33 31
 
34 32
     public ChannelGotnamesEvent(final long timestamp, final Channel channel) {

+ 0
- 3
src/com/dmdirc/events/ClientClosedEvent.java Bestand weergeven

@@ -22,12 +22,9 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
-import com.dmdirc.util.AsyncEvent;
26
-
27 25
 /**
28 26
  * Fired when the client is being closed.
29 27
  */
30
-@AsyncEvent
31 28
 public class ClientClosedEvent extends DMDircEvent {
32 29
 
33 30
 }

+ 0
- 3
src/com/dmdirc/events/ClientClosingEvent.java Bestand weergeven

@@ -22,12 +22,9 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
-import com.dmdirc.util.AsyncEvent;
26
-
27 25
 /**
28 26
  * Fired when the client is about to close.
29 27
  */
30
-@AsyncEvent
31 28
 public class ClientClosingEvent extends DMDircEvent {
32 29
 
33 30
 }

+ 0
- 3
src/com/dmdirc/events/ClientFocusGainedEvent.java Bestand weergeven

@@ -22,14 +22,11 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
-import com.dmdirc.util.AsyncEvent;
26
-
27 25
 /**
28 26
  * Fired when the the client is bought into focus.
29 27
  *
30 28
  * TODO: This should be moved into the Swing UI once the corresponding action types are removed.
31 29
  */
32
-@AsyncEvent
33 30
 public class ClientFocusGainedEvent extends DMDircEvent {
34 31
 
35 32
 }

+ 0
- 3
src/com/dmdirc/events/ClientFocusLostEvent.java Bestand weergeven

@@ -22,14 +22,11 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
-import com.dmdirc.util.AsyncEvent;
26
-
27 25
 /**
28 26
  * Fired when the the client loses focus.
29 27
  *
30 28
  * TODO: This should be moved into the Swing UI once the corresponding action types are removed.
31 29
  */
32
-@AsyncEvent
33 30
 public class ClientFocusLostEvent extends DMDircEvent {
34 31
 
35 32
 }

+ 0
- 2
src/com/dmdirc/events/ClientFrameChangedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Event fired when a new frame has been focused.
30 29
  */
31
-@AsyncEvent
32 30
 public class ClientFrameChangedEvent extends DMDircEvent {
33 31
 
34 32
     private final FrameContainer container;

+ 0
- 3
src/com/dmdirc/events/ClientKeyPressedEvent.java Bestand weergeven

@@ -22,8 +22,6 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
-import com.dmdirc.util.AsyncEvent;
26
-
27 25
 import javax.swing.KeyStroke;
28 26
 
29 27
 /**
@@ -31,7 +29,6 @@ import javax.swing.KeyStroke;
31 29
  *
32 30
  * TODO: This should be moved into the Swing UI once the corresponding action types are removed.
33 31
  */
34
-@AsyncEvent
35 32
 public class ClientKeyPressedEvent extends DMDircEvent {
36 33
 
37 34
     private final KeyStroke keyStroke;

+ 0
- 2
src/com/dmdirc/events/ClientLineAddedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Event fired when a line has been added to a window.
30 29
  */
31
-@AsyncEvent
32 30
 public class ClientLineAddedEvent extends DMDircEvent {
33 31
 
34 32
     private final FrameContainer container;

+ 0
- 3
src/com/dmdirc/events/ClientMinimisedEvent.java Bestand weergeven

@@ -22,14 +22,11 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
-import com.dmdirc.util.AsyncEvent;
26
-
27 25
 /**
28 26
  * Fired when the the client is minimised.
29 27
  *
30 28
  * TODO: This should be moved into the Swing UI once the corresponding action types are removed.
31 29
  */
32
-@AsyncEvent
33 30
 public class ClientMinimisedEvent extends DMDircEvent {
34 31
 
35 32
 }

+ 0
- 3
src/com/dmdirc/events/ClientOpenedEvent.java Bestand weergeven

@@ -22,11 +22,8 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
-import com.dmdirc.util.AsyncEvent;
26
-
27 25
 /**
28 26
  * Fired when the client is first opened.
29 27
  */
30
-@AsyncEvent
31 28
 public class ClientOpenedEvent extends DMDircEvent {
32 29
 }

+ 0
- 2
src/com/dmdirc/events/ClientPopupGeneratedEvent.java Bestand weergeven

@@ -25,12 +25,10 @@ package com.dmdirc.events;
25 25
 import com.dmdirc.commandparser.PopupMenu;
26 26
 import com.dmdirc.commandparser.PopupType;
27 27
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
28
-import com.dmdirc.util.AsyncEvent;
29 28
 
30 29
 /**
31 30
  * Raised when a popup is being generated.
32 31
  */
33
-@AsyncEvent
34 32
 public class ClientPopupGeneratedEvent extends DMDircEvent {
35 33
 
36 34
     private final PopupType type;

+ 0
- 3
src/com/dmdirc/events/ClientPrefsClosedEvent.java Bestand weergeven

@@ -22,12 +22,9 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
-import com.dmdirc.util.AsyncEvent;
26
-
27 25
 /**
28 26
  * Raised when the preferences dialog is closed.
29 27
  */
30
-@AsyncEvent
31 28
 public class ClientPrefsClosedEvent extends PreferencesEvent {
32 29
 
33 30
 }

+ 0
- 2
src/com/dmdirc/events/ClientPrefsOpenedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.config.prefs.PreferencesDialogModel;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Raised when the preferences dialog is opened.
30 29
  */
31
-@AsyncEvent
32 30
 public class ClientPrefsOpenedEvent extends PreferencesEvent {
33 31
 
34 32
     private final PreferencesDialogModel model;

+ 0
- 3
src/com/dmdirc/events/ClientUnminimisedEvent.java Bestand weergeven

@@ -22,14 +22,11 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
-import com.dmdirc.util.AsyncEvent;
26
-
27 25
 /**
28 26
  * Fired when the the client is unminimised.
29 27
  *
30 28
  * TODO: This should be moved into the Swing UI once the corresponding action types are removed.
31 29
  */
32
-@AsyncEvent
33 30
 public class ClientUnminimisedEvent extends DMDircEvent {
34 31
 
35 32
 }

+ 0
- 2
src/com/dmdirc/events/ClientUserInputEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Event fired when some input has been entered into the client.
30 29
  */
31
-@AsyncEvent
32 30
 public class ClientUserInputEvent extends DMDircEvent {
33 31
 
34 32
     private final FrameContainer container;

+ 3
- 3
src/com/dmdirc/events/EventUtils.java Bestand weergeven

@@ -22,7 +22,7 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
-import com.google.common.eventbus.EventBus;
25
+import net.engio.mbassy.bus.MBassador;
26 26
 
27 27
 /**
28 28
  * Utilities for interacting with events.
@@ -42,11 +42,11 @@ public final class EventUtils {
42 42
      * @return The event's display format after it has been posted on the event bus.
43 43
      */
44 44
     public static String postDisplayable(
45
-            final EventBus eventBus,
45
+            final MBassador eventBus,
46 46
             final DisplayableEvent event,
47 47
             final String displayFormat) {
48 48
         event.setDisplayFormat(displayFormat);
49
-        eventBus.post(event);
49
+        eventBus.publish(event);
50 50
         return event.getDisplayFormat();
51 51
     }
52 52
 

+ 0
- 3
src/com/dmdirc/events/FeedbackNagEvent.java Bestand weergeven

@@ -22,12 +22,9 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
-import com.dmdirc.util.AsyncEvent;
26
-
27 25
 /**
28 26
  * Fired when its time to nag for feedback.
29 27
  */
30
-@AsyncEvent
31 28
 public class FeedbackNagEvent extends DMDircEvent {
32 29
 
33 30
 }

+ 0
- 2
src/com/dmdirc/events/FrameChangedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Base class for all frame info events.
30 29
  */
31
-@AsyncEvent
32 30
 public class FrameChangedEvent extends DMDircEvent {
33 31
 
34 32
     private final FrameContainer container;

+ 0
- 2
src/com/dmdirc/events/FrameIconChangedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Fired when a frame icon changes.
30 29
  */
31
-@AsyncEvent
32 30
 public class FrameIconChangedEvent extends FrameChangedEvent {
33 31
 
34 32
     private final String icon;

+ 0
- 2
src/com/dmdirc/events/FrameNameChangedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Fired when a frame's name changes.
30 29
  */
31
-@AsyncEvent
32 30
 public class FrameNameChangedEvent extends FrameChangedEvent {
33 31
 
34 32
     private final String name;

+ 0
- 2
src/com/dmdirc/events/FrameTitleChangedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Fired when a frame title changes.
30 29
  */
31
-@AsyncEvent
32 30
 public class FrameTitleChangedEvent extends FrameChangedEvent {
33 31
 
34 32
     private final String title;

+ 0
- 2
src/com/dmdirc/events/LinkChannelClickedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.interfaces.ui.Window;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Raised when a channel link has been clicked.
30 29
  */
31
-@AsyncEvent
32 30
 public class LinkChannelClickedEvent extends LinkEvent {
33 31
 
34 32
     public LinkChannelClickedEvent(final Window window, final String target) {

+ 0
- 2
src/com/dmdirc/events/LinkNicknameClickedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.interfaces.ui.Window;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Raised when a nickname link has been clicked.
30 29
  */
31
-@AsyncEvent
32 30
 public class LinkNicknameClickedEvent extends LinkEvent {
33 31
 
34 32
     public LinkNicknameClickedEvent(final Window window, final String target) {

+ 0
- 2
src/com/dmdirc/events/LinkUrlClickedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.interfaces.ui.Window;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Raised when a URL link has been clicked.
30 29
  */
31
-@AsyncEvent
32 30
 public class LinkUrlClickedEvent extends LinkEvent {
33 31
 
34 32
     public LinkUrlClickedEvent(final Window window, final String target) {

+ 0
- 2
src/com/dmdirc/events/PluginLoadedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.plugins.PluginInfo;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Fired when a plugin is loaded.
30 29
  */
31
-@AsyncEvent
32 30
 public class PluginLoadedEvent extends PluginEvent {
33 31
 
34 32
     public PluginLoadedEvent(final PluginInfo plugin) {

+ 0
- 3
src/com/dmdirc/events/PluginRefreshEvent.java Bestand weergeven

@@ -22,12 +22,9 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
-import com.dmdirc.util.AsyncEvent;
26
-
27 25
 /**
28 26
  * Fired when the list of available plugins may have updated.
29 27
  */
30
-@AsyncEvent
31 28
 public class PluginRefreshEvent extends DMDircEvent {
32 29
 
33 30
 }

+ 0
- 2
src/com/dmdirc/events/PluginUnloadedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.plugins.PluginInfo;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Fired when a plugin is loaded.
30 29
  */
31
-@AsyncEvent
32 30
 public class PluginUnloadedEvent extends PluginEvent {
33 31
 
34 32
     public PluginUnloadedEvent(final PluginInfo plugin) {

+ 0
- 2
src/com/dmdirc/events/QueryClosedEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.Query;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Fired when a query window is closed.
30 29
  */
31
-@AsyncEvent
32 30
 public class QueryClosedEvent extends QueryEvent {
33 31
 
34 32
     public QueryClosedEvent(final long timestamp, final Query query) {

+ 0
- 2
src/com/dmdirc/events/ServerGotpingEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.interfaces.Connection;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Fired when we receive a server ping reply.
30 29
  */
31
-@AsyncEvent
32 30
 public class ServerGotpingEvent extends ServerEvent {
33 31
 
34 32
     private final long ping;

+ 0
- 2
src/com/dmdirc/events/ServerNopingEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.interfaces.Connection;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Fired when we miss a server ping reply.
30 29
  */
31
-@AsyncEvent
32 30
 public class ServerNopingEvent extends ServerEvent {
33 31
 
34 32
     private final long ping;

+ 0
- 2
src/com/dmdirc/events/ServerPingsentEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.interfaces.Connection;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Fired when sending a server ping request.
30 29
  */
31
-@AsyncEvent
32 30
 public class ServerPingsentEvent extends ServerEvent {
33 31
 
34 32
     public ServerPingsentEvent(final long timestamp, final Connection connection) {

+ 0
- 2
src/com/dmdirc/events/UserErrorEvent.java Bestand weergeven

@@ -23,12 +23,10 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.logger.ErrorLevel;
26
-import com.dmdirc.util.AsyncEvent;
27 26
 
28 27
 /**
29 28
  * Event class for user errors.
30 29
  */
31
-@AsyncEvent
32 30
 public class UserErrorEvent extends ErrorEvent {
33 31
 
34 32
     public UserErrorEvent(final ErrorLevel level, final Throwable throwable, final String message,

+ 2
- 2
src/com/dmdirc/interfaces/GroupChat.java Bestand weergeven

@@ -25,7 +25,7 @@ package com.dmdirc.interfaces;
25 25
 import com.dmdirc.Topic;
26 26
 
27 27
 import com.google.common.base.Optional;
28
-import com.google.common.eventbus.EventBus;
28
+import net.engio.mbassy.bus.MBassador;
29 29
 
30 30
 import java.util.List;
31 31
 
@@ -60,7 +60,7 @@ public interface GroupChat extends Chat {
60 60
      *
61 61
      * @return An event bus scoped to this channel.
62 62
      */
63
-    EventBus getEventBus();
63
+    MBassador getEventBus();
64 64
 
65 65
     /**
66 66
      * Retrieves the maximum length that a topic on this channel can be.

+ 6
- 7
src/com/dmdirc/logger/ErrorManager.java Bestand weergeven

@@ -29,9 +29,6 @@ import com.dmdirc.interfaces.config.ConfigChangeListener;
29 29
 import com.dmdirc.ui.FatalErrorDialog;
30 30
 import com.dmdirc.util.collections.ListenerList;
31 31
 
32
-import com.google.common.eventbus.EventBus;
33
-import com.google.common.eventbus.Subscribe;
34
-
35 32
 import java.awt.GraphicsEnvironment;
36 33
 import java.util.Date;
37 34
 import java.util.LinkedList;
@@ -40,6 +37,8 @@ import java.util.concurrent.BlockingQueue;
40 37
 import java.util.concurrent.LinkedBlockingQueue;
41 38
 import java.util.concurrent.atomic.AtomicLong;
42 39
 
40
+import net.engio.mbassy.bus.MBassador;
41
+import net.engio.mbassy.listener.Handler;
43 42
 import net.kencochrane.raven.DefaultRavenFactory;
44 43
 import net.kencochrane.raven.RavenFactory;
45 44
 
@@ -89,8 +88,8 @@ public class ErrorManager implements ConfigChangeListener {
89 88
      * @param eventBus     The event bus to listen for error events on.
90 89
      */
91 90
     public void initialise(final AggregateConfigProvider globalConfig, final String directory,
92
-            final EventBus eventBus) {
93
-        eventBus.register(this);
91
+            final MBassador eventBus) {
92
+        eventBus.subscribe(this);
94 93
         RavenFactory.registerFactory(new DefaultRavenFactory());
95 94
 
96 95
         config = globalConfig;
@@ -134,13 +133,13 @@ public class ErrorManager implements ConfigChangeListener {
134 133
         me = errorManager;
135 134
     }
136 135
 
137
-    @Subscribe
136
+    @Handler
138 137
     public void handleAppErrorEvent(final AppErrorEvent appError) {
139 138
         addError(appError.getLevel(), appError.getMessage(), appError.getThrowable(),
140 139
                 appError.getDetails(), true, isValidError(appError.getThrowable()));
141 140
     }
142 141
 
143
-    @Subscribe
142
+    @Handler
144 143
     public void handleUserErrorEvent(final UserErrorEvent userError) {
145 144
         addError(userError.getLevel(), userError.getMessage(), userError.getThrowable(),
146 145
                 userError.getDetails(), false, isValidError(userError.getThrowable()));

+ 5
- 5
src/com/dmdirc/plugins/CorePluginExtractor.java Bestand weergeven

@@ -28,8 +28,6 @@ import com.dmdirc.events.UserErrorEvent;
28 28
 import com.dmdirc.logger.ErrorLevel;
29 29
 import com.dmdirc.util.resourcemanager.ResourceManager;
30 30
 
31
-import com.google.common.eventbus.EventBus;
32
-
33 31
 import java.io.File;
34 32
 import java.io.IOException;
35 33
 import java.util.Map;
@@ -37,6 +35,8 @@ import java.util.Map;
37 35
 import javax.inject.Inject;
38 36
 import javax.inject.Singleton;
39 37
 
38
+import net.engio.mbassy.bus.MBassador;
39
+
40 40
 /**
41 41
  * Utility class that can extract bundled plugins.
42 42
  */
@@ -48,7 +48,7 @@ public class CorePluginExtractor {
48 48
     /** The directory to extract plugins to. */
49 49
     private final String pluginDir;
50 50
     /** The event bus to post events to. */
51
-    private final EventBus eventBus;
51
+    private final MBassador eventBus;
52 52
 
53 53
     /**
54 54
      * Creates a new instance of {@link CorePluginExtractor}.
@@ -61,7 +61,7 @@ public class CorePluginExtractor {
61 61
     public CorePluginExtractor(
62 62
             final PluginManager pluginManager,
63 63
             @Directory(DirectoryType.PLUGINS) final String pluginDir,
64
-            final EventBus eventBus) {
64
+            final MBassador eventBus) {
65 65
         this.pluginManager = pluginManager;
66 66
         this.pluginDir = pluginDir;
67 67
         this.eventBus = eventBus;
@@ -107,7 +107,7 @@ public class CorePluginExtractor {
107 107
                     }
108 108
                 }
109 109
             } catch (IOException ex) {
110
-                eventBus.post(new UserErrorEvent(ErrorLevel.LOW, ex,
110
+                eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, ex,
111 111
                         "Failed to extract plugins", ""));
112 112
             }
113 113
         }

+ 5
- 5
src/com/dmdirc/plugins/LegacyServiceLocator.java Bestand weergeven

@@ -25,8 +25,6 @@ package com.dmdirc.plugins;
25 25
 import com.dmdirc.events.UserErrorEvent;
26 26
 import com.dmdirc.logger.ErrorLevel;
27 27
 
28
-import com.google.common.eventbus.EventBus;
29
-
30 28
 import java.lang.reflect.Method;
31 29
 import java.util.Collection;
32 30
 import java.util.HashSet;
@@ -35,6 +33,8 @@ import javax.annotation.Nullable;
35 33
 import javax.inject.Inject;
36 34
 import javax.inject.Singleton;
37 35
 
36
+import net.engio.mbassy.bus.MBassador;
37
+
38 38
 import static com.google.common.base.Preconditions.checkNotNull;
39 39
 
40 40
 /**
@@ -46,10 +46,10 @@ public class LegacyServiceLocator implements ServiceLocator {
46 46
     /** The plugin manager to use to find services. */
47 47
     private final PluginManager pluginManager;
48 48
     /** The event bus to post errors . */
49
-    private final EventBus eventBus;
49
+    private final MBassador eventBus;
50 50
 
51 51
     @Inject
52
-    public LegacyServiceLocator(final PluginManager pluginManager, final EventBus eventBus) {
52
+    public LegacyServiceLocator(final PluginManager pluginManager, final MBassador eventBus) {
53 53
         this.pluginManager = checkNotNull(pluginManager);
54 54
         this.eventBus = checkNotNull(eventBus);
55 55
     }
@@ -85,7 +85,7 @@ public class LegacyServiceLocator implements ServiceLocator {
85 85
                                 services.add((T) object);
86 86
                             }
87 87
                         } catch (ReflectiveOperationException ex) {
88
-                            eventBus.post(new UserErrorEvent(ErrorLevel.LOW, ex,
88
+                            eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, ex,
89 89
                                     "Unable to execute exported method " + method.getName() +
90 90
                                             " in plugin " + pluginInfo.getMetaData().getName(),
91 91
                                     ""));

+ 16
- 17
src/com/dmdirc/plugins/PluginInfo.java Bestand weergeven

@@ -35,8 +35,6 @@ import com.dmdirc.util.SimpleInjector;
35 35
 import com.dmdirc.util.resourcemanager.ResourceManager;
36 36
 import com.dmdirc.util.validators.ValidationResponse;
37 37
 
38
-import com.google.common.eventbus.EventBus;
39
-
40 38
 import java.io.File;
41 39
 import java.io.IOException;
42 40
 import java.io.InputStream;
@@ -55,6 +53,7 @@ import javax.inject.Provider;
55 53
 import org.slf4j.LoggerFactory;
56 54
 
57 55
 import dagger.ObjectGraph;
56
+import net.engio.mbassy.bus.MBassador;
58 57
 
59 58
 /**
60 59
  * Stores plugin metadata and handles loading of plugin resources.
@@ -95,7 +94,7 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
95 94
     /** List of configuration providers. */
96 95
     private final List<ConfigProvider> configProviders = new ArrayList<>();
97 96
     /** Event bus to post plugin loaded events to. */
98
-    private final EventBus eventBus;
97
+    private final MBassador eventBus;
99 98
 
100 99
     /**
101 100
      * Create a new PluginInfo.
@@ -111,7 +110,7 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
111 110
     public PluginInfo(
112 111
             final PluginMetaData metadata,
113 112
             final Provider<PluginInjectorInitialiser> injectorInitialiser,
114
-            final EventBus eventBus,
113
+            final MBassador eventBus,
115 114
             final IdentityController identityController,
116 115
             final ObjectGraph objectGraph) throws PluginException {
117 116
         this.injectorInitialiser = injectorInitialiser;
@@ -304,14 +303,14 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
304 303
                         identityController.addConfigProvider(configProvider);
305 304
                         configProviders.add(configProvider);
306 305
                     } catch (final InvalidIdentityFileException ex) {
307
-                        eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
306
+                        eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
308 307
                                 "Error with identity file '" + name + "' in plugin '"
309 308
                                 + metaData.getName() + "'", ""));
310 309
                     }
311 310
                 }
312 311
             }
313 312
         } catch (final IOException ioe) {
314
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, ioe,
313
+            eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM, ioe,
315 314
                     "Error finding identities in plugin '" + metaData.getName() + "'", ""));
316 315
         }
317 316
     }
@@ -375,7 +374,7 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
375 374
             updateProvides();
376 375
             getDefaults();
377 376
         } catch (IOException ioe) {
378
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, ioe,
377
+            eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM, ioe,
379 378
                     "There was an error updating " + metaData.getName(), ""));
380 379
         }
381 380
     }
@@ -618,7 +617,7 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
618 617
             } catch (LinkageError | Exception e) {
619 618
                 lastError = "Error in onLoad for " + metaData.getName() + ":"
620 619
                         + e.getMessage();
621
-                eventBus.post(new AppErrorEvent(ErrorLevel.MEDIUM, e, lastError, ""));
620
+                eventBus.publishAsync(new AppErrorEvent(ErrorLevel.MEDIUM, e, lastError, ""));
622 621
                 unloadPlugin();
623 622
             }
624 623
         } else {
@@ -636,7 +635,7 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
636 635
 
637 636
             if (isLoaded()) {
638 637
                 //TODO plugin loading shouldn't be done from here, event bus shouldn't be here.
639
-                eventBus.post(new PluginLoadedEvent(this));
638
+                eventBus.publishAsync(new PluginLoadedEvent(this));
640 639
             }
641 640
 
642 641
             isLoading = false;
@@ -746,7 +745,7 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
746 745
                             lastError = "Prerequisites for plugin not met. ('"
747 746
                                     + filename + ":" + metaData.getMainClass()
748 747
                                     + "' -> '" + prerequisites.getFailureReason() + "') ";
749
-                            eventBus.post(new UserErrorEvent(ErrorLevel.LOW, null, lastError, ""));
748
+                            eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, null, lastError, ""));
750 749
                         }
751 750
                     } else {
752 751
                         plugin = (Plugin) temp;
@@ -762,7 +761,7 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
762 761
                             } catch (LinkageError | Exception e) {
763 762
                                 lastError = "Error in onLoad for "
764 763
                                         + metaData.getName() + ":" + e.getMessage();
765
-                                eventBus.post(new AppErrorEvent(ErrorLevel.MEDIUM,
764
+                                eventBus.publishAsync(new AppErrorEvent(ErrorLevel.MEDIUM,
766 765
                                         e, lastError, ""));
767 766
                                 unloadPlugin();
768 767
                             }
@@ -774,23 +773,23 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
774 773
             lastError = "Class not found ('" + filename + ":" + classname + ":"
775 774
                     + classname.equals(metaData.getMainClass()) + "') - "
776 775
                     + cnfe.getMessage();
777
-            eventBus.post(new UserErrorEvent(ErrorLevel.LOW, cnfe, lastError, ""));
776
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.LOW, cnfe, lastError, ""));
778 777
         } catch (NoClassDefFoundError ncdf) {
779 778
             lastError = "Unable to instantiate plugin ('" + filename + ":"
780 779
                     + classname + ":"
781 780
                     + classname.equals(metaData.getMainClass())
782 781
                     + "') - Unable to find class: " + ncdf.getMessage();
783
-            eventBus.post(new UserErrorEvent(ErrorLevel.LOW, ncdf, lastError, ""));
782
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.LOW, ncdf, lastError, ""));
784 783
         } catch (VerifyError ve) {
785 784
             lastError = "Unable to instantiate plugin ('" + filename + ":"
786 785
                     + classname + ":"
787 786
                     + classname.equals(metaData.getMainClass())
788 787
                     + "') - Incompatible: " + ve.getMessage();
789
-            eventBus.post(new UserErrorEvent(ErrorLevel.LOW, ve, lastError, ""));
788
+            eventBus.publishAsync(new UserErrorEvent(ErrorLevel.LOW, ve, lastError, ""));
790 789
         } catch (IllegalArgumentException ex) {
791 790
             lastError = "Unable to instantiate class for plugin " + metaData.getName()
792 791
                     + ": " + classname;
793
-            eventBus.post(new AppErrorEvent(ErrorLevel.LOW, ex, lastError, ""));
792
+            eventBus.publishAsync(new AppErrorEvent(ErrorLevel.LOW, ex, lastError, ""));
794 793
         }
795 794
     }
796 795
 
@@ -852,11 +851,11 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
852 851
                 } catch (Exception | LinkageError e) {
853 852
                     lastError = "Error in onUnload for " + metaData.getName()
854 853
                             + ":" + e + " - " + e.getMessage();
855
-                    eventBus.post(new AppErrorEvent(ErrorLevel.MEDIUM, e, lastError, ""));
854
+                    eventBus.publishAsync(new AppErrorEvent(ErrorLevel.MEDIUM, e, lastError, ""));
856 855
                 }
857 856
 
858 857
                 //TODO plugin unloading shouldn't be done from here, event bus shouldn't be here.
859
-                eventBus.post(new PluginUnloadedEvent(this));
858
+                eventBus.publishAsync(new PluginUnloadedEvent(this));
860 859
                 synchronized (provides) {
861 860
                     for (Service service : provides) {
862 861
                         service.delProvider(this);

+ 3
- 3
src/com/dmdirc/plugins/PluginInjectorInitialiser.java Bestand weergeven

@@ -41,7 +41,7 @@ import com.dmdirc.ui.themes.ThemeManager;
41 41
 import com.dmdirc.util.SimpleInjector;
42 42
 import com.dmdirc.util.URLBuilder;
43 43
 
44
-import com.google.common.eventbus.EventBus;
44
+import net.engio.mbassy.bus.MBassador;
45 45
 
46 46
 import javax.inject.Inject;
47 47
 
@@ -69,7 +69,7 @@ public class PluginInjectorInitialiser {
69 69
     private final URLBuilder urlBuilder;
70 70
     private final ColourManager colourManager;
71 71
     private final ActionSubstitutorFactory actionSubstitutorFactory;
72
-    private final EventBus eventBus;
72
+    private final MBassador eventBus;
73 73
     private final IconManager iconManager;
74 74
 
75 75
     @Inject
@@ -90,7 +90,7 @@ public class PluginInjectorInitialiser {
90 90
             final URLBuilder urlBuilder,
91 91
             final ColourManager colourManager,
92 92
             final ActionSubstitutorFactory actionSubstitutorFactory,
93
-            final EventBus eventBus,
93
+            final MBassador eventBus,
94 94
             @GlobalConfig final IconManager iconManager) {
95 95
         this.actionManager = actionManager;
96 96
         this.actionFactory = actionFactory;

+ 17
- 18
src/com/dmdirc/plugins/PluginManager.java Bestand weergeven

@@ -33,9 +33,6 @@ import com.dmdirc.updater.components.PluginComponent;
33 33
 import com.dmdirc.updater.manager.UpdateManager;
34 34
 import com.dmdirc.util.collections.MapList;
35 35
 
36
-import com.google.common.eventbus.EventBus;
37
-import com.google.common.eventbus.Subscribe;
38
-
39 36
 import java.io.File;
40 37
 import java.net.MalformedURLException;
41 38
 import java.net.URL;
@@ -52,6 +49,8 @@ import java.util.Map;
52 49
 import javax.inject.Provider;
53 50
 
54 51
 import dagger.ObjectGraph;
52
+import net.engio.mbassy.bus.MBassador;
53
+import net.engio.mbassy.listener.Handler;
55 54
 
56 55
 /**
57 56
  * Searches for and manages plugins and services.
@@ -77,7 +76,7 @@ public class PluginManager implements ServiceManager {
77 76
     /** The graph to pass to plugins for DI purposes. */
78 77
     private final ObjectGraph objectGraph;
79 78
     /** Event bus to pass to plugin info for plugin loaded events. */
80
-    private final EventBus eventBus;
79
+    private final MBassador eventBus;
81 80
 
82 81
     /**
83 82
      * Creates a new instance of PluginManager.
@@ -90,7 +89,7 @@ public class PluginManager implements ServiceManager {
90 89
      * @param directory           The directory to load plugins from.
91 90
      */
92 91
     public PluginManager(
93
-            final EventBus eventBus,
92
+            final MBassador eventBus,
94 93
             final IdentityController identityController,
95 94
             final UpdateManager updateManager,
96 95
             final Provider<PluginInjectorInitialiser> initialiserProvider,
@@ -104,7 +103,7 @@ public class PluginManager implements ServiceManager {
104 103
         this.objectGraph = objectGraph;
105 104
         this.eventBus = eventBus;
106 105
 
107
-        eventBus.register(this);
106
+        eventBus.subscribe(this);
108 107
     }
109 108
 
110 109
     /**
@@ -251,7 +250,7 @@ public class PluginManager implements ServiceManager {
251 250
         }
252 251
 
253 252
         if (!new File(directory, filename).exists()) {
254
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
253
+            eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM, null,
255 254
                     "Error loading plugin " + filename + ": File does not exist", ""));
256 255
             return false;
257 256
         }
@@ -266,7 +265,7 @@ public class PluginManager implements ServiceManager {
266 265
                     identityController, objectGraph);
267 266
             final PluginInfo existing = getPluginInfoByName(metadata.getName());
268 267
             if (existing != null) {
269
-                eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
268
+                eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM, null,
270 269
                         "Duplicate Plugin detected, Ignoring. (" + filename
271 270
                         + " is the same as " + existing.getFilename() + ")", ""));
272 271
                 return false;
@@ -281,13 +280,13 @@ public class PluginManager implements ServiceManager {
281 280
 
282 281
             knownPlugins.put(filename.toLowerCase(), pluginInfo);
283 282
 
284
-            eventBus.post(new PluginRefreshEvent());
283
+            eventBus.publishAsync(new PluginRefreshEvent());
285 284
             return true;
286 285
         } catch (MalformedURLException mue) {
287
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, mue,
286
+            eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM, mue,
288 287
                     "Error creating URL for plugin " + filename + ": " + mue.getMessage(), ""));
289 288
         } catch (PluginException e) {
290
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, e,
289
+            eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM, e,
291 290
                     "Error loading plugin " + filename + ": " + e.getMessage(), ""));
292 291
         }
293 292
 
@@ -443,7 +442,7 @@ public class PluginManager implements ServiceManager {
443 442
             plugins.addAll(newPlugins);
444 443
         }
445 444
 
446
-        eventBus.post(new PluginRefreshEvent());
445
+        eventBus.publishAsync(new PluginRefreshEvent());
447 446
     }
448 447
 
449 448
     /**
@@ -505,7 +504,7 @@ public class PluginManager implements ServiceManager {
505 504
                 targetMetaData.load();
506 505
 
507 506
                 if (targetMetaData.hasErrors()) {
508
-                    eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
507
+                    eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM, null,
509 508
                             "Error reading plugin metadata for plugin " + target
510 509
                             + ": " + targetMetaData.getErrors(), ""));
511 510
                 } else {
@@ -524,7 +523,7 @@ public class PluginManager implements ServiceManager {
524 523
                     }
525 524
                 }
526 525
             } catch (MalformedURLException mue) {
527
-                eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, mue,
526
+                eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM, mue,
528 527
                         "Error creating URL for plugin " + target + ": " + mue.getMessage(), ""));
529 528
             }
530 529
         }
@@ -537,7 +536,7 @@ public class PluginManager implements ServiceManager {
537 536
             if (results.isEmpty()) {
538 537
                 res.add(target.getValue());
539 538
             } else {
540
-                eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null,
539
+                eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM, null,
541 540
                         "Plugin validation failed for " + target.getKey() + ": " + results, ""));
542 541
             }
543 542
         }
@@ -573,7 +572,7 @@ public class PluginManager implements ServiceManager {
573 572
         return new ArrayList<>(knownPlugins.values());
574 573
     }
575 574
 
576
-    @Subscribe
575
+    @Handler
577 576
     public void handlePrefsOpened(final ClientPrefsOpenedEvent event) {
578 577
         for (PluginInfo pi : getPluginInfos()) {
579 578
             if (!pi.isLoaded() && !pi.isTempLoaded()) {
@@ -583,7 +582,7 @@ public class PluginManager implements ServiceManager {
583 582
                 try {
584 583
                     pi.getPlugin().showConfig(event.getModel());
585 584
                 } catch (LinkageError | Exception le) {
586
-                    eventBus.post(new AppErrorEvent(ErrorLevel.MEDIUM, le,
585
+                    eventBus.publishAsync(new AppErrorEvent(ErrorLevel.MEDIUM, le,
587 586
                             "Unable to show plugin configuration for "
588 587
                             + pi.getMetaData().getFriendlyName(), ""));
589 588
                 }
@@ -591,7 +590,7 @@ public class PluginManager implements ServiceManager {
591 590
         }
592 591
     }
593 592
 
594
-    @Subscribe
593
+    @Handler
595 594
     public void handlePrefsClosed(final ClientPrefsClosedEvent event) {
596 595
         for (PluginInfo pi : getPluginInfos()) {
597 596
             if (pi.isTempLoaded()) {

+ 12
- 12
src/com/dmdirc/ui/core/util/URLHandler.java Bestand weergeven

@@ -31,8 +31,6 @@ import com.dmdirc.ui.StatusMessage;
31 31
 import com.dmdirc.ui.core.components.StatusBarManager;
32 32
 import com.dmdirc.util.CommandUtils;
33 33
 
34
-import com.google.common.eventbus.EventBus;
35
-
36 34
 import java.awt.Desktop;
37 35
 import java.io.IOException;
38 36
 import java.net.URI;
@@ -42,13 +40,15 @@ import java.util.Date;
42 40
 
43 41
 import javax.inject.Inject;
44 42
 
43
+import net.engio.mbassy.bus.MBassador;
44
+
45 45
 /** Handles URLs. */
46 46
 public class URLHandler {
47 47
 
48 48
     /** The time a browser was last launched. */
49 49
     private static Date lastLaunch;
50 50
     /** Event bus to fire unknown protocol errors on. */
51
-    private final EventBus eventBus;
51
+    private final MBassador eventBus;
52 52
     /** Config manager. */
53 53
     private final AggregateConfigProvider config;
54 54
     /** Server manager to use to connect to servers. */
@@ -68,7 +68,7 @@ public class URLHandler {
68 68
      */
69 69
     @Inject
70 70
     public URLHandler(
71
-            final EventBus eventBus,
71
+            final MBassador eventBus,
72 72
             final AggregateConfigProvider globalConfig,
73 73
             final ServerManager serverManager,
74 74
             final StatusBarManager statusBarManager) {
@@ -94,7 +94,7 @@ public class URLHandler {
94 94
                 uri = new URI("http://" + sanitisedString);
95 95
             }
96 96
         } catch (URISyntaxException ex) {
97
-            eventBus.post(new UserErrorEvent(ErrorLevel.LOW, ex,
97
+            eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, ex,
98 98
                     "Invalid URL: " + ex.getMessage(), ""));
99 99
             return;
100 100
         }
@@ -140,7 +140,7 @@ public class URLHandler {
140 140
                 uri = new URI("http://" + url.toString());
141 141
             }
142 142
         } catch (URISyntaxException ex) {
143
-            eventBus.post(new UserErrorEvent(ErrorLevel.LOW, ex,
143
+            eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, ex,
144 144
                     "Invalid URL: " + ex.getMessage(), ""));
145 145
             return;
146 146
         }
@@ -166,7 +166,7 @@ public class URLHandler {
166 166
         }
167 167
 
168 168
         if (!config.hasOptionString("protocol", uri.getScheme().toLowerCase())) {
169
-            eventBus.post(new UnknownURLEvent(uri));
169
+            eventBus.publish(new UnknownURLEvent(uri));
170 170
             return;
171 171
         }
172 172
 
@@ -272,7 +272,7 @@ public class URLHandler {
272 272
         try {
273 273
             Runtime.getRuntime().exec(CommandUtils.parseArguments(command));
274 274
         } catch (IOException ex) {
275
-            eventBus.post(new UserErrorEvent(ErrorLevel.LOW, ex,
275
+            eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, ex,
276 276
                     "Unable to run application: " + ex.getMessage(), ""));
277 277
         }
278 278
     }
@@ -287,11 +287,11 @@ public class URLHandler {
287 287
             try {
288 288
                 desktop.browse(url);
289 289
             } catch (IOException ex) {
290
-                eventBus.post(new UserErrorEvent(ErrorLevel.LOW, ex,
290
+                eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, ex,
291 291
                         "Unable to open URL: " + ex.getMessage(), ""));
292 292
             }
293 293
         } else {
294
-            eventBus.post(new UserErrorEvent(ErrorLevel.LOW, null,
294
+            eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, null,
295 295
                     "Unable to open your browser: Your desktop enviroment is "
296 296
                     + "not supported, please go to the URL Handlers section of "
297 297
                     + "the preferences dialog and set the path to your browser "
@@ -309,11 +309,11 @@ public class URLHandler {
309 309
             try {
310 310
                 desktop.mail(url);
311 311
             } catch (IOException ex) {
312
-                eventBus.post(new UserErrorEvent(ErrorLevel.LOW, ex,
312
+                eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, ex,
313 313
                         "Unable to open URL: " + ex.getMessage(), ""));
314 314
             }
315 315
         } else {
316
-            eventBus.post(new UserErrorEvent(ErrorLevel.LOW, null,
316
+            eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, null,
317 317
                     "Unable to open your mail client: Your desktop enviroment is "
318 318
                     + "not supported, please go to the URL Handlers section of "
319 319
                     + "the preferences dialog and set the path to your browser "

+ 5
- 5
src/com/dmdirc/ui/input/InputHandler.java Bestand weergeven

@@ -43,8 +43,6 @@ import com.dmdirc.util.collections.ListenerList;
43 43
 import com.dmdirc.util.collections.RollingList;
44 44
 import com.dmdirc.util.validators.ValidationResponse;
45 45
 
46
-import com.google.common.eventbus.EventBus;
47
-
48 46
 import java.awt.Toolkit;
49 47
 import java.awt.event.KeyEvent;
50 48
 import java.util.ArrayList;
@@ -55,6 +53,8 @@ import java.util.TimerTask;
55 53
 
56 54
 import org.slf4j.LoggerFactory;
57 55
 
56
+import net.engio.mbassy.bus.MBassador;
57
+
58 58
 /**
59 59
  * Handles events generated by a user typing into a textfield. Allows the user to use shortcut keys
60 60
  * for control characters (ctrl+b, etc), to tab complete nicknames/channel names/etc, and to scroll
@@ -111,7 +111,7 @@ public abstract class InputHandler implements ConfigChangeListener {
111 111
     /** The controller to use to retrieve command information. */
112 112
     private final CommandController commandController;
113 113
     /** The event bus to use to dispatch input events. */
114
-    private final EventBus eventBus;
114
+    private final MBassador eventBus;
115 115
 
116 116
     /**
117 117
      * Creates a new instance of InputHandler. Adds listeners to the target that we need to operate.
@@ -129,7 +129,7 @@ public abstract class InputHandler implements ConfigChangeListener {
129 129
             final CommandController commandController,
130 130
             final CommandParser commandParser,
131 131
             final FrameContainer parentWindow,
132
-            final EventBus eventBus) {
132
+            final MBassador eventBus) {
133 133
         buffer = new RollingList<>(parentWindow.getConfigManager()
134 134
                 .getOptionInt("ui", "inputbuffersize"), "");
135 135
 
@@ -579,7 +579,7 @@ public abstract class InputHandler implements ConfigChangeListener {
579 579
     public void enterPressed(final String line) {
580 580
         if (!line.isEmpty()) {
581 581
             final StringBuffer bufferedLine = new StringBuffer(line);
582
-            eventBus.post(new ClientUserInputEvent(parentWindow, bufferedLine));
582
+            eventBus.publishAsync(new ClientUserInputEvent(parentWindow, bufferedLine));
583 583
             addToBuffer(bufferedLine.toString());
584 584
             commandParser.parseCommand(parentWindow, bufferedLine.toString());
585 585
         }

+ 6
- 6
src/com/dmdirc/ui/themes/Theme.java Bestand weergeven

@@ -30,12 +30,12 @@ import com.dmdirc.util.io.ConfigFile;
30 30
 import com.dmdirc.util.io.InvalidConfigFileException;
31 31
 import com.dmdirc.util.resourcemanager.ZipResourceManager;
32 32
 
33
-import com.google.common.eventbus.EventBus;
34
-
35 33
 import java.io.File;
36 34
 import java.io.IOException;
37 35
 import java.io.InputStream;
38 36
 
37
+import net.engio.mbassy.bus.MBassador;
38
+
39 39
 /**
40 40
  * Represents one theme file.
41 41
  */
@@ -46,7 +46,7 @@ public class Theme implements Comparable<Theme> {
46 46
     /** The file to load the theme from. */
47 47
     private final File file;
48 48
     /** The event bus to post errors to. */
49
-    private final EventBus eventBus;
49
+    private final MBassador eventBus;
50 50
     /** The config file containing theme meta-data. */
51 51
     private ConfigFile metadata;
52 52
     /** The resource manager we're using for this theme. */
@@ -56,7 +56,7 @@ public class Theme implements Comparable<Theme> {
56 56
     /** The Identity we've registered. */
57 57
     private ThemeIdentity identity;
58 58
 
59
-    public Theme(final EventBus eventBus, final IdentityController identityController,
59
+    public Theme(final MBassador eventBus, final IdentityController identityController,
60 60
             final File file) {
61 61
         this.identityController = identityController;
62 62
         this.file = file;
@@ -74,7 +74,7 @@ public class Theme implements Comparable<Theme> {
74 74
             try {
75 75
                 rm = ZipResourceManager.getInstance(file.getCanonicalPath());
76 76
             } catch (IOException ex) {
77
-                eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
77
+                eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM, ex,
78 78
                         "I/O error when loading theme: " + file.getAbsolutePath() + ": "
79 79
                                 + ex.getMessage(), ""));
80 80
 
@@ -112,7 +112,7 @@ public class Theme implements Comparable<Theme> {
112 112
                 identity = new ThemeIdentity(stream, this);
113 113
                 identityController.addConfigProvider(identity);
114 114
             } catch (InvalidIdentityFileException | IOException ex) {
115
-                eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM,
115
+                eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM,
116 116
                         ex, "Error loading theme identity file: " + ex.getMessage(), ""));
117 117
             }
118 118
         }

+ 7
- 6
src/com/dmdirc/ui/themes/ThemeManager.java Bestand weergeven

@@ -27,13 +27,13 @@ import com.dmdirc.interfaces.config.ConfigChangeListener;
27 27
 import com.dmdirc.interfaces.config.IdentityController;
28 28
 import com.dmdirc.logger.ErrorLevel;
29 29
 
30
-import com.google.common.eventbus.EventBus;
31
-
32 30
 import java.io.File;
33 31
 import java.util.HashMap;
34 32
 import java.util.List;
35 33
 import java.util.Map;
36 34
 
35
+import net.engio.mbassy.bus.MBassador;
36
+
37 37
 /**
38 38
  * Manages available themes.
39 39
  */
@@ -46,7 +46,7 @@ public class ThemeManager {
46 46
     /** Available themes. */
47 47
     private final Map<String, Theme> themes = new HashMap<>();
48 48
     /** The event bus to post errors to. */
49
-    private final EventBus eventBus;
49
+    private final MBassador eventBus;
50 50
 
51 51
     /**
52 52
      * Creates a new instance of the {@link ThemeManager}.
@@ -56,7 +56,7 @@ public class ThemeManager {
56 56
      * @param themesDirectory    The directory to load themes from.
57 57
      */
58 58
     public ThemeManager(
59
-            final EventBus eventBus,
59
+            final MBassador eventBus,
60 60
             final IdentityController identityController,
61 61
             final String themesDirectory) {
62 62
         this.identityController = identityController;
@@ -78,12 +78,13 @@ public class ThemeManager {
78 78
         final File dir = new File(themeDirectory);
79 79
 
80 80
         if (!dir.exists() && !dir.mkdirs()) {
81
-            eventBus.post(new UserErrorEvent(ErrorLevel.HIGH, null,
81
+            eventBus.publish(new UserErrorEvent(ErrorLevel.HIGH, null,
82 82
                     "Could not create themes directory", ""));
83 83
         }
84 84
 
85 85
         if (dir.listFiles() == null) {
86
-            eventBus.post(new UserErrorEvent(ErrorLevel.MEDIUM, null, "Unable to load themes", ""));
86
+            eventBus.publish(new UserErrorEvent(ErrorLevel.MEDIUM, null,
87
+                    "Unable to load themes", ""));
87 88
             return;
88 89
         }
89 90
 

+ 8
- 8
src/com/dmdirc/updater/UpdateChecker.java Bestand weergeven

@@ -29,13 +29,13 @@ import com.dmdirc.logger.ErrorLevel;
29 29
 import com.dmdirc.updater.manager.CachingUpdateManager;
30 30
 import com.dmdirc.updater.manager.UpdateStatus;
31 31
 
32
-import com.google.common.eventbus.EventBus;
33
-
34 32
 import java.util.Date;
35 33
 import java.util.Timer;
36 34
 import java.util.TimerTask;
37 35
 import java.util.concurrent.Semaphore;
38 36
 
37
+import net.engio.mbassy.bus.MBassador;
38
+
39 39
 /**
40 40
  * The update checker contacts the DMDirc website to check to see if there are any updates
41 41
  * available.
@@ -53,7 +53,7 @@ public final class UpdateChecker implements Runnable {
53 53
     /** The controller to use to read and write settings. */
54 54
     private final IdentityController identityController;
55 55
     /** The event bus to post errors to. */
56
-    private final EventBus eventBus;
56
+    private final MBassador eventBus;
57 57
 
58 58
     /**
59 59
      * Creates a new instance of {@link UpdateChecker}.
@@ -65,7 +65,7 @@ public final class UpdateChecker implements Runnable {
65 65
     public UpdateChecker(
66 66
             final CachingUpdateManager updateManager,
67 67
             final IdentityController identityController,
68
-            final EventBus eventBus) {
68
+            final MBassador eventBus) {
69 69
         this.updateManager = updateManager;
70 70
         this.identityController = identityController;
71 71
         this.eventBus = eventBus;
@@ -124,7 +124,7 @@ public final class UpdateChecker implements Runnable {
124 124
     public static void init(
125 125
             final CachingUpdateManager manager,
126 126
             final IdentityController controller,
127
-            final EventBus eventBus) {
127
+            final MBassador eventBus) {
128 128
         final int last = controller.getGlobalConfiguration()
129 129
                 .getOptionInt(DOMAIN, "lastcheck");
130 130
         final int freq = controller.getGlobalConfiguration()
@@ -137,7 +137,7 @@ public final class UpdateChecker implements Runnable {
137 137
         }
138 138
 
139 139
         if (time > freq || time < 0) {
140
-            eventBus.post(new UserErrorEvent(ErrorLevel.LOW, null,
140
+            eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, null,
141 141
                     "Attempted to schedule update check " + (time < 0
142 142
                             ? "in the past" : "too far in the future") + ", rescheduling.", ""));
143 143
             time = 1;
@@ -164,7 +164,7 @@ public final class UpdateChecker implements Runnable {
164 164
     public static void checkNow(
165 165
             final CachingUpdateManager updateManager,
166 166
             final IdentityController identityController,
167
-            final EventBus eventBus) {
167
+            final MBassador eventBus) {
168 168
         checkNow(updateManager, identityController, eventBus, "Update Checker thread");
169 169
     }
170 170
 
@@ -179,7 +179,7 @@ public final class UpdateChecker implements Runnable {
179 179
     public static void checkNow(
180 180
             final CachingUpdateManager updateManager,
181 181
             final IdentityController identityController,
182
-            final EventBus eventBus,
182
+            final MBassador eventBus,
183 183
             final String threadName) {
184 184
         new Thread(new UpdateChecker(updateManager, identityController, eventBus), threadName)
185 185
                 .start();

+ 2
- 2
src/com/dmdirc/updater/UpdaterModule.java Bestand weergeven

@@ -42,7 +42,7 @@ import com.dmdirc.updater.manager.UpdateManager;
42 42
 import com.dmdirc.updater.retrieving.DownloadRetrievalStrategy;
43 43
 import com.dmdirc.updater.retrieving.UpdateRetrievalStrategy;
44 44
 
45
-import com.google.common.eventbus.EventBus;
45
+import net.engio.mbassy.bus.MBassador;
46 46
 
47 47
 import javax.inject.Singleton;
48 48
 
@@ -107,7 +107,7 @@ public class UpdaterModule {
107 107
             final CommandLineParser commandLineParser,
108 108
             final DMDircUpdateManager updateManager,
109 109
             final IdentityController identityController,
110
-            final EventBus eventBus) {
110
+            final MBassador eventBus) {
111 111
         UpdateChecker.init(updateManager, identityController, eventBus);
112 112
 
113 113
         if (commandLineParser.getLauncherVersion() != null) {

+ 0
- 37
src/com/dmdirc/util/AsyncEvent.java Bestand weergeven

@@ -1,37 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2014 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.util;
24
-
25
-import java.lang.annotation.ElementType;
26
-import java.lang.annotation.Retention;
27
-import java.lang.annotation.RetentionPolicy;
28
-import java.lang.annotation.Target;
29
-
30
-/**
31
- * Marker interface used to identify an event that should be dispatched asynchronously by a
32
- * {@link DynamicAsyncEventBus}.
33
- */
34
-@Target(ElementType.TYPE)
35
-@Retention(RetentionPolicy.RUNTIME)
36
-public @interface AsyncEvent {
37
-}

+ 12
- 11
src/com/dmdirc/util/ChildEventBusManager.java Bestand weergeven

@@ -22,25 +22,26 @@
22 22
 
23 23
 package com.dmdirc.util;
24 24
 
25
-import com.google.common.eventbus.EventBus;
26
-import com.google.common.eventbus.Subscribe;
25
+import net.engio.mbassy.bus.MBassador;
26
+import net.engio.mbassy.bus.config.BusConfiguration;
27
+import net.engio.mbassy.listener.Handler;
27 28
 
28 29
 import static com.google.common.base.Preconditions.checkNotNull;
29 30
 
30 31
 /**
31
- * Utility for creating and managing instances of {@link EventBus} that are slaved to a parent bus.
32
+ * Utility for creating and managing instances of {@link net.engio.mbassy.bus.MBassador} that are slaved to a parent bus.
32 33
  * <p>
33 34
  * Any events sent on the child bus will be propagated up to the parent bus.
34 35
  */
35 36
 public class ChildEventBusManager {
36 37
 
37
-    private final EventBus parent;
38
-    private final EventBus child;
38
+    private final MBassador parent;
39
+    private final MBassador child;
39 40
     private final EventPropagator propagator;
40 41
 
41
-    public ChildEventBusManager(final EventBus parent) {
42
+    public ChildEventBusManager(final MBassador parent) {
42 43
         this.parent = checkNotNull(parent);
43
-        this.child = new EventBus();
44
+        this.child = new MBassador(BusConfiguration.Default());
44 45
         this.propagator = new EventPropagator();
45 46
     }
46 47
 
@@ -50,7 +51,7 @@ public class ChildEventBusManager {
50 51
      * After this method is called, all events sent to the child bus will be passed to the parent.
51 52
      */
52 53
     public void connect() {
53
-        child.register(propagator);
54
+        child.subscribe(propagator);
54 55
     }
55 56
 
56 57
     /**
@@ -59,7 +60,7 @@ public class ChildEventBusManager {
59 60
      * After this method is called, no further events will be passed to the parent.
60 61
      */
61 62
     public void disconnect() {
62
-        child.unregister(propagator);
63
+        child.unsubscribe(propagator);
63 64
     }
64 65
 
65 66
     /**
@@ -67,13 +68,13 @@ public class ChildEventBusManager {
67 68
      *
68 69
      * @return The child bus belonging to this manager.
69 70
      */
70
-    public EventBus getChildBus() {
71
+    public MBassador getChildBus() {
71 72
         return child;
72 73
     }
73 74
 
74 75
     private class EventPropagator {
75 76
 
76
-        @Subscribe
77
+        @Handler
77 78
         public void handleEvent(final Object object) {
78 79
             parent.post(object);
79 80
         }

+ 0
- 55
src/com/dmdirc/util/DynamicAsyncEventBus.java Bestand weergeven

@@ -1,55 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2014 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.util;
24
-
25
-import com.google.common.eventbus.EventBus;
26
-
27
-import java.util.concurrent.Executor;
28
-
29
-/**
30
- * An {@link EventBus} that will dispatch events asynchronously if they annotated with
31
- * {@link AsyncEvent}.
32
- */
33
-public class DynamicAsyncEventBus extends EventBus {
34
-
35
-    private final Executor executor;
36
-
37
-    public DynamicAsyncEventBus(final Executor executor) {
38
-        this.executor = executor;
39
-    }
40
-
41
-    @Override
42
-    public void post(final Object event) {
43
-        if (event.getClass().isAnnotationPresent(AsyncEvent.class)) {
44
-            executor.execute(new Runnable() {
45
-                @Override
46
-                public void run() {
47
-                    DynamicAsyncEventBus.super.post(event);
48
-                }
49
-            });
50
-        } else {
51
-            super.post(event);
52
-        }
53
-    }
54
-
55
-}

+ 10
- 10
src/com/dmdirc/util/URLBuilder.java Bestand weergeven

@@ -27,8 +27,6 @@ import com.dmdirc.logger.ErrorLevel;
27 27
 import com.dmdirc.plugins.PluginManager;
28 28
 import com.dmdirc.ui.themes.ThemeManager;
29 29
 
30
-import com.google.common.eventbus.EventBus;
31
-
32 30
 import java.net.MalformedURLException;
33 31
 import java.net.URL;
34 32
 
@@ -36,6 +34,8 @@ import javax.inject.Inject;
36 34
 import javax.inject.Provider;
37 35
 import javax.inject.Singleton;
38 36
 
37
+import net.engio.mbassy.bus.MBassador;
38
+
39 39
 /**
40 40
  * Provides methods for building URLs to reference DMDirc resources.
41 41
  */
@@ -47,7 +47,7 @@ public class URLBuilder {
47 47
     /** Provider to retrieve a theme manager instance when needed. */
48 48
     private final Provider<ThemeManager> themeManagerProvider;
49 49
     /** The event bus to post errors on. */
50
-    private final EventBus eventBus;
50
+    private final MBassador eventBus;
51 51
 
52 52
     /**
53 53
      * Creates a new instance of URLBuilder.
@@ -60,7 +60,7 @@ public class URLBuilder {
60 60
     public URLBuilder(
61 61
             final Provider<PluginManager> pluginManagerProvider,
62 62
             final Provider<ThemeManager> themeManagerProvider,
63
-            final EventBus eventBus) {
63
+            final MBassador eventBus) {
64 64
         this.pluginManagerProvider = pluginManagerProvider;
65 65
         this.themeManagerProvider = themeManagerProvider;
66 66
         this.eventBus = eventBus;
@@ -79,7 +79,7 @@ public class URLBuilder {
79 79
         try {
80 80
             return new URL(prefix + path);
81 81
         } catch (MalformedURLException ex) {
82
-            eventBus.post(new UserErrorEvent(ErrorLevel.HIGH, ex, "Unable to build file URL", ""));
82
+            eventBus.publish(new UserErrorEvent(ErrorLevel.HIGH, ex, "Unable to build file URL", ""));
83 83
             return null;
84 84
         }
85 85
     }
@@ -100,7 +100,7 @@ public class URLBuilder {
100 100
             }
101 101
             return new URL(url);
102 102
         } catch (MalformedURLException ex) {
103
-            eventBus.post(new UserErrorEvent(ErrorLevel.HIGH, ex, "Unable to build jar URL", ""));
103
+            eventBus.publish(new UserErrorEvent(ErrorLevel.HIGH, ex, "Unable to build jar URL", ""));
104 104
             return null;
105 105
         }
106 106
     }
@@ -165,7 +165,7 @@ public class URLBuilder {
165 165
             final int offset = spec.indexOf(':', 6);
166 166
 
167 167
             if (offset < 0) {
168
-                eventBus.post(new UserErrorEvent(ErrorLevel.LOW, null,
168
+                eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, null,
169 169
                         "Invalid URL, must contain ':': " + spec, ""));
170 170
                 return null;
171 171
             } else {
@@ -175,7 +175,7 @@ public class URLBuilder {
175 175
             final int offset = spec.indexOf(':', 8);
176 176
 
177 177
             if (offset < 0) {
178
-                eventBus.post(new UserErrorEvent(ErrorLevel.LOW, null,
178
+                eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, null,
179 179
                         "Invalid URL, must contain ':': " + spec, ""));
180 180
                 return null;
181 181
             } else {
@@ -185,7 +185,7 @@ public class URLBuilder {
185 185
             final int offset = spec.indexOf(':', 8);
186 186
 
187 187
             if (offset < 0) {
188
-                eventBus.post(new UserErrorEvent(ErrorLevel.LOW, null,
188
+                eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, null,
189 189
                         "Invalid URL, must contain ':': " + spec, ""));
190 190
                 return null;
191 191
             } else {
@@ -195,7 +195,7 @@ public class URLBuilder {
195 195
             try {
196 196
                 return new URL(spec);
197 197
             } catch (MalformedURLException ex) {
198
-                eventBus.post(new UserErrorEvent(ErrorLevel.LOW, ex,
198
+                eventBus.publish(new UserErrorEvent(ErrorLevel.LOW, ex,
199 199
                         "Unable to load resource", ""));
200 200
                 return null;
201 201
             }

+ 2
- 2
test/com/dmdirc/ServerManagerTest.java Bestand weergeven

@@ -32,7 +32,7 @@ import com.dmdirc.interfaces.config.IdentityFactory;
32 32
 import com.dmdirc.parser.common.ChannelJoinRequest;
33 33
 import com.dmdirc.ui.WindowManager;
34 34
 
35
-import com.google.common.eventbus.EventBus;
35
+import net.engio.mbassy.bus.MBassador;
36 36
 
37 37
 import java.net.URI;
38 38
 import java.util.Arrays;
@@ -70,7 +70,7 @@ public class ServerManagerTest {
70 70
     @Mock private WindowManager windowManager;
71 71
     @Mock private ServerFactoryImpl serverFactoryImpl;
72 72
     @Mock private Server server;
73
-    @Mock private EventBus eventBus;
73
+    @Mock private MBassador eventBus;
74 74
 
75 75
     @Captor private ArgumentCaptor<URI> uriCaptor;
76 76
 

+ 2
- 2
test/com/dmdirc/ServerTest.java Bestand weergeven

@@ -35,7 +35,7 @@ import com.dmdirc.ui.input.TabCompleter;
35 35
 import com.dmdirc.ui.input.TabCompleterFactory;
36 36
 import com.dmdirc.util.URLBuilder;
37 37
 
38
-import com.google.common.eventbus.EventBus;
38
+import net.engio.mbassy.bus.MBassador;
39 39
 
40 40
 import java.net.URI;
41 41
 import java.util.concurrent.ScheduledExecutorService;
@@ -70,7 +70,7 @@ public class ServerTest {
70 70
     @Mock private RawFactory rawFactory;
71 71
     @Mock private StatusBarManager statusBarManager;
72 72
     @Mock private URLBuilder urlBuilder;
73
-    @Mock private EventBus eventBus;
73
+    @Mock private MBassador eventBus;
74 74
     @Mock private ScheduledExecutorService executorService;
75 75
     @Mock private MessageEncoderFactory messageEncoderFactory;
76 76
 

+ 2
- 2
test/com/dmdirc/WritableFrameContainerTest.java Bestand weergeven

@@ -29,7 +29,7 @@ import com.dmdirc.interfaces.config.AggregateConfigProvider;
29 29
 import com.dmdirc.messages.MessageSinkManager;
30 30
 import com.dmdirc.util.URLBuilder;
31 31
 
32
-import com.google.common.eventbus.EventBus;
32
+import net.engio.mbassy.bus.MBassador;
33 33
 
34 34
 import java.util.Arrays;
35 35
 
@@ -48,7 +48,7 @@ public class WritableFrameContainerTest {
48 48
     @Mock private ServerManager serverManager;
49 49
     @Mock private MessageSinkManager messageSinkManager;
50 50
     @Mock private URLBuilder urlBuilder;
51
-    @Mock private EventBus eventBus;
51
+    @Mock private MBassador eventBus;
52 52
     private CommandManager commands;
53 53
 
54 54
     @Before

+ 2
- 2
test/com/dmdirc/actions/ActionTest.java Bestand weergeven

@@ -36,7 +36,7 @@ import com.dmdirc.logger.Logger;
36 36
 import com.dmdirc.util.io.ConfigFile;
37 37
 import com.dmdirc.util.io.InvalidConfigFileException;
38 38
 
39
-import com.google.common.eventbus.EventBus;
39
+import net.engio.mbassy.bus.MBassador;
40 40
 
41 41
 import java.io.IOException;
42 42
 import java.nio.file.FileSystem;
@@ -72,7 +72,7 @@ public class ActionTest {
72 72
 
73 73
     @Rule public final TemporaryFolder folder = new TemporaryFolder();
74 74
 
75
-    @Mock private EventBus eventBus;
75
+    @Mock private MBassador eventBus;
76 76
     @Mock private Provider<GlobalCommandParser> gcpProvider;
77 77
     @Mock private Provider<GlobalWindow> gwProvider;
78 78
     @Mock private ActionSubstitutorFactory substitutorFactory;

+ 2
- 2
test/com/dmdirc/commandparser/parsers/CommandParserTest.java Bestand weergeven

@@ -31,7 +31,7 @@ import com.dmdirc.interfaces.CommandController;
31 31
 import com.dmdirc.interfaces.Connection;
32 32
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
33 33
 
34
-import com.google.common.eventbus.EventBus;
34
+import net.engio.mbassy.bus.MBassador;
35 35
 
36 36
 import org.junit.Before;
37 37
 import org.junit.Test;
@@ -58,7 +58,7 @@ public class CommandParserTest {
58 58
     @Mock private FrameContainer container;
59 59
     @Mock private Channel channel;
60 60
     @Mock private Connection connection;
61
-    @Mock private EventBus eventBus;
61
+    @Mock private MBassador eventBus;
62 62
     private TestCommandParser commandParser;
63 63
     private TestCommandParser channelCommandParser;
64 64
 

+ 5
- 5
test/com/dmdirc/config/prefs/PreferencesDialogModelTest.java Bestand weergeven

@@ -29,8 +29,6 @@ import com.dmdirc.interfaces.config.AggregateConfigProvider;
29 29
 import com.dmdirc.plugins.PluginManager;
30 30
 import com.dmdirc.plugins.Service;
31 31
 
32
-import com.google.common.eventbus.EventBus;
33
-
34 32
 import java.util.ArrayList;
35 33
 import java.util.List;
36 34
 
@@ -40,6 +38,8 @@ import org.junit.runner.RunWith;
40 38
 import org.mockito.Mock;
41 39
 import org.mockito.runners.MockitoJUnitRunner;
42 40
 
41
+import net.engio.mbassy.bus.MBassador;
42
+
43 43
 import static org.junit.Assert.assertFalse;
44 44
 import static org.junit.Assert.assertNotNull;
45 45
 import static org.junit.Assert.assertNull;
@@ -52,7 +52,7 @@ import static org.mockito.Mockito.when;
52 52
 @RunWith(MockitoJUnitRunner.class)
53 53
 public class PreferencesDialogModelTest {
54 54
 
55
-    @Mock private EventBus eventBus;
55
+    @Mock private MBassador eventBus;
56 56
     @Mock private PluginManager pluginManager;
57 57
 
58 58
     @Before
@@ -171,7 +171,7 @@ public class PreferencesDialogModelTest {
171 171
         final PreferencesDialogModel pm = new PreferencesDialogModel(null, null,
172 172
                 null, null, cm, null, pluginManager, eventBus);
173 173
 
174
-        verify(eventBus).post(isA(ClientPrefsOpenedEvent.class));
174
+        verify(eventBus).publishAsync(isA(ClientPrefsOpenedEvent.class));
175 175
     }
176 176
 
177 177
     @Test
@@ -183,7 +183,7 @@ public class PreferencesDialogModelTest {
183 183
                 null, null, cm, null, pluginManager, eventBus);
184 184
         pm.close();
185 185
 
186
-        verify(eventBus).post(isA(ClientPrefsClosedEvent.class));
186
+        verify(eventBus).publishAsync(isA(ClientPrefsClosedEvent.class));
187 187
     }
188 188
 
189 189
     @Test

+ 6
- 6
test/com/dmdirc/config/prefs/PreferencesManagerTest.java Bestand weergeven

@@ -26,34 +26,34 @@ import com.dmdirc.events.ConnectionPrefsRequestedEvent;
26 26
 import com.dmdirc.events.GroupChatPrefsRequestedEvent;
27 27
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
28 28
 
29
-import com.google.common.eventbus.EventBus;
30
-
31 29
 import org.junit.Test;
32 30
 import org.junit.runner.RunWith;
33 31
 import org.mockito.Mock;
34 32
 import org.mockito.runners.MockitoJUnitRunner;
35 33
 
34
+import net.engio.mbassy.bus.MBassador;
35
+
36 36
 import static org.mockito.Matchers.isA;
37 37
 import static org.mockito.Mockito.verify;
38 38
 
39 39
 @RunWith(MockitoJUnitRunner.class)
40 40
 public class PreferencesManagerTest {
41 41
 
42
-    @Mock private EventBus eventBus;
42
+    @Mock private MBassador eventBus;
43 43
     @Mock private AggregateConfigProvider configManager;
44 44
 
45 45
     @Test
46 46
     public void testGettingChannelPrefsRaisesAction() {
47 47
         new PreferencesManager(eventBus).getChannelSettings(this.configManager, null);
48
-        verify(eventBus).post(isA(GroupChatPrefsRequestedEvent.class));
48
+        verify(eventBus).publish(isA(GroupChatPrefsRequestedEvent.class));
49 49
     }
50 50
 
51 51
     @Test
52 52
     public void testGettingServerPrefsRaisesAction() {
53 53
         new PreferencesManager(eventBus).getServerSettings(this.configManager, null);
54 54
 
55
-        verify(eventBus).post(isA(GroupChatPrefsRequestedEvent.class));
56
-        verify(eventBus).post(isA(ConnectionPrefsRequestedEvent.class));
55
+        verify(eventBus).publish(isA(GroupChatPrefsRequestedEvent.class));
56
+        verify(eventBus).publish(isA(ConnectionPrefsRequestedEvent.class));
57 57
     }
58 58
 
59 59
 }

+ 2
- 2
test/com/dmdirc/harness/TestCommandParser.java Bestand weergeven

@@ -31,7 +31,7 @@ import com.dmdirc.commandparser.parsers.CommandParser;
31 31
 import com.dmdirc.interfaces.CommandController;
32 32
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
33 33
 
34
-import com.google.common.eventbus.EventBus;
34
+import net.engio.mbassy.bus.MBassador;
35 35
 
36 36
 public class TestCommandParser extends CommandParser {
37 37
 
@@ -48,7 +48,7 @@ public class TestCommandParser extends CommandParser {
48 48
     public String invalidCommand;
49 49
 
50 50
     public TestCommandParser(final AggregateConfigProvider configManager,
51
-            final CommandController commandManager, final EventBus eventBus) {
51
+            final CommandController commandManager, final MBassador eventBus) {
52 52
         super(configManager, commandManager, eventBus);
53 53
     }
54 54
 

+ 0
- 0
test/com/dmdirc/harness/TestWritableFrameContainer.java Bestand weergeven


Some files were not shown because too many files changed in this diff

Laden…
Annuleren
Opslaan