views:

29

answers:

2

I'm writing an application for a doctor which should be able to define Notifications that will show up in the patient's computer. These Notifications are scheduled by the doctor, so he/she can choose when it's going to show up. For example: "Remeber to take your pills", show once a week, from January to July 2010.

So it would be something like Google's Calendar's event scheduler, but with much richer timing conditions. I'm wondering what's the recommended solution/tool for:

  • Notification scheduler in the client side. The client's application is a java based application. It should have a background event scheduler that checks for new Noifications and if they timing conditions apply.
  • Notification designer/manager in the server side. The doctor's application should be able to show a visual tool to define the timing conditions (in java too). The Notifications are store in a database for remote accesing via web service.

Is there an open source tool available for this kind of issue? Also, I've been reading about Drools, but it's a completely new topic to me. Any recommendation on this?

A: 

There are various open source schedulers available.

Quartz is one of them, gives fine control for scheduling tasks.

Nayan Wadekar
A: 

It sounds like you have 3 separate but related issues:

  1. The scheduling of one or more future events.
  2. The persistence of the schedule and related contextual data.
  3. A push model to [re-]deliver a scheduling event from the server to the client.

More or less right ?

For scheduling and persistence, I recommend you look at Quartz. It will provide you a clean API for scheduling (one time or recurring) with some flexibility including fixed period or cron. It will also persist schedule data and context (referred to as a Job) to a JDBC database.

As for #3, I am not clear on how you want this to work, but one possible way this might work is that when the client connects to the server, it non-persistently caches the server provided scheduled events applicable to that client (or user etc.). When the client shuts down, these events are discarded, but renewed on the next connection. Once the events are loaded in the client, the client will assume responsibility for firing them with its own local scheduler (Quartz or even a more simplified ScheduledThreadPoolExcutor).

Drools is an excellent rules engine, but might be overkill for what you are trying to do.

//Nicholas

Nicholas