Package org.puremvc.java.multicore.patterns.observer

Examples of org.puremvc.java.multicore.patterns.observer.Observer


   * @param command
   *            an instance of <code>ICommand</code>
   */
  public void registerCommand(String notificationName, ICommand command) {
    if (null != this.commandMap.put(notificationName, command)) return;
    this.view.registerObserver(notificationName, new Observer(new IFunction() {
      public void onNotification(INotification notification) {
        executeCommand(notification);
      }
    }, this ) );
  }
View Full Code Here


    List<IObserver> observers = observerMap.get(notificationName);

    if (observers != null) {
      // find the observer for the notifyContext
      for(int i=0;i<observers.size();i++) {
        Observer observer = (Observer) observers.get(i);
        if (observer.compareNotifyContext(notifyContext) == true) {
          observers.remove(observer);
        }
      }
      // Also, when a Notification's Observer list length falls to
      // zero, delete the notification key from the observer map
View Full Code Here

            mediator.handleNotification(notification);
          }
        };

        // Create Observer
        Observer observer = new Observer(function, mediator);

        // Register Mediator as Observer for its list of Notification
        // interests
        for (int i = 0; i < noteInterests.length; i++) {
          registerObserver(noteInterests[i], observer);
View Full Code Here

TOP

Related Classes of org.puremvc.java.multicore.patterns.observer.Observer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.