• 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

Track a task through Timer Class

 
Ranch Hand
Posts: 1252
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic