Re: Scheduled task in tomcat - how?
Hi, --- Ursprüngliche Nachricht --- Von: Michael Mehrle [EMAIL PROTECTED] An: Tomcat Users List tomcat-user@jakarta.apache.org Betreff: Scheduled task in tomcat - how? Datum: Tue, 17 May 2005 19:16:10 -0700 I need to create an automated task in tomcat that gets launched every two hours or so, does its work and then sleeps again. Have a look at quartz (http://www.opensymphony.com/quartz). 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)? See above and look for the quartz initializer servlet then code up your org.quartz.Job, describe it in jobs.xml and put in a CronTrigger for it. regards Dirk -- 5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail +++ GMX - die erste Adresse für Mail, Message, More +++ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Scheduled task in tomcat - how?
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]
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]
Re: Scheduled task in tomcat - how? 2
I was just thinking this: IF there would be another tomcat instance running, on a different port, then this one could issue the request and when called back the default servlet would pick up the response. Of course that's not what I'd like to do - wasting resources on a separate tomcat instance would be my very last resort... Michael - Original Message - From: Michael Mehrle [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Tuesday, May 17, 2005 3:32 PM 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]
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]