title: Run TimerTask on start Application Server
body: <p>I have a Timer class to response of SMS continuously. </p>
  
  <pre><code>public class MyRegularTask extends TimerTask {
      public void run() {
          Thread.sleep(1000);
          answerLeftSMS();
          // this.cancel(); I do not cancel this Timer
      }
  }
  </code></pre>
  
  <p>Currently I am running it by a action call. </p>
  
  <pre><code>Timer time = new Timer();
  MyRegularTask taskTimer = new MyRegularTask();
  time.schedule(taskTimer, 0, 60000);
  </code></pre>
  
  <p>Is there any way to run this timer automatically, when I start Application Server (Tomcat, Glassfish) ? I am using Spring MVC (Annotation).</p>