How sure are you that you want to use Timer
? Use ExecutorService
instead, which has isShutdown
and has a slew of other benefits to boot. A general recommendation as of Java 5 has been to replace Timer
s with ExecutorService
s.
There's a ScheduledExecutorService
interface specifically for scheduled executor services. Instantiate using one of the Executors.new...
methods.