This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cron Job

 
Hisouka Devera
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • 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
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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...
 
balajik Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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).

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic