Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
639 views
in Technique[技术] by (71.8m points)

jakarta ee - CommonJ TimerManager versus EJB3 TimerService

I have to implement a simple (not clustered) timer for WebLogic and it seems there are two different 'standard' options

  • Timer and Work Manager API (CommonJ)
  • EJB3.0 TimerService

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

Thank you.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

CommonJ was originally proposed under JSR 237, which was withdrawn in 2008 and merged into JSR 236 Concurrency Utilities for the Java EE platform. Note that this means a significant change from CommonJ proposed standard and API. The name CommonJ is removed, the new packages are under javax.enterprise.concurrent, rather than commonj.timers and commonj.work, and the original classes TimerManager, Timer and TimerListener are replaced by non-corresponding interfaces/classes including ManagedScheduledExecutorService, ManagedTask, ManagedTaskListener, Trigger.

This latter JSR 236 has recently passed public review and, hence, should become a standard soon. As of november 2012, it is a preliminary candidate for inclusion under the Java EE 7 specification (JSR 342), but this will be confirmed once 342 is finalised and released.

Hence, the following problems with CommonJ:

  • it is not and will not be a Java standard, until significantly changed under JSR 236 which will be included in Java EE 7 or later
  • it goes beyond your requirements, presumably, and is more complicated than the EJB 3.0 Timer Service

I suggest you use the EJB 3.0 Timer Service if it meets your needs.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...