Đang chuẩn bị liên kết để tải về tài liệu:
Enterprise Java and UML 2nd Edition PHẦN 4

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

30 RecordTimeWorkflowSessionBean { /** Answers a reference to the newly created Activity bean. */ public RecordTimeWorkflow create(String username) throws RemoteException, CreateException; } RecordTimeWorkflowBean.java RecordTimeWorkflowBean.java is the implementation class for the RecordTimeWorkflow session bean. Most of this code should be somewhere between familiar and monotonous, by this point. However, there is one new wrinkle, as the ejbCreate method finds a User entity bean based on the username parameter. This bean reference is kept for the duration of the stateful session. The RecordTimeWorkflow session bean wraps the data for a timecard into a custom TimecardDTO object. package com.wiley.compBooks.EJwithUML.TimeCardWorkflow; import import import import import import import import. | 30 RecordTimeWorkflowSessionBean Answers a reference to the newly created Activity bean. public RecordTimeWorkflow create String username throws RemoteException CreateException RecordTimeWorkflowBean.java RecordTimeWorkflowBean.java is the implementation class for the RecordTimeWorkflow session bean. Most of this code should be somewhere between familiar and monotonous by this point. However there is one new wrinkle as the ejbCreate method finds a User entity bean based on the username parameter. This bean reference is kept for the duration of the stateful session. The RecordTimeWorkflow session bean wraps the data for a timecard into a custom TimecardDTO object. package com.wiley.compBooks.EJwithUML.TimeCardWorkflow import com.wiley.compBooks.EJwithUML.Dtos. import com.wiley.compBooks.EJwithUML.TimeCardDomain. import com.wiley.compBooks.EJwithUML.Base.ApplicationExceptions. import com.wiley.compBooks.EJwithUML.Base.DateUtil import com.wiley.compBooks.EJwithUML.Base.EjbUtil. import java.util. import java.rmi. import javax.ejb. import javax.naming. The RecordTimeWorkflow allows client objects to record their time. RecordTimeWorkflowBean is the actual session bean implementation. public class RecordTimeWorkflowBean extends BasicSessionBean private UserLocal user public void ejbCreate String username throws CreateException try System.out.println creating RecordTimeWorkflowBean with user - n username Context initialContext getInitialContext UserLocalHome userHome UserLocalHome initialContext.lookup EjbReferenceNames. n USER_HOME Collection users userHome.findByUserName username Iterator userIterator users.iterator RecordTimeWorkflowSessionBean 31 if userIterator.hasNext this.user UserLocal userIterator.next System.out.println done creating RecordTimeWorkflowBean with user - username catch NamingException e throw new CreateException User Bean Not Found catch FinderException e throw new CreateException User username Not Found public void ejbPostCreate String username .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.