CommonJ TimerManager与EJB3 TimerService [英] CommonJ TimerManager versus EJB3 TimerService
问题描述
我必须为WebLogic实现一个简单的(非集群)计时器,它似乎有两个不同的标准选项
I have to implement a simple (not clustered) timer for WebLogic and it seems there are two different 'standard' options
- 计时器和工作管理器API(CommonJ)
- EJB3.0 TimerService
有没有人有任何建议使用CommonJ TimerManager与在WebLogic 10.0中使用EJB3 TimerService?
Does anyone have any advice on using the CommonJ TimerManager versus using the EJB3 TimerService in WebLogic 10.0?
谢谢。
推荐答案
EJB 3.0中的TimerService有限与CommonJ Timer Manager相比。例如,它需要样板代码和特定于容器的配置来实现灵活的任务调度。通过在EJB 3.1中引入@Scheduled注释简化了这一过程。
TimerService in EJB 3.0 is somewhat limited as compared to CommonJ Timer Manager. For example, it requires boilerplate code and container-specific configuration to implement flexible task scheduling. This was simplified with the introduction of @Scheduled annotation in EJB 3.1.
如果您坚持使用EJB 3.0并且需要轻松灵活的可配置任务调度,CommonJ Timer Manager API是一个可行的选项。
If you are stick with EJB 3.0 and need easily and flexibly configurable task scheduling, CommonJ Timer Manager API is a viable option.
此外,Spring Framework的任务调度程序(org.springframework.scheduling.TaskScheduler)可以很好地抽象Timer Manager API,并允许使用声明式配置cron表达式。
In addition, Task Scheduler from Spring Framework (org.springframework.scheduling.TaskScheduler) does a good job of abstracting Timer Manager API and allows declarative configuration using cron expressions.
这篇关于CommonJ TimerManager与EJB3 TimerService的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!