Inject event bus.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 16 Mar 2013 17:54:52 +0000 (18:54 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 16 Mar 2013 17:55:28 +0000 (18:55 +0100)
pom.xml
src/main/java/net/pterodactylus/sonitus/data/filter/MultiSourceFilter.java

diff --git a/pom.xml b/pom.xml
index 56eda58..b78f4ba 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                        <version>14.0-rc1</version>
                </dependency>
                <dependency>
+                       <groupId>com.google.inject</groupId>
+                       <artifactId>guice</artifactId>
+                       <version>3.0</version>
+               </dependency>
+               <dependency>
                        <groupId>org.jcraft</groupId>
                        <artifactId>jorbis</artifactId>
                        <version>0.0.17</version>
index 38e7473..3c3dc7a 100644 (file)
@@ -35,6 +35,9 @@ import net.pterodactylus.sonitus.data.Format;
 import net.pterodactylus.sonitus.data.ReusableSink;
 import net.pterodactylus.sonitus.data.Source;
 
+import com.google.common.eventbus.EventBus;
+import com.google.inject.Inject;
+
 /**
  * {@link ReusableSink} implementation that supports changing the source without
  * letting the {@link net.pterodactylus.sonitus.data.Sink} know.
@@ -49,12 +52,20 @@ public class MultiSourceFilter implements Filter, ReusableSink {
        /** Object used for synchronization. */
        private final Object syncObject = new Object();
 
+       /** The event bus. */
+       private final EventBus eventBus;
+
        /** The connection. */
        private Connection connection;
 
        /** The format. */
        private Format format;
 
+       @Inject
+       public MultiSourceFilter(EventBus eventBus) {
+               this.eventBus = eventBus;
+       }
+
        @Override
        public Format format() {
                return format;