0 Replies Latest reply on May 13, 2011 3:48 PM by yangju.richard.yang.pearson.com

    How to spawn thread in jboss 6?

    yangju.richard.yang.pearson.com

      I heard that in an EE environment (such as jboss 6), we should not programmatically create our own worker threads. However, I do have a need to spawn multiple threads using ExecutorService so that I can simulate and test many clients work concurrently with my services (weld managed beans).


      If I spawn thread with new operator, the thread object cannot inject anything and it has lost all the cdi bean's functionalities and I understand this is expected.


      So the question is: is there any way in java EE and weld that we can accomplish creating (explicitly or implicitly) worker threads? I thought @New thread in a producer might work but not sure now.



      Thanks.