Code example for EventBus

Methods: register

0
    injector.getInstance(AlertStateChangedListener.class);
 
    dispatchDao = injector.getInstance(AlertDispatchDAO.class);
    eventPublisher = injector.getInstance(AlertEventPublisher.class);
 
    EventBus synchronizedBus = new EventBus();
    synchronizedBus.register(injector.getInstance(AlertStateChangedListener.class));
 
    // !!! need a synchronous op for testing 
    Field field = AlertEventPublisher.class.getDeclaredField("m_eventBus");
    field.setAccessible(true);
    field.set(eventPublisher, synchronizedBus);
  } 
 
  /** 
   * @throws Exception 
   */ 
  @After 
  public void teardown() throws Exception {
    injector.getInstance(PersistService.class).stop();
Connect your IDE to all the code out there  Get Codota for Java