View Javadoc

1   /**
2    * 
3    */
4   package org.votech.ds6.widgets;
5   
6   import java.util.Map;
7   
8   import org.votech.plastic.managers.PlasticApplication;
9   
10  /**
11   * A MessageSource that has some of the optional stuff ready done - it does nothing with a single 
12   * return value (can override this if you want), and repeatedly calls {@link #processReturnValue(PlasticApplication, Object)}
13   * in the case of multiple return values from a broadcast.
14   * @author jdt
15   *
16   */
17  public abstract class AbstractMessageSource implements MessageSource {
18  
19  
20  
21      /* (non-Javadoc)
22       * @see org.votech.ds6.paf.MessageSource#processReturnValue(java.lang.Object)
23       */
24      public void processReturnValue(PlasticApplication sender, Object result) {
25          // override me
26      }
27  
28      /* (non-Javadoc)
29       * @see org.votech.ds6.paf.MessageSource#processReturnValues(java.util.Map)
30       */
31      public void processReturnValues(Map<PlasticApplication, Object> results) {
32          for (PlasticApplication sender : results.keySet()) {
33              processReturnValue(sender, results.get(sender));
34          }
35  
36      }
37  
38  }