Solved

Scheduling tasks with Cron for Java

Posted on 2010-09-06
2
410 Views
Last Modified: 2013-11-13
Hello,
I have a package that is a part of a much bigger application which is in a WAR file.

I would like to schedule JUST my package to be ran at a certain time.  I've looked into Cron ( http://code.google.com/appengine/docs/java/config/cron.html ) and tried configuring it using cron.xml but no luck.  

All i have is a bunch of classes and one of them has a main method and that method kicks off the rest of the logic.  How can i do this, assuming the web app is deployed?

Please help.

Thanks,
Alex
0
Comment
Question by:Squadless
2 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 450 total points
ID: 33613091
1) expose that package through a servlet
2) make a client program for that servlet
3) schedule that client program using any open source java scheduler
http://java-source.net/open-source/job-schedulers

or just check this
http://www.roseindia.net/java/example/java/util/CertainAndRepeatTime.shtml
0
 
LVL 10

Assisted Solution

by:Hegemon
Hegemon earned 50 total points
ID: 33613164
Use Quartz, it supports cron format, see CrontTrigger doc here: http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question