CommonJ TimerManager 与 EJB3 TimerService [英] CommonJ TimerManager versus EJB3 TimerService

查看:39
本文介绍了CommonJ TimerManager 与 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 定时器服务

有人对在 WebLogic 10.0 中使用 CommonJ TimerManager 还是使用 EJB3 TimerService 有任何建议吗?

Does anyone have any advice on using the CommonJ TimerManager versus using the EJB3 TimerService in WebLogic 10.0?

谢谢.

推荐答案

与 CommonJ Timer Manager 相比,EJB 3.0 中的 TimerService 有所限制.例如,它需要样板代码和特定于容器的配置来实现灵活的任务调度.通过在 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 的 Task Scheduler (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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆