Solved

Scheduling tasks with Cron for Java

Posted on 2010-09-06
2
412 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

680 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