21.2 Overview of the asynchronous parallel processing of threads
With Application Server, you can execute the asynchronous parallel processing of threads such as the asynchronous timer processing or the asynchronous thread processing in a Java EE environment.
With the standard specifications of Java EE, a new thread cannot be generated from a servlet, or EJB cannot manage threads. We basically do not recommend the asynchronous parallel processing of threads. Therefore, with Application Server, APIs are provided based on Timer and Work Manager for Application Servers specifications defined by CommonJ, to implement the asynchronous parallel processing of threads in the Java EE environment.
The following subsections give an overview of APIs used for implementing the asynchronous parallel processing of threads:
-
TimerManager is an API based on the Timer for Application Servers specifications. With this API, you can schedule the asynchronous processing of threads by specifying an execution interval. This functionality is called asynchronous timer processing.
-
WorkManager is an API based on the Work Manager for Application Servers specifications. With this API, you can perform the asynchronous processing of threads. This functionality is called asynchronous thread processing.
You can use TimerManager and WorkManager from EJBs or servlets.
For details on the compatibility with Timer and Work Manager for Application Servers on Application Server, see 21.2.3 Compatibility with Timer and Work Manager for Application Servers.