Bài giảng Lập trình mạng Title - GV. Nguyễn Xuân Vinh

50 832 0
Bài giảng Lập trình mạng Title - GV. Nguyễn Xuân Vinh

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

KHOA CÔNG NGHỆ THÔNG TIN /XX 28/05/15 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM TITLE Presenter: Nguyễn Xuân Vinh Information Technology Faculty Nong Lam University KHOA CÔNG NGHỆ THÔNG TIN /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM Session Introduction to Enterprise Java Beans /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Session Objectives  Discuss Component Architecture  Describe Distributed Object Architecture  Discuss RMI  Explain RMI-IIOP  Discuss the Java Naming and Directory Interface GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM Component Architecture  /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG  KHOA CÔNG NGHỆ THÔNG TIN   Components are building blocks of an application Provides a set of services or functions, such that it can easily interact with other applications or components Consists mainly of Web components, business logic components, and service components Web components consist mainly of JSP and Servlets, the business logic component consists of EJB and the services component primarily consists of JavaMail, JNDI, JMS, JTS, JDBC, and RMI-IIOP /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Evolution of Enterprise JavaBeans  EJB was developed so that it would: * Specialize in handling the business logic of an application * Be robust * Be secure so that it cannot be tampered  EJB Component has been designed to encapsulate business logic /XX 28/05/15 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM Distributed Object Architecture KHOA CÔNG NGHỆ THÔNG TIN /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN RMI Architecture  RMI Application consists of * Server * Client  RMI defines two types of objects * Stubs * Skeletons  Marshalling - process of converting data or objects into a byte-stream  Unmarshalling - reverse process of converting the byte-stream back to the original data or objects MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN RMI Layered Architecture Client Object AA Object Object A Stub Server Object BB Object Object B Skeleton /XX 28/05/15 Remote Reference Layer Remote Reference Layer Transport Layer Transport Layer R E M O T E R E G I S T R Y /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN RMI Layers  Stub and the Skeleton Layer The stub forwards the request from the client to the remote reference layer and then to the skeleton through transport layer  Remote Reference Layer Responsible for unicast point-to-point method invocation  Transport Layer Uses TCP/IP for communication 10 /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN The Transport Layer Client Server Transp ort Layer Transp ort Layer Sockets TCP Protocol UDP Protocol KHOA CÔNG NGHỆ THÔNG TIN Persistent Support Persistence can be defined as saving the state of an object to a constant storage The state of the object is maintained in this constant storage 36 /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM ACCP 2005/EJB 2.0/Session 2/36 of 25 GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Support for Management of Multiple Instances 37 /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG In order to perform timely servicing to the client the container performs a variety of tasks Server Tasks Database connection pooling Instance Passivation Instance pooling ACCP 2005/EJB 2.0/Session 2/37 of 25 GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Enterprise Beans MƠN: LẬP TRÌNH MẠNG The Enterprise Java Bean is a server-side component that is employed on a distributed multi-tier environment Enterprise Bean Message Driven Beans Entity Bean 38 /XX 28/05/15 Session Bean Stateful Bean Stateles s Bean BMP CMP ACCP 2005/EJB 2.0/Session 2/38 of 25 39 /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Features of an EJB Container Features Resource Management and Life Cycle Management of a Bean Remote Accessibility and location transparency State Management Transactions Persistence Security ACCP 2005/EJB 2.0/Session 2/39 of 25 KHOA CÔNG NGHỆ THÔNG TIN Resource Management and Life Cycle of a bean  Management of resources enhances the scalability of a multi-tier architecture  The container provides resource- management services for resources such as: Threads Socket Connections Database Connections 40 /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM ACCP 2005/EJB 2.0/Session 2/40 of 25 41 /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN State Management Fills up Application in a site Page Submits the form Application in a site Page Client User takes time as he reads the contents in the page Container is used for another process while user takes time to read ACCP 2005/EJB 2.0/Session 2/41 of 25 KHOA CÔNG NGHỆ THÔNG TIN Transactions Operation1 Operation2 Executed as one unit of work Multiple users use the same data Operation3 42 /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM ACCP 2005/EJB 2.0/Session 2/42 of 25 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Transactions-Two phase commit protocol Prepare message Prepare Phase Records results of transaction Database Transaction Coordinator Commit/Rollback Transaction Request All databases issue commit request Commit Phase Database Commit/Rollback Transaction Request 43 /XX 28/05/15 Database ACCP 2005/EJB 2.0/Session 2/43 of 25 /XX 44 KHOA CÔNG NGHỆ THÔNG TIN Remote Accessibility Not-Networked Bean Bean Bean Deployed across multiple tiers 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM Networked after deployment Bean Bean Bean ACCP 2005/EJB 2.0/Session 2/44 of 25 KHOA CÔNG NGHỆ THÔNG TIN Location Transparency Component Clients not know where the components are, and whether these components are local or remote Component 45 /XX 28/05/15 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM ACCP 2005/EJB 2.0/Session 2/45 of 25 KHOA CÔNG NGHỆ THÔNG TIN Specialized Containers  Integration to mainframe systems  Stateful recovery  Distributed transactions  Database persistence services that are complex  Integrated XML services  Dynamic redeployment of components in a system that is running 46 /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM ACCP 2005/EJB 2.0/Session 2/46 of 25 KHOA CÔNG NGHỆ THÔNG TIN Summary -  Four stages are followed while developing business solutions: * Vendor grouping of product into modules * Running of the EJB component on multi-tier applications * Combining the component into a workflow, and integrating the business logic * Deploying and distributing the system over multiple systems network across the  Six parties involved while deploying Enterprise JavaBeans: * The Bean provider * The Server provider * The Deployer * The Container provider * The Application Assembler * The System Administrator 47 /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM ACCP 2005/EJB 2.0/Session 2/47 of 25 KHOA CÔNG NGHỆ THÔNG TIN Summary -  Logical three-tier architecture of EJB:  The Client  The EJB Server  The Database  The EJB Container resides inside the EJB server The container acts as a buffer between the bean and the outside world  The main responsibilities of the container are: * Connecting clients to the beans * Managing the life cycle of the bean  The server provides the container with network connectivity 48 /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM ACCP 2005/EJB 2.0/Session 2/48 of 25 KHOA CÔNG NGHỆ THÔNG TIN Summary -  The server and the container provide following services to the developer * Transaction support * Security support * Persistence support * Support for management of multiple instances  An Enterprise Java Bean can be classified into: * Session Beans * Entity Beans * Message-Driven Beans 49 /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM ACCP 2005/EJB 2.0/Session 2/49 of 25 50 /XX 28/05/15 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM HỎI ĐÁP KHOA CÔNG NGHỆ THÔNG TIN ... 28/05/15 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM Session Introduction to Enterprise Java Beans /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI... 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM Database of Objects GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM RMI over IIOP Client RMI MÔN: LẬP TRÌNH MẠNG KHOA... /XX 28/05/15 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM ACCP 2005/EJB 2.0/Session 2/30 of 25 31 /XX 28/05/15 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC

Ngày đăng: 28/05/2015, 07:54

Từ khóa liên quan

Mục lục

  • TITLE

  • Session 1

  • Session Objectives

  • Component Architecture

  • Evolution of Enterprise JavaBeans

  • Distributed Object Architecture

  • RMI Architecture

  • RMI Layered Architecture

  • RMI Layers

  • The Transport Layer

  • Remote Registry

  • RMI over IIOP

  • Java Naming and Directory Interface

  • The JNDI Architecture

  • Naming Concepts in JNDI

  • Steps in JNDI Programming

  • Initial Context Factory and the Directory Context

  • Slide 18

  • Java 2 Platform Enterprise Edition ( J2EE )

  • Java 2 Platform Enterprise Edition (J2EE)

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan