title: Java. Correct pattern for implementing listeners
body: <p>Very typically I have a situation where a given object will need to have many listeners.  For instance, I might have</p>
  
  <pre><code>class Elephant {
    public void addListener( ElephantListener listener ) { ... }
  }
  </code></pre>
  
  <p>but I'll have many such situations.  That is, I'll also have a <code>Tiger</code> object that'll have <code>TigerListener</code>s.  Now, <code>TigerListener</code>s and <code>ElephantListener</code>s are quite different:</p>
  
  <pre><code>interface TigerListener {
    void listenForGrowl( Growl qrowl );
    void listenForMeow( Meow meow );
  }
  </code></pre>
  
  <p>while</p>
  
  <pre><code>interface ElephantListener {
    void listenForStomp( String location, double intensity );
  }
  </code></pre>
  
  <p>I find that I always have to keep re-implementing the broadcasting mechanism in each animal class, and the implementation is always the same.  Is there a preferred pattern?</p>