Solved

Scheduling tasks with Cron for Java

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now