title: How to start a thread inside spring container
body: <p>Please help to resolve a problem. I have a thread like below the code.</p>
  
  <pre><code>public class A implements Runnable {
  
    public void run() {
       while(true) {
       //Do something something important
      }
    }
  </code></pre>
  
  <p>}</p>
  
  <p>I want to configure this thread in spring configuration file in such a manner, so that when spring container gets started, the thread start running. It means I have to start the thread using th.start() in a class, but that will never be used. The thread should start without instantiating any bean from the container. It is not Timer task type functionality.</p>