Home arrow static arrow Java Programming [Archive] - How to get tasks from Timer?
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - How to get tasks from Timer?
This topic has 4 replies on 1 page.

Posts:3,369
Registered: 24.10.97
How to get tasks from Timer?  
Aug 3, 2004 3:19 AM



 
Is there a way to get the scheduled tasks from a java.util.Timer object?
 

Posts:470
Registered: 6/11/02
Re: How to get tasks from Timer?  
Aug 3, 2004 4:19 AM (reply 1 of 4)



 
AFAIK no... why do you want to do this? (maybe there is a way to achieve your goal)
 

Posts:3,369
Registered: 24.10.97
Re: How to get tasks from Timer?  
Aug 3, 2004 5:06 AM (reply 2 of 4)



 
Well, in my case, i have a JTable of changing number of rows. each of them has a Timer attached. If (processing of) one row finsihed, the timer should stop. As i remember the Timer objects for each row, i can easily get the Timer object to call cancel(). After cancel, I would like to get the task object for this Timer to get a specific value this task computet. Of course, i could write a work around to stor the task objects also locally in addition to the Timer objects. (I need the Timer objects to call cancel() and the Task objects to get final values). But as the Timer object already has an internal queue of the Task obejcts, i hoped to get access for these ...
 

Posts:19,725
Registered: 9/26/01
Re: How to get tasks from Timer?  
Aug 3, 2004 5:28 AM (reply 3 of 4)



 
Clearly from the API there is no access to the timer's list of tasks. I could agree that it looks like there should be a way provided - a deficiency in the API.
 

Posts:470
Registered: 6/11/02
Re: How to get tasks from Timer?  
Aug 3, 2004 5:31 AM (reply 4 of 4)



 
I guess you'll have to store a list of your timertasks somewhere, or give them a reference to an Object where they need to store the value they calculated.
 
This topic has 4 replies on 1 page.