Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Each WAS server runs a single JVM, and daemon threads are tied to the JVM's lifecycle, not the app's lifecycle. Therefore, you should not expect any daemon threads to be shut down when your app stops.</p> <p>As you've already indicated, you should not create threads manually; the Java EE specs forbid this and the behavior in a Java EE container is different than a standalone Java application as you've already found. Unfortunately, there is currently no Java EE standard for a WorkManager equivalent; however, <a href="http://jcp.org/en/jsr/detail?id=236" rel="nofollow noreferrer">JSR-236</a> (Concurrency Utilities for Java EE) may be back as a candidate for inclusion in <a href="http://jcp.org/en/jsr/detail?id=342" rel="nofollow noreferrer">Java EE 7</a>.</p> <p>In the meantime, on WAS, you can use the <a href="http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.nd.doc/info/ae/asyncbns/concepts/casb_asbover.html" rel="nofollow noreferrer">asynchronous beans</a> (<code>WorkManager</code>). We have successfully used this method to tie threads to the application lifecycle.</p> <p>However, since you need to run in another container as well (Tomcat), there may be some other options to consider handling concurrency in your applications:</p> <ul> <li><a href="http://download.oracle.com/docs/cd/E11035_01/wls100/commonj/commonj.html#wp1057962" rel="nofollow noreferrer">CommonJ WorkManager</a></li> <li><a href="http://jcp.org/en/jsr/detail?id=315" rel="nofollow noreferrer">Servlet 3.0</a> Asynchronous Servlets</li> <li><a href="http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContextListener.html" rel="nofollow noreferrer"><code>ServletContextListener</code></a> to hook into the web app lifecycle</li> </ul> <p>Some other potential options for handling concurrency include the following, but these require EJBs, which may not be available in Tomcat:</p> <ul> <li><a href="http://jcp.org/en/jsr/detail?id=220" rel="nofollow noreferrer">EJB 3.0</a> Timer Service</li> <li><a href="http://jcp.org/en/jsr/detail?id=318" rel="nofollow noreferrer">EJB 3.1</a> Asynchronous Beans</li> </ul> <p>Here are a few related threads on the topic of concurrency in Java EE:</p> <ul> <li><a href="https://stackoverflow.com/questions/9026516/replacing-webspheres-workmanager-in-jboss">Replacing Websphere's WorkManager in JBoss?</a></li> <li><a href="https://stackoverflow.com/questions/7321825/getting-thread-from-container">Getting thread from Container?</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload