Ensure that EventBus is a singleton

This commit is contained in:
Andrew Gaul 2012-07-23 11:02:26 -07:00 committed by Andrew Gaul
parent 8402446365
commit 8524dd3a67
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);
}
}