TAILIEUCHUNG - Designing Enterprise Applicationswith the J2EETM Platform, Second Edition phần 5

grate đậu doanh nghiệp với các gói và các ứng dụng di sản. Chương 6 thảo luận về phương pháp này hơn nữa. • Khi bạn muốn giao hàng nhắn tin để lái xe các sự kiện khác trong hệ thống. Ví dụ, các bước công việc có thể được dựa trên thực tế chỉ cung cấp tin nhắn, hoặc họ có thể dựa trên nội dung tin nhắn. | MESSAGE-DRIVEN BEANS 155 grate enterprise beans with packages and legacy applications. Chapter 6 discusses this approach further. When you want the message delivery to drive other events in the system. For example workflow steps can be based on the mere fact of message delivery or they can be based on the message content. When you want to create message selectors. A message selector is designed to take on only specific messages thus making it possible to use message-driven beans as triggers. Example Invoice Message-Driven Bean Code Example shows a message-driven bean that updates purchase orders based on invoice information received in a JMS message. The message-driven bean listens for JMS messages containing invoice data. When it receives a message its onMessage method extracts the invoice data from the message text. In this example the data has been encoded in XML which is parsed and then used to process an invoice. public class InvoiceMDB implements MessageDrivenBean MessageListener public void onMessage Message msg try String msgTxt TextMessage msg .getText Invoice invoice msgText do further processing catch . handle exceptions Code Example Message-Driven Bean Example 156 CHAPTER 5 THE ENTERPRISE JAVABEANS TIER Design Guidelines While you are free to write your application and enterprise bean code according to your own needs we do recommend certain guidelines. Keep the code in enterprise beans as client-neutral as possible. Enterprise beans are meant to contain business logic that can be used by many client types. Methods in enterprise beans that serve only one client type make any logic within that method inaccessible to other client types. Code that is specific for a particular client type belongs with the software managing that client type. In particular Web-tier and HTTP-related functions and data do not belong in an enterprise bean. Keep as much business logic as possible in the EJB tier. By doing so you take advantage of

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.