1 2 Previous Next 17 Replies Latest reply: Jan 28, 2013 7:38 AM by Marc Gagnon RSS

    How to get a WorkManager from a Bean

    christian malolepszy Newbie

      Helo all,

      I have written a MessageDrivenBean and inside this process i will call some other Beans / Works parallel, wait some time, get the results from the ready processes and cancel the others.
      I read about the jca WorkManager and this were a very good solution for my problem.

      But I can't find any example how to work on jboss with a WorkManager, lookup etc. so I do it in this way:

      JBossWorkManager jwm = new JBossWorkManager();
      ThreadPool tp = new BasicThreadPool();
      jwm.setThreadPool(tp);
      
      Work work = new MyWork(1);
      Work work2 = new MyWork(2);
      
      ExecutionContext ec = new ExecutionContext();
      
      jwm.startWork(work,0,ec,null);
      jwm.startWork(work2,0,ec,null);
      


      But I think, this is not the right way!

      My question: How can i get a Workmanager from JBoss, through a JNDI lookup for example.

      best regards
      christian


        1 2 Previous Next