Discussions

General J2EE: Daily Utility Tasks

  1. Daily Utility Tasks (3 messages)

    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?

    Thank you.

    Threaded Messages (3)

  2. java cron package[ Go to top ]

    Hi Rob,

    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
    http://jcrontab.sourceforge.net/index.shtml

    HTH,
    Thomas
  3. Daily Utility Tasks[ Go to top ]

    One way of doing this would be to use a J2EE scheduler like quartz
     or Flux
     . 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.

    Regards,
    Ashish Jamthe
    TRL, Telstra
  4. Daily Utility Tasks[ Go to top ]

    Since you are talking about J2EE, I would suggest you use Timer Service:

    http://www.onjava.com/pub/a/onjava/2004/10/13/j2ee-timers.html