Re: Servlet needs to run till the lifetime of Webserver
Create a servlet which implements the Runnable interface. In this servlet's init() method create and start a Thread which does whatever processing you need. To load it when the servlet container starts, add something like this to web.xml: myServlet com.foo.MyServlet 1 -Steve Ganesh MohanRao wrote: > Hi, > > Please tell me how to make a Servlet Run till the lifetime of Webserver. > > Whenever the webserver starts, Servlet needs to start and should run till > the Webserver shuts down. > > Please help me. > > Thanx. > > Ganesh > > === > 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
Re: Servlet needs to run till the lifetime of Webserver
We are trying to do something similar to Stock and News alert in "my.yahoo.com". Stock messages are broadcasted in Tibco. Tibco is a Messaging Component which is used to broadcast messages. There needs to be a Engine or Daemon "UP and Running" always to make sure that it checks the user alert settings as well as listening the the messages broadcasted from the Tibco. Whenever user makes any change in the Alert settings, the Engine needs to get updated. Once the criteria is met, Engine needs to alert the user by sending e-mail. This is what the requirement is. I know I have not clearly explained the scenario. What I thought is if there is any change in alert info or a new alert info has been set by the user, it needs to call a servlet which in turn update the alert informaion to the Engine or Daemon which we thinking of a java program. Please suggest me regarding this. -Original Message- From: Rob van Oostrum [mailto:[EMAIL PROTECTED]] Sent: 28 March, 2001 9:06 AM To: [EMAIL PROTECTED] Subject: Re: Servlet needs to run till the lifetime of Webserver what do you mean by "run"? By definition, a servlet works in a request/response kind of way. If you have code that you want to run in a servlet, and you want the code to run continuously, I'd say you generate a request to the servlet at server startup, and write the servlet code so that it never completes the request. Of course, you'd have to config the server so that it doesn't timeout the request, which gets you into trouble in cases where you do want other requests to time out. Please give more insight in what it is that you're trying to do with this, so that maybe I can give more to the point advice good luck Rob Ganesh MohanRao wrote: > Hi, > > Please tell me how to make a Servlet Run till the lifetime of Webserver. > > Whenever the webserver starts, Servlet needs to start and should run till > the Webserver shuts down. > > Please help me. > > Thanx. > > Ganesh > > === > 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 === 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
Re: Servlet needs to run till the lifetime of Webserver
Why does it need to be a servlet, why not just create a separate thread to run while the webserver is running? Joseph Karau Kingland Systems [EMAIL PROTECTED] 507-536-3629 AIM: jkara3629 -Original Message- From: Ganesh MohanRao [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 8:49 AM To: [EMAIL PROTECTED] Subject: Servlet needs to run till the lifetime of Webserver Hi, Please tell me how to make a Servlet Run till the lifetime of Webserver. Whenever the webserver starts, Servlet needs to start and should run till the Webserver shuts down. Please help me. Thanx. Ganesh === 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
Re: Servlet needs to run till the lifetime of Webserver
what do you mean by "run"? By definition, a servlet works in a request/response kind of way. If you have code that you want to run in a servlet, and you want the code to run continuously, I'd say you generate a request to the servlet at server startup, and write the servlet code so that it never completes the request. Of course, you'd have to config the server so that it doesn't timeout the request, which gets you into trouble in cases where you do want other requests to time out. Please give more insight in what it is that you're trying to do with this, so that maybe I can give more to the point advice good luck Rob Ganesh MohanRao wrote: > Hi, > > Please tell me how to make a Servlet Run till the lifetime of Webserver. > > Whenever the webserver starts, Servlet needs to start and should run till > the Webserver shuts down. > > Please help me. > > Thanx. > > Ganesh > > === > 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
Servlet needs to run till the lifetime of Webserver
Hi, Please tell me how to make a Servlet Run till the lifetime of Webserver. Whenever the webserver starts, Servlet needs to start and should run till the Webserver shuts down. Please help me. Thanx. Ganesh === 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