• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Killing current TimerTask

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic