With the information provided one solution is to start a thread which sleeps say 5s before invoking the methods again, e.g.:
// init (e.g. with servlet init())
Runner r = new Runner();
Thread t = new Thread(r);
t.start();
// and later (e.g. with servlet destroy())
r.stopRunning();
t.interrupt();
t.join();
And your Runner you just need to update a little so that you can run it inside a thread.
public class Runner implements Runnable
{
List values;
boolean running = true;
public void run()
{
while (running)
{
changeSomeDataA();
changeSomeDataB();
changeSomeDataC();
try {
Thread.sleep(5000);
} catch(InterruptedException e) {
// we do not really need to react here, do we?
}
}
}
}
Note that you need to store the reference to the Runner and the Thread in an object (like your Servlet instance) which is not accidentally garbage collected. Of course please package nicely.