• 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

retrieving the TimerTask from a Timer

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any way to retrieve a TimerTask from an already running timer? I'm trying to simply update the timertask with information without killing when the next scheduled execute is suppose to take place.

Timer doesn't really leave me with much here...
 
Marshal
Posts: 28260
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's no such thing as "the" TimerTask for a Timer. A Timer can have many TimerTasks.

Anyway, what's wrong with just keeping a reference to the TimerTask if you want to modify its state?
 
Johnny Gara
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the suggestion!

Right now, there simply isn't a reference available. The timertask is created in a seperate code block and one that i don't really have access to, all I really have is the timer. I could request for a reference to be made available though...was just hoping there'd be a simple (non-intrusive way I guess ) way to do this.
 
Paul Clapham
Marshal
Posts: 28260
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Keeping a reference to something you might want to change in the future IS the simple and non-intrusive way to do things.
 
reply
    Bookmark Topic Watch Topic
  • New Topic