[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: create a utility to do background tasks in tomcat

Check out Timer and TimerTask from java.util package. 

Thanks and BR, 
--Kamesh Challa
Yash Technologies Inc.

Quoting Poorav Chaudhari <pooravc@yahoo.com>:

> I want to create a utilty to do some tasks in the background, every hour or
> so.
> This is part of my web application running on tomcat using struts
> framework.
> What would be a good way achieve this. is there any online resource that
> shows
> me how to implement this in tomcat. I am thinking maybe in my web.xml file
> i
> can start up a servlet that sleeps and wakes itself up on regular intervals
> of
> time. does tomcat start initialize the servlets using the same thread or
> does
> it spawn a different thread for each servlet initialized through web.xml.
> does
> my idea even hold any ground of implementing this or should i go some other
> route?
> Thanks for your input in advance.
> =====
> Poorav Chaudhari
> __________________________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo
> http://search.yahoo.com