mirror of https://github.com/apache/jclouds.git
Merge pull request #742 from andrewgaul/event-bus-singleton
Ensure that EventBus is a singleton
This commit is contained in:
commit
6016272486
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue