This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes eternal process Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "eternal process" Watch "eternal process" New topic
Author

eternal process

Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
I need to create an eternal process (thread?) that will run on the server and will scan a database to see if certain things should be done. this process should be in a pretty low priority.

any ideas/links about what I should do to implement this?


We must know, we will know. -- David Hilbert
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
You can use the Timer class in the library to run a task at scheduled times. Timer is a normal Java thread with a loop in the run() method and it can be set to never end. It would be nice to have a clean way to terminate it. Ctrl-C works, but a UI or a remote interface - eg a socket protocol - would be better.

I have no idea what your skills are. Does this sound fun or a bit daunting or like I'm not speaking English? Don't be afraid to ask for more detail. If you haven't used Timer before, try to make something that just says "Hello" every 20 seconds and see how it all works.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: eternal process
 
Similar Threads
XML or Web Services Would Have Better Prospects In The Future?
Does Man have free will?
which way
Eternal process
Plz discuss about spirituality