You should check into using Quartz as a job scheduler. Spring integrates
with it and it could be better than having a thread going at all times
(unless that is what you need). Either way I think a ContextLoaderListener
is a good place to launch it.
kw
--------------------------------------------------
From: "J. Talafous" <
jtalafous@...>
Sent: Monday, April 13, 2009 6:42 PM
To: <
ajug-members@...>
Subject: [ajug-members] starting threads from web container
> I want to have a background thread that is crunching data in the
> background of my web app.
>
> I am aware of <load-on-startup/> in the deployment descriptor of a web
> app. I could start the thread in one of these servlets that load on
> startup. But this doesn't seem proper... the servlet will handle
> requests when I know that there will never be any. It is extra
> overhead that goes to waste.
>
> It seems that there would be hooks some where in the web container
> that I could use to create POJOs and they could in turn start the
> thread. Are there any, especially specified in web.xml?
>
> _______________________________________________
> ajug-members mailing list
>
ajug-members@...
>
http://www.ajug.org/mailman/listinfo/ajug-members
_______________________________________________
ajug-members mailing list
ajug-members@...
http://www.ajug.org/mailman/listinfo/ajug-members