Merge pull request #742 from andrewgaul/event-bus-singleton

Ensure that EventBus is a singleton
This commit is contained in:
Adrian Cole 2012-07-23 12:18:58 -07:00
commit 6016272486
1 changed files with 2 additions and 1 deletions

View File

@ -33,6 +33,7 @@ import com.google.common.eventbus.AsyncEventBus;
import com.google.common.eventbus.EventBus;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.Scopes;
/**
* Configures the {@link EventBus} to be used in the platform.
@ -79,7 +80,7 @@ public class EventBusModule extends AbstractModule {
*/
@Override
protected void configure() {
bind(EventBus.class).annotatedWith(AsyncBus.class).to(AsyncEventBus.class);
bind(EventBus.class).annotatedWith(AsyncBus.class).to(AsyncEventBus.class).in(Scopes.SINGLETON);
}
}