Java Component Scheduling
- From: "killerCoder" <fahdshariff@xxxxxxxxx>
- Date: 27 Feb 2006 03:49:02 -0800
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.
.
- Follow-Ups:
- Re: Java Component Scheduling
- From: Rhino
- Re: Java Component Scheduling
- Prev by Date: Re: Please help: Exception in thread "Thread-3" java.lang.NullPointerException
- Next by Date: Re: Not sure why runs but does not display I think my thread
- Previous by thread: Automate authentication of a web-site through HTTPUrlConnection
- Next by thread: Re: Java Component Scheduling
- Index(es):