13 Replies Latest reply on Dec 19, 2012 9:05 AM by rodakr

    Creating Threads inside JBoss AS 7.1.1

    NIranjan Nanda Apprentice

      Hi All,


      We are using JBoss 7.1.1 as our app server. For one of our use cases, we need to spawn threads inside the application (the application is deployed a WAR file). Since creating own threads inside a Java EE container is not an advisable idea, we are trying to evaluate different options for this like:

      - Use work manager api to spawn threads.

      - Use Executor Service to create threads.


      There are some confusions and I need your help in that.


      1. How can I use WorkManager API inside JBoss 7 container. I found several posts, but not a single one shows how exactly to do that. What all configurations we should do and what all things we need to take care inside our program.


      2. As per JSR 236, creating threads using ExecutorService inside a Java EE 6 certified container will borrow threads from JBoss managed pool. Is this statement correct? If so, can we use this instead of WorkManager? Essentially both of these advocates about inehriting managed threads from container instead of creating your own.


      Any suggestions?