Solved

Scheduling tasks with Cron for Java

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Make the most of your online learning experience.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

696 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