Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / February 2006

Tip: Looking for answers? Try searching our database.

Java Component Scheduling

Thread view: 
killerCoder - 27 Feb 2006 11:49 GMT
In my system I have a java component which I want to activate only
within a certain time window.

It is a distributed system consisting of a jobproducer which hands out
tasks to the workers. Each worker runs on a different host. I want a
worker to start up and process jobs only if the time is right.

I am currently thinking along the following lines:
- pass in a time-window argument to the worker program e.g. 1900-0600
(7pm to 6am)
- if the current time is valid, it registers with the job producer and
starts receiving/processing jobs
- if the current time is not valid, it sleeps for a bit and tries
again.
- after completing a job, it checks whether it can take on another job
at the current time. If it can't it sleeps.

I don't really like the idea of the sleeps. I also don't want the
producer to be burdened with the task of activating workers at certain
times. Is there a better way?

Does anyone have any experience of doing something like this? Any help
would be appreciated.
Rhino - 27 Feb 2006 13:28 GMT
> In my system I have a java component which I want to activate only
> within a certain time window.
[quoted text clipped - 19 lines]
> Does anyone have any experience of doing something like this? Any help
> would be appreciated.

Have you given any thought to using cron to handle the scheduling? That's
how these things are usually done in the Unix world. There are versions of
cron that work on Windows too if you're worried about compatibility, plus
there is a scheduler in some versions of Windows.

--
Rhino


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.