Re: Need to create a new thread for async operations

2011-01-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Cid, On 1/9/2011 11:27 AM, Captain Cid wrote: I am having a CXF webservice impl class. In this I want to start a new thread in service impl constructor. This is because I need to run a thread will continuously do some operation in background using

Need to create a new thread for async operations

2011-01-09 Thread Captain Cid
I am having a CXF webservice impl class. In this I want to start a new thread in service impl constructor. This is because I need to run a thread will continuously do some operation in background using database. And I need to be able to stop it when tomcat is shutdown. I was searching net. Found

Re: Need to create a new thread for async operations

2011-01-09 Thread Michael Ludwig
Captain Cid schrieb am 09.01.2011 um 08:27 (-0800): I want to start a new thread in service impl constructor. That's not necessarily the best place. This is because I need to run a thread will continuously do some operation in background using database. And I need to be able to stop it when

Re: Need to create a new thread for async operations

2011-01-09 Thread Captain Cid
I have moved the thread creation to constructor of a class which is instantiated by spring. Can you elaborate how to spawn thread in it using javax.servlet.ServletContextListener ? Captain Cid wrote: I am having a CXF webservice impl class. In this I want to start a new thread in service

Re: Need to create a new thread for async operations

2011-01-09 Thread Juha Laiho
On 01/09/2011 09:30 PM, Captain Cid wrote: I have moved the thread creation to constructor of a class which is instantiated by spring. Can you elaborate how to spawn thread in it using javax.servlet.ServletContextListener ? As for ServlerContextListener, please have a look:

Re: Need to create a new thread for async operations

2011-01-09 Thread Captain Cid
Thanks a lot. I was not aware of how to use servletcontextlistener. - in contextinitialized I am creating my thread and stopping it in contextdestroyed. - I needed a spring bean for thread initialization, which I got in contextinitialized function. Juha Laiho wrote: On 01/09/2011 09:30 PM,