Wow! After reading all of that long thread I got the SDN Editorial Team newsletter in my inbox. It talks about "REVISITING TIMERS WITH ENTERPRISE BEANS". The link they give is https://bpcatalog.dev.java.net/nonav/enterprise/timerservice/. This should at least give some idea of how to do it J2EE style. I'm not sure if this will work in Tomcat, but I suspect that it will.

Daniel

----- Original Message ----- From: "Dwayne Ghant" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, December 21, 2004 9:24 PM
Subject: Re: How to run servlet for every 30 minutes in Tomcat 4.1.30



The alarm is configured as any other servlet, with the addition of the run-at tag. The following configuration runs the servlet every 15 minutes. If the hour is missing, e.g. :15 the service is run at the specified minute.
15 minute configuration



<servlet name='alarm' servlet-class='test.TestAlarm'> <run-at>:00, :15, :30, :45</run-at> </servlet>

Allistair Crossley wrote:

+1. you aren't being clear .... the only reason I can think you have an application wishing to talk to a servlet is that you are then going on to request info from the servlet from a remote machine across the net?? .. in that case and most others you should have your application polling the servlet itself in a thread. you'll need to explain your scenario if this is inaccurate, i.e if the Java App is in fact also a web app.

JAVA APPLICATION || TOMCAT + SERVLET || INTERNET || REMOTE MACHINE

    ----- POLL 30s ----->
                         ------------REQUEST INFO -------->
                         <----------- RESPONSE ------------
    <------ RESPONSE ----



-----Original Message-----
From: Wade Chandler [mailto:[EMAIL PROTECTED]
Sent: 21 December 2004 16:03
To: Tomcat Users List
Subject: Re: How to run servlet for every 30 minutes in Tomcat 4.1.30


Shilpa Nalgonda wrote:

Hi,
I am using Tomcat4.1.30 version.
I have to develop a client application which looks in the
database every 30

minutes,
to retrieve the status of an order and send the status to
the remote client.

Again waits for the
The client's response and insert the repsonse back to the database.

I wanted to do this in a servlet, so is there any way that
i could run this

servlet automatically inside the
Tomcat container, or is it configurable in servlet mapping?
if so can

someone please suggest me with examples...




---------------------------------------------------------------------

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Well....it's kind of not extremely clear what you are asking, but why does the servlet need to do anything except listen for a client which is threaded to do this every 30 minutes, in other words...why not have the servlet do what it naturally does...sit there and get hit by client requests....get the info....and send it back? I mean...the servlet can't push to the client unless you want to use something besides http, or unless you are using servlets on both ends and http servers on both ends. You could use keep alives I guess.....I wouldn't though....only so many tcp/ip connections.

Wade


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> -------------------------------------------------------
QAS Ltd.
Developers of QuickAddress Software
<a href="http://www.qas.com";>www.qas.com</a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--

Dwayne A. Ghant
Application Developer
Temple University
215.204.5555
[EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to