abbot.util
Class NamedTimer

java.lang.Object
  extended byjava.util.Timer
      extended byabbot.util.NamedTimer

public class NamedTimer
extends Timer

Prevents misbehaving TimerTasks from canceling the timer thread by throwing exceptions and/or errors. Also extends the basic Timer to use a name for its thread. Naming the timer thread facilitates discerning different threads in a full stack dump.


Constructor Summary
NamedTimer(String name)
          Creates a non-daemon named timer.
NamedTimer(String name, boolean isDaemon)
          Creates a named timer, optionally running as a daemon thread.
 
Method Summary
protected  void handleException(Throwable thrown)
          Handle an exception thrown by a TimerTask.
 void schedule(TimerTask task, Date time)
           
 void schedule(TimerTask task, Date firstTime, long period)
           
 void schedule(TimerTask task, long delay)
           
 void schedule(TimerTask task, long delay, long period)
           
 void scheduleAtFixedRate(TimerTask task, Date firstTime, long period)
           
 void scheduleAtFixedRate(TimerTask task, long delay, long period)
           
 
Methods inherited from class java.util.Timer
cancel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedTimer

public NamedTimer(String name)
Creates a non-daemon named timer.


NamedTimer

public NamedTimer(String name,
                  boolean isDaemon)
Creates a named timer, optionally running as a daemon thread.

Method Detail

handleException

protected void handleException(Throwable thrown)
Handle an exception thrown by a TimerTask. The default does nothing.


schedule

public void schedule(TimerTask task,
                     Date time)

schedule

public void schedule(TimerTask task,
                     Date firstTime,
                     long period)

schedule

public void schedule(TimerTask task,
                     long delay)

schedule

public void schedule(TimerTask task,
                     long delay,
                     long period)

scheduleAtFixedRate

public void scheduleAtFixedRate(TimerTask task,
                                Date firstTime,
                                long period)

scheduleAtFixedRate

public void scheduleAtFixedRate(TimerTask task,
                                long delay,
                                long period)


Copyright © 2002-2004 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge