21.4 Asynchronous thread processing by using WorkManager
This section describes the asynchronous thread processing performed by using WorkManager.
The following table describes the organization of this section.
|
Category |
Title |
Reference location |
|---|---|---|
|
Description |
The daemon Work and non-daemon Work |
|
|
The thread pool and queues used in the non-daemon Work |
||
|
The life cycle of WorkManager, daemon Work and the non-daemon Work |
||
|
Implementation |
Developing applications by using WorkManager |
|
|
Settings |
Settings in the execution environment |
- Note:
-
There is no specific description of Operations and Notes for this functionality.
With the asynchronous thread processing performed by using WorkManager, you can execute the asynchronous processing of threads in the Java EE environment. Because the threads managed by a container are used in the background, you can execute tasks safely.
Implement the process to be executed asynchronously, with Work. The process implemented with Work is scheduled when you execute the schedule method of WorkManager in EJBs or servlets, which are the schedule sources. You can check the schedule status by using WorkItem, which is returned by the schedule method of WorkManager.
To use WorkManager, define the information related to WorkManager, in <resource-ref> tag of EJB properties or servlet properties. The EJB or servlet uses WorkManager by performing lookup with the name defined in <res-ref-name> tag at the time of deployment.