天道酬勤,学无止境

commonj

Using a CommonJ implementation with GlassFish and Spring 3

In my quest to unify deployment among Websphere 7 and GlassFish 3 environments, I decided to try implementing a CommonJ WorkManager and TimerManager in GlassFish. But it isn't quite working as expected. I have done the following: Use the myFOO CommonJ implementation found at: http://commonj.myfoo.de/ and include the libraries into my domain/lib folder (including the Spring libs) Added the following to the <resources> section of the glassfish domain.xml: <custom-resource res-type="commonj.work.WorkManager" jndi-name="wm/default" factory-class="de.myfoo.commonj.work.FooWorkManagerFactory"><

2021-11-29 00:30:27    分类:问答    spring   jakarta-ee   glassfish   commonj   workmanagers

需要示例代码解释 Tomcat 中的 Workmanager(Need sample code explaning Workmanager in Tomcat)

问题 我想知道如何在 Tomcat 7 中使用 WorkManager。我遇到了开源库Foo-CommonJ,但没有找到解释用法的示例代码。 FooWorkManager 构造函数的输入参数是commonj.work.work 类的一个实例,因为没有人提供commonj.work.work类(tomcat 和foo-commonj 都没有)。 基本上我需要一个示例代码来解释在 tomcat 中 WorkManager (FooCommonj jar) 的用法。 如果 Foo-Commonj 不能正确支持 workmanager,那么还有其他选择。 回答1 JSR-237 已被撤回,但已与 JSR-236 合并。 http://jcp.org/en/jsr/detail?id=237 原因:JSR 237 已与 JSR 236 合并,为 Java EE 并发提供单一、一致的规范。 回答2 老派的方式 复制到 jars 后的 tomcat\lib 文件夹: commonj-xxx.jar tomcat-commonj-xxx.jar 在您的应用程序或 tomcat 的 context.xml 中创建一个新的 WorkManager 实例: <Resource name="wm/myWorkManager" type="commonj.work.WorkManager" auth=

2021-09-29 07:42:58    分类:技术分享    multithreading   tomcat   asynchronous   workmanagers   commonj

Need sample code explaning Workmanager in Tomcat

I want to know how to use WorkManager in Tomcat 7. I came across the open source library Foo-CommonJ but nowhere i found a sample code explaning the usage. The input parameter for FooWorkManager's constructor is an instance of commonj.work.work class, where as no one provides the commonj.work.work class (neither tomcat nor foo-commonj). Basically i need a sample code explaining usage of WorkManager (FooCommonj jar) in tomcat. And if Foo-Commonj doesn't support workmanager properly, then some alternative.

2021-09-29 06:10:39    分类:问答    multithreading   tomcat   asynchronous   workmanagers   commonj

How do I ignore stuck threads in a Weblogic Server

I've got the below code working on Weblogic Application Server 10.3.2. The long running task executed on timerExpired takes longer than the server wide StuckThreadMaxTime of 600 seconds. I do not want to modify this value, but just to ignore the stuck thread timeout for this particular thread of processing. I can see how this can be accomplished using a commonj WorkManager from this: http://download.oracle.com/docs/cd/E11035_01/wls100/config_wls/self_tuned.html#wp1069945 And then by adding the following to the work-manager tag in the weblogic.xml file: <ignore-stuck-threads>true</ignore-stuck

2021-07-01 23:15:53    分类:问答    multithreading   weblogic   commonj

Weblogic Server 11g 上的自定义线程(Custom Thread on Weblogic Server 11g)

问题 我的 weblogic 服务器上需要一个自定义线程; 我不能使用 TimerEJB 或 Delayed MDB,因为我必须使用 3d 库。 我知道不鼓励应用服务器上的自定义线程; 这里有一篇相关的帖子(4 岁):为什么不鼓励在 Java EE 容器中生成线程? 是不是还气馁? 我可以使用ExecutorService或 Quartz 吗? 或者我只需要考虑 commonj 和工人经理? 回答1 在 Weblogic 11g (EJB3.0) 上,不鼓励创建“自己的线程执行器”(另请参阅 Java EE 规范和多线程),您应该使用: 定时器服务 例子: MyEjb { @Stateless public class TimerBean implements TimerRemote { @Resource TimerService service; @Override public void startTimer() { Timer timer = service.createTimer(1000, 1000, null); System.out.println("Timers set"); } @Timeout public void handleTimeout(Timer timer) { System.out.println("Handle timeout event

2021-06-11 12:02:42    分类:技术分享    java   multithreading   weblogic11g   commonj

Custom Thread on Weblogic Server 11g

I need a custom threda on my weblogic server; I cannot use TimerEJB or Delayed MDB since I have to use a 3d library. I know that custom threads on application server are discouraged; here a related post (4 years old): Why is spawning threads in Java EE container discouraged? Is it still discouraged? Can I use ExecutorService or Quartz? Or I have to consider only commonj and worker manager?

2021-05-17 11:16:42    分类:问答    java   multithreading   weblogic11g   commonj

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.

2021-04-15 16:41:07    分类:问答    jakarta-ee   timer   ejb-3.0   weblogic   commonj