M
MattC
My application uses 2 Servlets - ServletMain and ServletPoll.
ServletMain is the main Servlet for my MVC application. ServletPoll is
responsible for polling for data files. The idea is that every 10
minutes ServletPoll will "wake up" and check to see if there are any
new data input files to process. If there is it will process these
files and then go back to sleep for 10 minutes and start the cycle all
over again.
The problem I have is that I do not no how to start the method in
ServletPoll that will loop forever checking for data input files.
I have set up the web.xml file so that ServletMain and ServletPoll get
loaded when the web app is deployed. Now the question is how can I
invoke the method to start the polling. This needs to begin as soon as
the web app is deployed.
Is it possible to invoke ServletPoll's polling method from the init()
method of ServletMain?
ServletMain is the main Servlet for my MVC application. ServletPoll is
responsible for polling for data files. The idea is that every 10
minutes ServletPoll will "wake up" and check to see if there are any
new data input files to process. If there is it will process these
files and then go back to sleep for 10 minutes and start the cycle all
over again.
The problem I have is that I do not no how to start the method in
ServletPoll that will loop forever checking for data input files.
I have set up the web.xml file so that ServletMain and ServletPoll get
loaded when the web app is deployed. Now the question is how can I
invoke the method to start the polling. This needs to begin as soon as
the web app is deployed.
Is it possible to invoke ServletPoll's polling method from the init()
method of ServletMain?