List of usage examples for com.google.common.eventbus EventBus EventBus
public EventBus(SubscriberExceptionHandler exceptionHandler)
From source file:org.apache.ambari.server.events.publishers.VersionEventPublisher.java
/** * Constructor. */ public VersionEventPublisher() { m_eventBus = new EventBus("version-event-bus"); }
From source file:io.spikex.core.util.NioDirWatcher.java
public NioDirWatcher() { m_eventBus = new EventBus(NioDirWatcher.class.getSimpleName() + "-" + m_count.getAndIncrement()); }
From source file:com.esofthead.mycollab.eventmanager.EventBusFactoryImpl.java
@Override public EventBus getInstanceInSession() { EventBus eventBus = (EventBus) MyCollabSession.getVariable(EVENT_BUS_VAL); LOG.debug("Event bus {}", eventBus); if (eventBus == null) { eventBus = new EventBus(new SubscriberEventBusExceptionHandler()); MyCollabSession.putVariable(EVENT_BUS_VAL, eventBus); LOG.debug("Create new event bus {}", eventBus); }/*from www . j av a2 s .com*/ return eventBus; }
From source file:com.netflix.metacat.common.server.events.MetacatEventBus.java
/** * Constructor.//from www. ja v a2s .com * @param config config */ @Inject public MetacatEventBus(final Config config) { final ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("metacat-event-pool-%d") .build(); final int threadCount = config.getEventBusThreadCount(); this.asyncEventBus = new AsyncEventBus("metacat-async-event-bus", Executors.newFixedThreadPool(threadCount, threadFactory)); this.syncEventBus = new EventBus("metacat-sync-event-bus"); }
From source file:org.grycap.gpf4med.event.EventBusHandler.java
private EventBusHandler() { eventBus = new EventBus(EVENT_BUS_NAME); // register dead event listener register(DeadEventListener.INSTANCE); }
From source file:org.jskat.control.JSkatEventBus.java
private JSkatEventBus() { mainEventBus = new EventBus("JSkat"); mainEventBus.register(this); }
From source file:com.kolich.blog.components.cache.bus.BlogEventBus.java
public BlogEventBus() { bus_ = new EventBus(BlogEventBus.class.getCanonicalName()); }
From source file:at.ac.univie.isc.asio.CaptureEvents.java
private CaptureEvents(final Class<EVENT> type) { this.type = type; this.eventBus = new EventBus("test"); this.captured = Lists.newArrayList(); eventBus.register(new CaptureSubscriber()); }
From source file:org.nnsoft.guice.gguava.eventbus.EventBusModule.java
protected BusMatcher bindBus(final String identifier) { checkArgument(identifier != null, "Event bus identifier must be not null"); return new BusMatcher() { public void toAnyBoundClass() { to(any());/*from ww w . ja va 2s. com*/ } public void to(Matcher<Object> matcher) { checkArgument(matcher != null, "Event bus matcher must be not null"); final EventBus eventBus = new EventBus(identifier); bind(EventBus.class).annotatedWith(named(identifier)).toInstance(eventBus); bindListener(matcher, new TypeListener() { public <I> void hear(TypeLiteral<I> typeLiteral, TypeEncounter<I> typeEncounter) { typeEncounter.register(new InjectionListener<I>() { public void afterInjection(I injectee) { eventBus.register(injectee); } }); } }); } }; }
From source file:eu.eubrazilcc.lvl.core.event.EventHandler.java
private EventHandler() { eventBus = new EventBus(EVENT_BUS_NAME); // register dead event listener register(DEAD_EVENT_LISTENER); }