title: Scheduler service in Wildfly 9
body: <p>My application is running on JBoss 4.2.3 in a clustered environment. There is a scheduler service which pulls data from the database in every 10 sec. We achieved this by placing **-service.xml in deployments folder and by implementing "org.jboss.system.ServiceMBean" interface in JBoss 4.2.3.</p>
  
  <p>Now, i am upgrading jboss to Wildfly 9. As we cannot achieve scheduler service in wildfly with the existing mechanism(wildfly doesn't support org.jboss.varia.scheduler.SingleScheduleProvider), i am looking at alternatives EJB TimerService &amp; ManagedScheduledExecutorService. Our requirement is to run the scheduled service only in one node of the cluster which we achieved in jboss 4 using HASingletonDeployer.</p>
  
  <p>My qns:</p>
  
  <ol>
  <li><p>Which is better - EJB TimerService or
  ManagedScheduledExecutorService? My Scheduler task should invoke
  only if the previous task is finished i.e. i don't need concurrent
  tasks.</p></li>
  <li><p>How can we achieve that the scheduled task/method run only on one
      node in a cluster?</p></li>
  </ol>
  
  <p>Please suggest. Thanks in advance.</p>