aspose file tools*
The moose likes Struts and the fly likes Scheduler. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Scheduler." Watch "Scheduler." New topic
Author

Scheduler.

Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 212
Hi Merrill and Other Ranchers Around ,

Merrill , Thanks for your suggestions and because of that things are moving pretty quite smoothly. Also the DTD which you had provided for the struts-config was really easy to learn. I dont know whether my question really fits in Struts or Any Web Architecture but still wanted help on this.

This time the project requirements demand that we make a Scheduler which automatically performs some operations for example sending an email to the customer after the order has been fulfilled. I know this is easily achievable using Windows Scheduled Tasks. But the requirement specification is that they want a Shell Script doing this. Also for this Unix Cron Jobs are useful. just wanted to know how or what command shall we write in that shell script which would call our java Program which fires the Mail. P.S : We are using JavaMail API for this.

Please help me with this.

Thanks in Advance and regards ,

Yogendra Joshi.


Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
Vani Bandargal
Ranch Hand

Joined: Oct 06, 2005
Posts: 82
This may not fit your requirement but still sharing with all ranch people. we also needed to do few things on daily basis (may ne during night time) without any user interaction like a scheduler task.

We have decided to use Apache's "quartz" for this purpose.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
If you're using a J2EE Version 1.4 compliant application server, you could use the timer service defined in the specification. Essentially this involves writing a stateless session EJB and registering one of its methods with the timer service to fire at given times or intervals.

This article explains how to do it.

If you'd still rather go with a Cron job, it's just a matter of writing a shell scipt that calls:

java -cp xyz.jar;abc.jar MyClass


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scheduler.
 
Similar Threads
nesting of tags in struts?
How return a string from java program to the shell which invokes thee java command
form/input tags and turning off autocomplete
Running Dependent Jobs in Unix
To call a javascript function using shell script