java 中的通知调度程序和设计器:实现建议
我正在为医生编写一个应用程序,该应用程序应该能够定义将显示在患者计算机中的通知。这些通知由医生安排,因此他/她可以选择何时显示。例如:“记住吃药”,从 2010 年 1 月到 7 月每周显示一次。
因此,它类似于 Google 日历的事件调度程序,但具有更丰富的计时条件。我想知道推荐的解决方案/工具是什么:
- 客户端的通知调度程序。客户端的应用程序是基于java的应用程序。它应该有一个后台事件调度程序来检查新的通知以及它们的计时条件是否适用。
- 服务器端的通知设计者/管理器。医生的应用程序应该能够显示一个可视化工具来定义计时条件(也在 java 中)。通知存储在数据库中,以便通过 Web 服务进行远程访问。
有没有开源工具可以解决此类问题?另外,我一直在阅读有关 Drools 的文章,但这对我来说是一个全新的话题。对此有什么建议吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有各种可用的开源调度程序。
Quartz 就是其中之一,可以对调度任务进行精细控制。
There are various open source schedulers available.
Quartz is one of them, gives fine control for scheduling tasks.
听起来您有 3 个独立但相关的问题:
或多或少对吗?
对于调度和持久性,我建议您查看 Quartz。它将为您提供一个干净的 API 用于调度(一次性或重复),并具有一定的灵活性,包括固定周期或 cron。它还会将计划数据和上下文(称为作业)保存到 JDBC 数据库。
至于#3,我不清楚你希望它如何工作,但一种可能的工作方式是,当客户端连接到服务器时,它非持久地缓存服务器提供的适用于该客户端的计划事件(或用户等)。当客户端关闭时,这些事件将被丢弃,但会在下一次连接时更新。一旦事件加载到客户端,客户端将负责使用自己的本地调度程序(Quartz 或什至更简化的 ScheduledThreadPoolExecutor)。
Drools 是一个出色的规则引擎,但对于您想要做的事情来说可能有点过头了。
//尼古拉斯
It sounds like you have 3 separate but related issues:
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