aspose file tools*
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
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: 18717
    
  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)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How i can ensure that a timer (java.util.Timer) is canceld ?