• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cron Job

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good Day Experts,

We have EJB JSF application. I need to create a scheduler like a cron job, where the application will generate a report based on what customer defined(saved in database). For example, customer define to generate a report every 3pm. Or a customer can define to generate a report for them every Friday 7am.

Any idea on How can I implent this? given that we use EJB JSF running in JBOSS 7.

Regards
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
There are several options to do this. The simplest option will be to write a standalone java program that keeps running 24/7. This will check and if time matches will generate the report.
You can also use schedulers like Quartz to do this.

You can use EJB timers too, but that will be complex and probably overkill for this...
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to use EJB timers you need to have your application running(EJB requires a container available in App server). The other option would be(In case if you dont have any EJB calls in between)
1) you could use Quartz as Ranganathan mentioned in the post.
2)Have a standalone file using JDK timers which will triggers at a particular time
3)In case of unix machine, configure a cronjob calling a shell script file and this file would have the java call (java FetchReport).

 
reply
    Bookmark Topic Watch Topic
  • New Topic