Đang chuẩn bị liên kết để tải về tài liệu:
Writing Enterprise Applications with Java™ 2 SDK, Enterprise Edition phần 5

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

CalcHome Giao diện CalcHome là không thay đổi. Nó có cùng một phương pháp tạo ra mà trả về một thể hiện của giao diện từ xa. Đậu gói; java.rmi.RemoteException nhập khẩu, javax.ejb.CreateException nhập khẩu, nhập khẩu javax.ejb.EJBHome CalcHome giao diện công cộng kéo dài EJBHome {công cộng Calc create () ném CreateException, RemoteException;} | 46 SEPTEMBER 27 2000 Change the Session Bean In this lesson and as shown in Figure 14 the entity bean is a client of the session bean. This means the entity bean gets its data from the session bean instead of from BonusServiet as it did in Lesson 2 A Simple Entity Bean page 27 . So the caicBonus method in the session bean is modified to take the social security number as a parameter and create the entity bean. Figure 14 Beans Working Together CalcHome The caicHome interface is unchanged. It has the same create method that returns an instance of the remote interface. package Beans import java.rmi.RemoteException import javax.ejb.CreateException import javax.ejb.EJBHome public interface CaicHome extends EJBHome public Calc create throws CreateException RemoteException LESSON 3 COOPERATING ENTERPRISE BEANS SEPTEMBER 27 2000 47 Calc The calcBonus method in the Calc interface is changed to take the social security number as a parameter. This is so CaicBean can pass the bonus and social security number to the entity bean after calculating the bonus value. A new getRecord method is added so caicBean can find an entity bean by its primary key the social security number . Also the caicBonus method signature throws DupiicateKeyException and CreateExcep-tion. This is so BonusServiet can catch and handle either of these exception conditions. DuplicateKeyException descends from CreateException. If you design the caicBonus method to throw DupiicateKeyException but catch CreateException DupiicateKeyEx-ception is not thrown. The way around this is to have caicBonus throw both Dupii-cateKeyException and CreateException. package Beans import javax.ejb.EJBObject import java.rmi.RemoteException import javax.ejb.DupiicateKeyException import javax.ejb.CreateException pubiic interface Caic extends EJBObject pubiic Bonus caicBonus int muitipiier doubie bonus String socsec throws RemoteException DupiicateKeyException CreateException pubiic Bonus getRecord String socsec throws .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.