• Post Reply Bookmark Topic Watch Topic
  • New Topic

Responsive but polling timer?  RSS feed

 
merlin bar
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application that needs to call a method at 22:30.
How can I poll for this and still have a responsive app that doesn't lock the user out?
Any info is appreciated.
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.util.Timer might work, although there's one thing I'm not sure about:

This class does not offer real-time guarantees: it schedules tasks using the Object.wait(long) method.

I've never invoked Object.wait() with a few hours worth of milliseonds, so I'm not sure how accurate it would be.
There are also rebust job scheduling libraries available. One open source option is quartz
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Removed: please do not resurrect older posts, and please do not repeat the same question more than once.]
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RaviNada Kiran wrote:[Removed: please do not resurrect older posts, and please do not repeat the same question more than once.]



It was a mistake , i thought of posting a new topic , but instead of clicked on reply on to it
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!