Look at the Timer and TimerTask classes, for scheduling tasks.

-----Original Message-----
From: Michael Mehrle [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 17, 2005 7:16 PM
To: Tomcat Users List
Subject: Scheduled task in tomcat - how?

I need to create an automated task in tomcat that gets launched every
two
hours or so, does its work and then sleeps again. The task needs to send
some request values via a secure (https) POST to a cgi script running on
an
outside server, then receive the response, parse it and put it into the
database. The response doesn't return the values as request parameters,
but
instead simply returns records in CSV (comma separated values) format,
one
record per line.

So, here's what I'm pondering:
  a.. What's the best way to create that automated (scheduled) task and
run
it as a servlet under tomcat (5.5.9)?
  b.. You guys might laugh, but the last time I parsed CSV as part of
the
HTTP response was in my Perl days (looong ago) - is there some servlet
support for doing this, or do I need to code alll this stuff myself from
scratch?
  c.. Finally, what's the best approach to 'receiving' the response? The
servlet issueing the request is obviously the requester, but since this
is
running inside of tomcat, how do I route the response to that servlet?
Maybe
I'm overthinking this, but I'm not sure how a servlet can be the
recipient
of its own request. Hope this makes sense.
Any input on one or more of these questions would be appreciated.

Michael


---------------------------------------------------------------------
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