• Post Reply Bookmark Topic Watch Topic
  • New Topic

retrieving the TimerTask from a Timer  RSS feed

 
Johnny Gara
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • 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...
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!