Solved

Scheduling tasks with Cron for Java

Posted on 2010-09-06
2
413 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

This is about my first experience with programming Arduino.
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 video teaches viewers about errors in exception handling.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

732 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