General J2EE: Daily Utility Tasks
I haven't done a whole lot of J2EE programming lately, but what is the "best practice" for running some business logic on a period basis? Something that would typically be run by a cron job.
I need to run a big chunk of code to kick info out to the accounting system at the end of each day. Any suggestions for how and where to handle this?
From my exp, there are many cron-like packages for Java that you could try to use. I've used one before and it very simple to use if you are familar with the crontab entry syntax
I did a quick google and found this
One way of doing this would be to use a J2EE scheduler like quartz
. I have used quartz which comes as an Open Source Software from OpenSymphony. It is pretty simple to set up. You could use "cron like expression" to configure the schedule.
Since you are talking about J2EE, I would suggest you use Timer Service: