title: How to dispose/clean MessageListener bean programmatically
body: <p>I am using Spring3.1(standalone env)</p>
  
  <p>I have created MDB by implements MessageListener which connected to a topic via templates.</p>
  
  <p>this bean scope is singleton.</p>
  
  <p>Sometimes I want to dispose that Listener Bean. when I say dispose I mean I want ioc to free that resource and clean this bean from the container.(which eventually will make this bean stop listening to messages and free un-used memory.)</p>
  
  <ol>
  <li><p>I need to retrieve this bean by it's id with getBean(..) method to execute it's disposal. I heard that using getBean(..) can cause memory leaks. how should I make it otherwise?</p></li>
  <li><p>Should I use singleton Scope or prototype one for this purpose?</p></li>
  </ol>