TAILIEUCHUNG - Art of Java Web Development STRUTS, TAPESTRY, COMMONS, VELOCITY, JUNIT, AXIS, COCOON, INTERNETBEANS, WEBWORK phần 7

Chạy thử nghiệm điểm cho một trường hợp thử nghiệm cá nhân hoặc một gói có chứa các trường hợp thử nghiệm và chạy tất cả mọi thứ bắt đầu với các thử nghiệm. Khi chỉ vào một gói, nó tải tất cả các lớp bắt đầu với các thử nghiệm thực hiện | 342 CHAPTER 12 Separating concerns import . import . import import public class EventDbBean implements SessionBean private SessionContext sessionContext private static final String SQL_SELECT SELECT FROM event private static final String COLS EVENT_KEY START DURATION DESCRIPTION EVENT_TYPE public void ejbCreate public void ejbRemove public void ejbActivate public void ejbPassivate public void setSessionContext SessionContext sessionContext sessionContext private DataSource getDataSource throws RemoteException DataSource ds null try Context c new InitialContext Object o java MySQLDS ds DataSource o catch ClassCastException ex throw new RemoteException Cast exception catch NamingException ex throw new RemoteException Naming exception return ds The class EventDbBean implements SessionBean which resides in the J2EE specification. Note that this is an interface meaning that the EJB infrastructure relies on interfaces as opposed to concrete classes to ensure flexibility. The SessionBean interface defines a handful of methods most of which are left blank for this bean. These methods represent callback hooks for the application server to manage the Using Enterprise JavaBeans 343 lifecycle of the bean. For example the pair of methods for ejbActivate and ebjPassivate allow the developer to write code for a situation in which the application server needs to move the object out of memory temporarily. In this case you can leave them blank but they must be present because of the interface. The next method accepts a Sessioncontext object. Sessioncontext is analogous to Servletcontext it is an object passed to this bean by the application server upon creation. It provides a connection to the application server s facilities. The remaining method in this snippet returns a Datasource that .

TỪ KHÓA LIÊN QUAN
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.