Code example for EventBus

0
 
  /** 
   * Constructor. 
   */ 
  public AmbariEventPublisher() { 
    m_eventBus = new EventBus("ambari-event-bus");
  } 
 
  /** 
   * Publishes the specified event to all registered listeners that 
   * {@link Subscribe} to any of the {@link AmbariEvent} instances. 
   * 
   * @param event 
   */ 
  public void publish(AmbariEvent event) {
    m_eventBus.post(event);
  } 
 
  /** 
   * Register a listener to receive events. The listener should use the 
Experience pair programming with AI  Get Codota for Java