Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Registering Listeners

A view can register to listen for view events an event Listener from other views by view name, or by view name + version. When an event Event is fired from the source view, all registered listeners will receive the event.

Info

Typically, a view implementation will register event listeners using during the onDeploy() framework event (via a <view-class>this.is.my.view-clazz</view-class> on onDeploy().

 

...

.

...

Firing and Receiving Events
  1. Create an event.
    http://github.com/apache/ambari/blob/trunk/ambari-views/src/main/java/org/apache/ambari/view/events/Event.java

  2. Fire the event.
    controllerviewContext.getViewController().fireEvent(event)
Receiving Events
  1. ;

  2. The framework will notify all registered listeners. The listener implementation can process the event as appropriate.
    listener.notify(event)

...

 

...