This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Killing current TimerTask

 
Victor Subick
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there an elegant & easy way to kill a current(executing) TimerTask if a certain time has elapsed (Say 2 minutes). This situation can occur if my TimerTask is blocked on IO.
My code implements a TimeMonitor class and listener interface. Based on code from JavaWorld tips 125. http://www.javaworld.com/javaworld/javatips/jw-javatip125.html
I am trying to stop the current executing TimerTask thread if a certain time has elapsed.
Here is the code.
TimeMonitorListener.java

TimeMonitor.java

Calling class with main method: Test.java



[ August 07, 2003: Message edited by: Victor Subick ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic