1

There are two type of task in my JSF2.0 web.

  1. Invoke a third party java application only once at defined time
  2. Invoke and get the data from some third party application repeatedly in some specified interval let say 2min

AFAIK JSF supports Quartz Scheduler but we have TimerTask in JavaSE. Can somebody explain me which API I should use in both the above mentioned cases and how? Any example code? Thank you.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
ravi
  • 6,140
  • 18
  • 77
  • 154
  • 1
    I found two links that might help you, I hope they do. Here they are: http://stackoverflow.com/a/11820017/259889 and http://javapapers.com/core-java/java-timer/ – Sid Apr 07 '13 at 10:12
  • 1
    Quartz is not part of Java SE/EE. It's just a 3rd party framework. TimerTask is a very bad idea in Java EE. – BalusC Apr 07 '13 at 18:08
  • possible duplicate of [ApplicationScope bean that uses a TimerTask (sheduler), good or bad?](http://stackoverflow.com/questions/7499534/applicationscope-bean-that-uses-a-timertask-sheduler-good-or-bad) – BalusC Apr 07 '13 at 18:08
  • 1
    and related, for JSP/Servlet, but applies to JSF as good: http://stackoverflow.com/questions/15787605/how-to-run-a-background-job-method-at-fixed-intervals/15789574#15789574 – BalusC Apr 07 '13 at 18:08
  • @BalusC: Thanks ...I am looking into provided links.... thank you – ravi Apr 07 '13 at 18:15
  • @BalusC: One more question please. Can `ScheduledExecutorService` it fulfill point (1)? If yes how? – ravi Apr 07 '13 at 20:19

0 Answers0