[quote user="ammoQ"]
Why not use somehing simple along the lines of
package xx.xxxx.periodic; public class xxxThread implements Runnable { // IMO implementing Runnable is more beautiful than extending Thread long intervall; private volatile finished = false; public void setFinished(finished) { this.finished = finished; } public xxxThread(long intervall) { this.intervall = intervall; } public void run() { while(!finished) { //DO STUFF try { sleep(intervall); } catch (InterruptedException ir) { //ignore } } //Cleanup } }
So the Servlet would call thread.setFinished(true). Plus you can use Thread.interrupt() for more meaningfull purposes, e.g. interrupt the sleep() to make the thread work again.
[/quote]
I think you should at least handle the exception and not just ignore it. All this does is hide an error condition.