title: Spring Event Handling for prototype components
body: <p>Let say I have two components X and Y, where X is singleton and Y is not.</p>
  
  <p>when I publish XUpdateEvent, there is no problem, I can catch the event. However, for YUpdateEvent's I cannot catch events. Spring creates new instances for each fired event, not using the already created ones. </p>
  
  <p>So, Should I need to write a custom scope? or EventListener has settings?</p>
  
  <p>To illustrate:</p>
  
  <pre><code>@Component
  public class X{
   @EventListener
   public void onUpdate(XUpdateEvent event){
   // fine.
   }
  }
  
  @Component
  @Scope("prototype")
  public class Y{
   @EventListener
   public void onUpdate(YUpdateEvent event){
   // calls new instance of Y for each event.
   // Event should be fired for created instances.
   }
  }
  </code></pre>