Joanne Neal wrote:
David S Hansen wrote:how do I learn about Timer and Timer Task to make my program.
You google 'java timer tutorial'
Junilu Lacar wrote:Of the three options you cited, I have only worked with Quartz, so take this with a grain of salt. cron4j seems to fit the bill for minimalism so you might want to start with that and work your way up to Quartz and/or Obsidian as your scheduling needs expand and get more sophisticated. From what I've seen with a cursory exploration of their website, Obsidian offers many features that make it easier to set up, manage, and monitor your jobs. Quartz is probably the more commonly used of the three and there are many references and tutorials on using it but there is still a bit of a learning curve involved, based on my experience.
Hope this helps
David S Hansen wrote:Yes, cron4j seems to fit my description. But, there is hardly any documentation, tutorial, or presence on forums like CodeRanch, StackOverflow, ExpertsExchange. So, I will have almost no help for cron4j.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
David S Hansen wrote:Yes, cron4j seems to fit my description. But, there is hardly any documentation, tutorial, or presence on forums like CodeRanch, StackOverflow, ExpertsExchange. So, I will have almost no help for cron4j.
I'm not so sure about that. The name would suggest that cron4j is a Java port of the Unix cron command (which, IMO, is a classic piece of minimalist software); and there is plenty of documentation about that around. As an old Unix SA, it would certainly be my first port of call if simplicity was my main concern.
My only question would be: what does it run? Unix cron is designed for running system commands/scripts, so I'm guessing that there's probably some sort of translation between a "name" in your 'crontab' (== config file) and a Java Runnable; but exactly what that is I don't know.
Winston
PS: I've just had a quick look at the documentation, and it seems perfectly reasonable; and very straightforward. Everything is based around a Task class which you extend. The API docs are a little weak, but there seems to be more than enough to get started in the main docs.
David S Hansen wrote:However, it is possible that cron4j is so simple and intuitive that people don't really need to ask questions and Quartz is super complicated.
My problem is that I have no way to be sure if the above line is true. If not, then cron4j might be a bad choice for a beginner.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Junilu Lacar wrote:David, can you be more specific about the details of the job(s) are you trying to schedule? I'm starting to think that we could go into a fairly long discussion about the pros and cons of each of these frameworks. If we had a better idea of what the exact problem was, it would help limit the scope of the discussion and get to a decision quicker.
David S Hansen wrote:I want to perform simple tasks (eg. download file, upload, etc) at particular times in a day, everyday. I want to have the power to change these times depending on my needs on a particular day. I need a scheduler for this purpose.
Is this information enough answer the question?
Junilu Lacar wrote:
David S Hansen wrote:I want to perform simple tasks (eg. download file, upload, etc) at particular times in a day, everyday. I want to have the power to change these times depending on my needs on a particular day. I need a scheduler for this purpose.
Is this information enough answer the question?
Then I'd say that scheduling is not the big problem here. If this was my project, I'd probably just use the Spring Framework's TaskScheduler and a CronTrigger. However, of the choices you have narrowed it down to, I would probably go with cron4j because it seems to be the simplest and most straightforward of the three.
David S Hansen wrote:
If that is true, then quartz is my choice. Obsidian sounded much better because it talked about doing away with xml config and such. But, its too new, unproven and has "0" support on public forums.
The City calls upon her steadfast protectors. Now for a tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
|