• Post Reply Bookmark Topic Watch Topic
  • New Topic

Track a task through Timer Class  RSS feed

 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Let me explain you the problem and then the resolutions I found so far.

My Business need is to track a database status from a table, for that I have alerady a seperate method. Now I have to check the status after every 30 seconds. Now if anywhere in this interval if status got changed accourding to our needs then I have to break this cycle and start continuing the other work or you can say we can stop our working here and can show the user that the status is "XYZ"(Just an example)

Now so far I have made a TimerTask class which I will schedule with Timer class. Let me show you my code:




Everything in above code is very much clear except DatabaseDAO. As I already mentioned that this is different service to get the status from Database. I want to stop the procedure once I get 10 as status. And accordingly show a msg to the user.

I hope I presented my problem very clearly. But still if there is any kind fo confusion, then do let me know.

I would appreciate if someone can show the modified code.
[ October 01, 2007: Message edited by: Ankur Sharma ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!