I've had success doing this using CRON jobs in Unix and also (not very OO I
know but) Perl scripts with a call to a system interface. The script below
does this every 2 minutes.
#!/usr/bin/perl
while (true) {
$status=system("cd
/vjv/vjvserver/servlets/;/usr/local/jdk1.2.2/bin/java htmlConverter");
sleep(120);
}
The reason for not doing this in Java was that these processes were
unrelated to the JSP process directly (they ran on another machine but
effected the database the JSP pages used).
Of course if you're using JSP, simply create a thread that goes into an
infinite loop, sleeps for 4 hours and then sends the e-mail.
Clayton
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Raghu Movva
Sent: 10 May 2001 09:15
To: [EMAIL PROTECTED]
Subject: any ideas on scheduling in java
Hi all,
I have a requirement to send emails after every 4 hours. Is there any
class in java for scheduling that task. I have used Timer and TimerTask
classes of java.util package. There we have to create the program running
all the time. Is there any way so that the thread will run in the
background and schedules the task.
Expecting a reply
Regards
Raghu
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets