J2EE Lecture 10: EJB 3.0 Overview

Slides:



Advertisements
Similar presentations
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento.
Advertisements

11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
An architecture for webb applications, J2EE
Introduction to Java 2 Enterprise Edition About myself –Neutrinos, Cancer Research, IT Applications Today’s topic: J2EE –Context –Advantages –Components.
Introduction to Enterprise JavaBeans. Integrating Software Development Server-side Component Model Distributed Object Architecture –CORBA –DCOM –Java.
Enterprise Applications & Java/J2EE Technologies Dr. Douglas C. Schmidt Professor of EECS.
Java 2 – Enterprise Edition Kevin J. LaFata April 21, 2003 UM – St. Louis.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
Java 2 Platform, Enterprise Edition (J2EE). Source: Computer, August 2000 J2EE and Other Java 2 Platform Editions.
July 23 th, 2005 Software Architecture in Practice RiSE’s Seminars Bass’s et al. Book :: Chapter 16 Fred Durão.
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
Version # Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department of Defense © 1999 by Carnegie.
© 2004 IBM Corporation BEA WebLogic Server Introduction and Training.
Distributed System Using Java 2 Enterprise Edition (J2EE)
EJB Overview Celsina Bignoli Distributed Business Applications Server DB Client DB Server DB.
Chapter 4: Core Web Technologies
Enterprise Java Beans CS-422. Application Servers In the late 1980s and though the mid 1990s a number of corporations (Broadvision, Netscape…) marketed.
HTTP client wide area network (Internet) HTTP proxy HTTP server HTTP gateway firewall HTTP tunnel Copyright Springer Verlag Berlin Heidelberg 2004.
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Corso di Formazione Sodalia “Enterprise Java Beans” JNDI Java Naming and Directory Interface.
CS 493/693: Distributed Systems Programming V. “Juggy” Jagannathan CSEE, West Virginia University March 21, 2005.
Entity Java Beans Jorg Janke Open Source ERP & CRM.
Enterprise Java Beans Part I Kyungmin Cho 2001/04/10.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
Introduction to J2EE Architecture Portions by Kunal Mehta.
第十四章 J2EE 入门 Introduction What is J2EE ?
Enterprise Java v120131Intro to JavaEE1 Java EE 5 TM Introduction.
Enterprise Java Beans Java for the Enterprise Server-based platform for Enterprise Applications Designed for “medium-to-large scale business, enterprise-wide.
Topic : JNDI Kaster Nurmukan. JNDI2(c)CDAC(Formerly NCST) What is JNDI? Naming and Directory Services Naming Concepts Issues JNDI Architecture Programming.
Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to.
J2EE Overview ver 1.0Page 1 © Wipro Technologies Talent Transformation J2EE Overview.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Databases JDBC (Java Database Connectivity) –Thin clients – servlet,JavaServer Pages (JSP) –Thick clients – RMI to remote databases –most recommended way.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Remoting Simplifying.
Introduction to Enterprise JavaBeans Topics In Systems Architecture Barry Herbold
Enterprise Java Overview Panos Konstantinidis Java Developer JUG Leader & Java Champion
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Enterprise JavaBeans 3.0. What is EJB 3.0 -Reusable server-side component framework-technology -Designed to support building demanding enterprise – level.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
1 Distributed System using J2EE. 2 What is J2EE?  J2EE (Java2 Enterprise Edition) offers a suite of software specification to design, develop, assemble.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Copyright © 2002 ProsoftTraining. All rights reserved. Enterprise JavaBeans.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Enterprise JavaBeans: Fundamentals. EJB Fundamentals(c)CDAC(Formerly NCST)2 Contents Introduction Technology Overview EJB Architecture EJB Specification.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
EJB Enterprise Java Beans JAVA Enterprise Edition
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
J2EE Platform Overview (Application Architecture)
Introduction to J2EE Architecture
Knowledge Byte In this section, you will learn about:
Java EE Overview The problem Java Enterprise Edition attempts to solve: maximize the use of Java technologies by providing a suite of Java technology specifications.
Introduction to Enterprise JavaBean
Java EE Overview The problem Java Enterprise Edition attempts to solve: maximize the use of Java technologies by providing a suite of Java technology specifications.
Distributed System Using Java 2 Enterprise Edition (J2EE)
Understanding and Designing with EJB
JavaServer Faces: The Fundamentals
Enterprise Java Beans Bina Ramamurthy 1/13/2019 B.Ramamurthy.
Web Application Server 2001/3/27 Kang, Seungwoo. Web Application Server A class of middleware Speeding application development Strategic platform for.
Component Technology Bina Ramamurthy 2/25/2019 B.Ramamurthy.
Enterprise Java Beans Bina Ramamurthy 4/5/2019 B.Ramamurthy.
Developing and testing enterprise Java applications
J2EE Lecture 13: JMS and WebSocket
Enterprise Java Beans.
Seminarium on Component-based Software Engineering
Introduction to Session beans
Knowledge Byte In this section, you will learn about:
Presentation transcript:

J2EE Lecture 10: EJB 3.0 Overview Dr. Ming Qiu Xiamen University Software School mingqiu@xmu.edu.cn

Mastering EJB3.0, Chap 1 10.1 Overview What plumbing do you need to build a robust distributed object deployment? What is EJB, and what value does it add?

10.1 Overview EJB is a server-side component framework Mastering EJB3.0, Chap 1 10.1 Overview EJB is a server-side component framework simplifies the process of building enterprise-class distribute component application in Java

10.1 Overview What is Software Component? Mastering EJB3.0, Chap 1 10.1 Overview What is Software Component? A piece of code written to manifest the behavior of a corresponding abstract concept. Sounds like Objects, but it is different Self-contained Entity Be used in a similar or completely different application Can live an independent, reusable existence outside of original application A system can be designed to consist of reusable components

10.1 Overview The Need for Componentization Mastering EJB3.0, Chap 1 10.1 Overview The Need for Componentization Lack of flexibility and interoperability Component Framework Common Object Request Broker Architecture (CORBA) ActiveX/COM EJB

10.1 Overview Remote method invocation Loading balancing Mastering EJB3.0, Chap 1 10.1 Overview Remote method invocation Loading balancing Transparent failover Back-end integration Transaction Clustering Dynamic redeployment

10.1 Overview Each of these aspects can be thought of as a service Mastering EJB3.0, Chap 1 10.1 Overview Clean shutdown Logging and Auditing Systems management Threading Message-oriented middleware Component life cycle Resource pooling Security Caching And much… Each of these aspects can be thought of as a service

10.1 Overview Application Server-Class Software Mastering EJB3.0, Chap 1 10.1 Overview Application Server-Class Software Building Middleware Services from Scratch Buying Middleware Services via Application Server Software

10.1 Overview Standardization of Component Frameworks Mastering EJB3.0, Chap 1 10.1 Overview Standardization of Component Frameworks More than 50 application servers on the market Need an agreement to enable any component to run within any application server

Mastering EJB3.0, Chap 1 10.1 Overview

10.1 Overview Enterprise JavaBeans Technology Mastering EJB3.0, Chap 1 10.1 Overview Enterprise JavaBeans Technology A standard for developing and deploying server-side distribute components in Java It is a ubiquitous industry standard Portability is possible Rapid application development EJB is two things in one Specification A set of Java Interfaces

10.1 Overview Why Java Interface/implementation separation Mastering EJB3.0, Chap 1 10.1 Overview Why Java Interface/implementation separation Safe and security If a thread dies, the application stays up No memory pointer in java Memory leaks occur much less often Cross-platform

10.1 Overview EJB as a Business Tier Component Mastering EJB3.0, Chap 1 10.1 Overview EJB as a Business Tier Component Presentation tier components deal directly with end user or end application Business tier components perform server-side operation Such as executing complex algorithm or performing transactional business operation

10.1 Overview EJB components can perform following tasks Mastering EJB3.0, Chap 1 10.1 Overview EJB components can perform following tasks Performing business logic Access a database Integrate with other systems Examples of EJB clients Application clients Dynamically generated Web pages Web service clients

Mastering EJB3.0, Chap 1 10.1 Overview

10.1 Overview Distributed Computing: The Foundation of EJB Mastering EJB3.0, Chap 1 10.1 Overview Distributed Computing: The Foundation of EJB

the Java Platform, Enterprise Edition 10.0 (Java EE) Mastering EJB3.0, Chap 1 the Java Platform, Enterprise Edition 10.0 (Java EE)

the Java Platform, Enterprise Edition 10.0 (Java EE) Mastering EJB3.0, Chap 1 the Java Platform, Enterprise Edition 10.0 (Java EE) A uncompleted list of JavaEE Technologies Enterprise JavaBean(EJB) Java API for Web Services(JAX-WS) Java Remote Method Invocation (RMI) and RMI-IIOP Java Naming and Directory Interface (JNDI) Java Database Connectivity (JDBC) Java Transaction API(JTA) and Java Transaction Service(JTS) Java Message Service (JMS) Java Servlets Java Server Pages (JSP) Java Server Faces (JSF) Java EE Connector Architecture (JCA) The Java API for XML Parsing (JAXP) The Java Architecture for XML Binding (JAXB) The Java Authentication and Authorization Service (JAAS)

10.2 Pre-EJB 3.0: The World That Was Mastering EJB3.0, Chap 2 10.2 Pre-EJB 3.0: The World That Was Briefly introduce the programming and deployment model in EJB2.0 To realize the breadth and depth of enhancements made in EJB3.0

10.2 Pre-EJB 3.0: The World That Was Mastering EJB3.0, Chap 2 10.2 Pre-EJB 3.0: The World That Was

10.2 Pre-EJB 3.0: The World That Was Mastering EJB3.0, Chap 2 10.2 Pre-EJB 3.0: The World That Was

10.2 Pre-EJB 3.0: The World That Was Mastering EJB3.0, Chap 2 10.2 Pre-EJB 3.0: The World That Was

10.2 Pre-EJB 3.0: The World That Was Mastering EJB3.0, Chap 2 10.2 Pre-EJB 3.0: The World That Was Differences between the local and the remote interface The local interface extends javax.ejb.EJBLocalObject instead of javax.ejb.EJBObject The business method does not throw a java.rmi.RemoteException

10.2 Pre-EJB 3.0: The World That Was Mastering EJB3.0, Chap 2 10.2 Pre-EJB 3.0: The World That Was

10.2 Pre-EJB 3.0: The World That Was Mastering EJB3.0, Chap 2 10.2 Pre-EJB 3.0: The World That Was

10.2 Pre-EJB 3.0: The World That Was Mastering EJB3.0, Chap 2 10.2 Pre-EJB 3.0: The World That Was Differences between the local and the remote home interface The local home interface extends javax.ejb.EJBLocalHome instead of javax.ejb.EJBHome The local home interface methods do not throw java.rmi.RemoteException

Mastering EJB3.0, Chap 2

10.2 Pre-EJB 3.0: The World That Was Mastering EJB3.0, Chap 2 10.2 Pre-EJB 3.0: The World That Was

Mastering EJB3.0, Chap 2

Mastering EJB3.0, Chap 3

10.2 Pre-EJB 3.0: The World That Was Mastering EJB3.0, Chap 2 10.2 Pre-EJB 3.0: The World That Was Dissect EJB 2.x Development Complexities Deployment Complexities Debugging and Testing Complexities

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean EJB Container Responsible for managing enterprise bean Transaction management Security Resource and life cycle management Remote accessibility Support for concurrent requests Clustering and load-balancing

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean Type of Bean Session beans model business processes Stateful & Stateless session bean Message-driven beans (MDBs) Similar to session beans, but driven by message Entity beans (deprecated) Model business data

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean RMI-IIOP: The Protocol of Bean EJB and Location Transparency JNDI is an enabler of location transparency Provides a standard API to access different kinds of naming and directory services within a java program Provides two API Naming API Directory API

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean The EJB 3.0 Simplified API No home and object interfaces No component interface Use of Java metadata annotations Simplification of APIs for accessing bean’s environment

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean Elimination of Home and Object Interface Pre EJB 3.0 The Home interface served as a factory for creating reference to the EJB Object. The EJB Object Interfaces was to provide client view for an EJB

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean Elimination of Component Interface Pre EJB 3.0 Components need to implement javax.ejb.SessionBean or javax.ejb.MessageDrivenBean Carried the various life cycle method

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean Use of Annotations Annotations are used to provide the additional context to program. Can be applied to various elements in Java Methods, variables, constructors, package declarations

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean Annotations and Bean Development EJB 3.0 is a mix of metadata tags and code structs

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean Annotations and Deployment Descriptions EJB 3.0 annotations can be used in lieu of deployment descriptors. Container Specific Deployment Description Describe the value-added services of container

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean The Good, Bad and Ugly of Deployment Annotation Convenient Place configuration along with the bean’s logic. Tricky When the bean provider and deployer is not the same person. Simplified Access to environment

Package and Deployment of the “New” Bean Mastering EJB3.0, Chap 3 Package and Deployment of the “New” Bean

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean Example of EJB 3.0 Bean The Business Interface

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean The Bean Class

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean The Deployment Descriptor

10.3 The New Enterprise JavaBean Mastering EJB3.0, Chap 3 10.3 The New Enterprise JavaBean The Client

Mastering EJB3.0, Chap 3

Summary of Term The enterprise bean instance The business interface A POJO contains business method implementation of local/remote business interface The business interface A plain old java interface that enumerates the business methods exposed by the enterprise bean. The deployment descriptor A XML file that specifies the middleware requirements of the bean The Ejb-jar file The package unit for enterprise bean The vendor-specific deployment descriptor Specify the bean’s need for proprietary container.

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI) Naming Service Associates names with objects Provides a facility to find an object with a name Directory Service A naming service that has been extended and enhanced to provide directory object operations to manipulating attribute

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI)

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI) Problems with Naming and Directory Different Directory vendors offer different types of services Lightweight Directory Access Protocol (LDAP) Network Information System (NIS) Network Directory System (NDS) What is JNDI A System for java client to access Naming and Directory systems Provide one common interface to disparate directories

Mastering EJB3.0, Appendix A Architecture

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI) JNDI in JavaEE Using JNDI to acquire a reference to the JTA User-Transaction interface Using JNDI to connect to resource factories, such as JDBC drivers or JMS drivers Using JNDI for clients and for beans to look up other beans

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI) JNDI Concepts Atomic Name A simple, basic, indivisible name In the string /etc/fstab, etc and fstab are atomic names Compound Name Zero or more atomic names put together using a specific syntax /etc/fstab is a compound name

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI) Binding An association of a name with a object Autoexec.bat  a file C:\windows  a folder /usr/people/ed/.cshrc  multiple bindings Context A set of zero or more bindings

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI) Naming System A connected set of contexts that use the same name syntax. Namespace The set of names contained in a naming system javax.naming.Name javax.naming.Context

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI)

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI)

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI) Composite Name A name that spans multiple naming systems http://java.sun.com/product/ejb/index.html Initial Context The starting point of exploring a namespace Initial Context Factory Be implemented by JNDI drivers churns out initial context javax.naming.InitialContext

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI)

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI) java.naming.factory.initial The name of the environment property for specifying the initial context factory to use java.naming.provider.url The name of the environment property for specifying the location of the JBoss JNDI service provider the client will use. java.naming.factory.url.pkgs The name of the environment property for specifying the list of package prefixes to use when loading in URL context factories.

10.4 The Java Naming and Directory Interface (JNDI) Mastering EJB3.0, Appendix A 10.4 The Java Naming and Directory Interface (JNDI) All the environment parameters can be put into jndi.properties file, found on classpath.

Mastering EJB3.0, Appendix A