wood burning stoves 2.0*
The moose likes Java in General and the fly likes How i can ensure that a timer (java.util.Timer) is canceld ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How i can ensure that a timer (java.util.Timer) is canceld ?" Watch "How i can ensure that a timer (java.util.Timer) is canceld ?" New topic
Author

How i can ensure that a timer (java.util.Timer) is canceld ?

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Hi
Thank you for reading my post
How i can ensure that a Timer is canceled ?
When i try to cancel my timer it raise an Exception and say that it is already canceled and i find no method to show me the Timer State
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18538
    
  40

Are you sure? Both the Timer and TimerTask class allows you to call the cancel() method repeatedly. The subsequent calls are not supposed to have any affect.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How i can ensure that a timer (java.util.Timer) is canceld ?
 
Similar Threads
How to avoid IllegalStateExceotion in Timer
Timers
Closing Timer on program end
Timer IllegalStateException
How can i get my refund from prometric.com