在它的部署描述子中,需要批次應用程式來宣告特殊 Stateless Session Bean (SLSB)。這個 Bean 作為批次 工作控制器,並且必須包含批次應用程式中使用的所有批次步驟 Enterprise Bean 的 本端 Enterprise Bean 參照。
這個 Bean 的實作方式由 WebSphere 提供,而不是批次應用程式;它只需要在批次應用程 式的部署描述子中宣告。每一個批次應用程式只能定義一個控制器 Bean。請注意,在控制器 Bean 上宣告的資源參照和 EJB 參照 適用於批次應用程式(控制器 Bean 在其中宣告)的所有批次步驟 EJB 和批次資料串流。 比方說,如果應用程式中的批次資料串流需要存取 WebSphere 資料來源,您可以在控制器 Bean 上宣告該資料來源的資源參照,如此該批次資料串流就可以在執行時期於 java:comp/env 名稱空間中查閱該資料來源。
限制:
<session id="BatchController> <ejb-name>BatchController</ejb-name> <home>com.ibm.ws.batch.BatchJobControllerHome</home> <remote>com.ibm.ws.batch.BatchJobController</remote> <ejb-class>com.ibm.ws.batch.BatchJobControllerBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Bean</transaction-type> <ejb-local ref id="EJBLocalRef_1094060718999"> <ejb-ref-name>ejb/step1</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <local-home>com.ibm.websphere.batch.BatchJobStepLocalHomeInterface</local-home> <local>com.ibm.websphere.batch.BatchJobStepLocalInterface</local> <ejb-link>Step1EJB</ejb-link> </ejb-local-ref> <ejb-local-ref id="EJBLocalRef_1094060719009"> <ejb-ref-name>ejb/step2</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <localhome>com.ibm.websphere.batch.BatchJobStepLocalHomeInterface</localhome> <local>com.ibm.websphere.batch.BatchJobStepLocalInterface</local> <ejb-link>Step2EJB</ejb-link> </ejb-local-ref> <resource-ref id="ResourceRef_1117024737807"> <description> </description> <res-ref-name>wm/BatchWorkManager</res-ref-name> <res-type>commonj.work.WorkManager</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> </session>