Compute-intensive applications are applications that perform computationally intensive work that does not fit comfortably into the traditional Java 2 Platform Enterprise Edition (J2EE) request and response paradigm.
The following sections provide additional information on the extensions to the asynchronous beans programming model.
<session id="supply a suitable name here"> <ejb-name>CIController</ejb-name> <home>com.ibm.ws.ci.CIControllerHome</home> <remote>com.ibm.ws.ci.CIController</remote> <ejb-class>com.ibm.ws.ci.CIControllerBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Bean</transaction-type> <resource-ref id="WorkManager_ResourceRef"> <description> WorkManager that is used to execute jobs. <res-ref-name>wm/CIWorkManager</res-ref-name> <res-type>commonj.work.WorkManager</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope>
The logic for a compute-intensive application some number of CIWork objects plus the classes needed to support those CIWork objects, is packaged in an enterprise bean module in a J2EE application Enterprise Archive (EAR) file. Note that the deployment descriptor for the enterprise bean module must contain the definition of the stateless session bean previously described. If the application itself uses other enterprise beans or resources, then the definitions for those beans and resources might also appear in the deployment descriptor. You can use J2EE development tools such as IBM Rational Application Developer to develop and package compute-intensive applications in the same way that they are used to construct J2EE applications containing enterprise bean modules and asynchronous beans.
If the job is canceled before the run() method returns, then the CIControllerBean invokes the CIWork object release() method on a separate thread. It is up to the developer of the long-running application to arrange for logic in the release() method to cause the run() method to return promptly. The job remains in a cancel pending state until the run() method returns.
If the job is not canceled and the run() method returns without returning an exception, then the job completed successfully. If the run() method returns an exception, then the job status is execution failed. After the run() method returns (either successfuly or by returning an exception), no further calls are made to the CIWork object, and all references to it are dropped.
Like all long-running jobs, compute-intensive jobs are split into multiple job steps. In the case of compute-intensive jobs, each job step is represented by an instance of a class that implements the com.ibm.websphere.ci.CIWork interface. The CIWork interface extends the commonj.Work work interface from the application server asynchronous beans programming model and Java Specification Request (JSR) 237. These extensions consist of two methods that provide a way to pass the job-step-specific properties specified in the job to the CIWork object.
Refer to the API documentation for more details.
To learn about asynchronous beans, go to Using asynchronous beans section of the WebSphere Application Server Information Center.