Chapter 6 Enterprise Java Beans

Similar documents
CO Java EE 7: Back-End Server Application Development

NetBeans IDE Field Guide

EJB ENTERPRISE JAVA BEANS INTRODUCTION TO ENTERPRISE JAVA BEANS, JAVA'S SERVER SIDE COMPONENT TECHNOLOGY. EJB Enterprise Java

Deccansoft Software Services. J2EE Syllabus

Introduction. Enterprise Java Instructor: Please introduce yourself Name Experience in Java Enterprise Edition Goals you hope to achieve

Java Enterprise Edition

Vision of J2EE. Why J2EE? Need for. J2EE Suite. J2EE Based Distributed Application Architecture Overview. Umair Javed 1

Overview p. 1 Server-side Component Architectures p. 3 The Need for a Server-Side Component Architecture p. 4 Server-Side Component Architecture

Course Content for Java J2EE

Enterprise JavaBeans (I) K.P. Chow University of Hong Kong

presentation DAD Distributed Applications Development Cristian Toma

Oracle 10g: Build J2EE Applications

Building the Enterprise

J2EE - Version: 25. Developing Enterprise Applications with J2EE Enterprise Technologies

Understanding and Designing with EJB

UNIT-III EJB APPLICATIONS

Implementing a Web Service p. 110 Implementing a Web Service Client p. 114 Summary p. 117 Introduction to Entity Beans p. 119 Persistence Concepts p.

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

Multi-tier architecture performance analysis. Papers covered

Enterprise Java and Rational Rose -- Part I

Component-Based Software Engineering. ECE493-Topic 5 Winter Lecture 26 Java Enterprise (Part D)

Outline. Project Goal. Overview of J2EE. J2EE Architecture. J2EE Container. San H. Aung 26 September, 2003

index_ qxd 7/18/02 11:48 AM Page 259 Index

Enterprise JavaBeans TM

Java EE 7: Back-End Server Application Development

JVA-163. Enterprise JavaBeans

Distributed Multitiered Application

In the most general sense, a server is a program that provides information

SCBCD EXAM STUDY KIT. Paul Sanghera CX JAVA BUSINESS COMPONENT DEVELOPER CERTIFICATION FOR EJB MANNING. Covers all you need to pass

Java- EE Web Application Development with Enterprise JavaBeans and Web Services

A General ecommerce Platform with Strong International and Local Aspects

CMP 436/774. Introduction to Java Enterprise Edition. Java Enterprise Edition

Enterprise JavaBeans. Layer:01. Overview

Projects. How much new information can fit in your brain? Corporate Trainer s Profile TECHNOLOGIES

TOPLink for WebLogic. Whitepaper. The Challenge: The Solution:

Oracle9iAS Tech nicaloverview

Distributed Applications (RMI/JDBC) Copyright UTS Faculty of Information Technology 2002 EJB EJB-3

Chapter 10 DISTRIBUTED OBJECT-BASED SYSTEMS

Application Servers in E-Commerce Applications

Enterprise Java Unit 1-Chapter 2 Prof. Sujata Rizal Java EE 6 Architecture, Server and Containers

(9A05803) WEB SERVICES (ELECTIVE - III)

SUN Sun Certified Enterprise Architect for J2EE 5. Download Full Version :

Web Design and Applications

Vendor: SUN. Exam Code: Exam Name: SUN Certified ENITRPRISE ARCHITECT FOR J2EE(tm)TECHNOLOGY. Version: Demo

Programming Web Services in Java

CAS 703 Software Design

Advanced Topics in Operating Systems

J2EE Interview Questions

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR (ODD SEMESTER) QUESTION BANK

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module

The Developer s Guide to Understanding Enterprise JavaBeans. Nova Laboratories

Web Design and Applications

Java Training For Six Weeks

The Details of Writing Enterprise Java Beans

~ Ian Hunneybell: CBSD Revision Notes (07/06/2006) ~

Fast Track to EJB 3.0 and the JPA Using JBoss

Enterprise JavaBeans, Version 3 (EJB3) Programming

Borland Application Server Certification. Study Guide. Version 1.0 Copyright 2001 Borland Software Corporation. All Rights Reserved.

Master Thesis An Introduction to the Enterprise JavaBeans technology and Integrated Development Environments for implementing EJB applications

Java J Course Outline

Enterprise Java Beans

Appendix A - Glossary(of OO software term s)

Active Endpoints. ActiveVOS Platform Architecture Active Endpoints

Problems in Scaling an Application Client

It Is a Difficult Question! The Goal of This Study. Specification. The Goal of This Study. History. Existing Benchmarks

JAVA & J2EE UNIT -1 INTRODUCTION

Enterprise Java Security Fundamentals

Stateless Session Bean

1Z Oracle. Java Enterprise Edition 5 Enterprise Architect Certified Master

Advanced Java Programming

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Oracle EXAM - 1Z Java EE 6 Enterprise JavaBeans Developer Certified Expert Exam. Buy Full Product.

SUN Enterprise Development with iplanet Application Server

Java EE 6: Develop Business Components with JMS & EJBs

Designing a Distributed System

Exam Questions 1Z0-895

Oracle - Developing Applications for the Java EE 7 Platform Ed 1 (Training On Demand)

Introduction to componentbased software development

DESIGN PATTERN - INTERVIEW QUESTIONS

BEA WebLogic Server. and BEA WebLogic Express. Introduction to BEA WebLogic Server 6.1

Chapter 1 Introducing EJB 1. What is Java EE Introduction to EJB...5 Need of EJB...6 Types of Enterprise Beans...7

The team that wrote this redbook

IBM. Enterprise Application Development with IBM Web Sphere Studio, V5.0

Exam Actual. Higher Quality. Better Service! QUESTION & ANSWER

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP

Using JNDI from J2EE components

Java EE Patterns 176

Data Management in Application Servers. Dean Jacobs BEA Systems

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Writing Portable Applications for J2EE. Pete Heist Compoze Software, Inc.

Erik Dörnenburg JAOO 2003

PLATFORM TECHNOLOGY UNIT-5

BEAWebLogic. Server. Introduction to WebLogic Server and WebLogic Express. Version 8.1 Revised: June 28, 2006 Part Number:

Commercial Component Creation (EJB 2.0)

Fast Track to Java EE

J2EE Application Server. EJB Overview. Java versus.net for the Enterprise. Component-Based Software Engineering. ECE493-Topic 5 Winter 2007

IBD Intergiciels et Bases de Données

Enterprise JavaBeans (EJB) security

Developing Applications with Java EE 6 on WebLogic Server 12c

J2EE 1.4. Magnus Larsson. Callista Enterprise AB.

Transcription:

Chapter 6 Enterprise Java Beans Overview of the EJB Architecture and J2EE platform The new specification of Java EJB 2.1 was released by Sun Microsystems Inc. in 2002. The EJB technology is widely used for large scale distributed applications where the resources, data, and users are distributed. Such distributed applications usually require system scalability and transaction managements for data integrity. An EJB component is a reusable, WORA (Write Once Run Anywhere), portable, scalable, and compiled software component which can be deployed on any EJB servers such as Java 2 Platform Enterprise Edition (J2EE), JBoss, and WebLogic Enterprise environment. The Java EJB technology is part of J2EE which provides a set of APIs, and other system services. The EJB implementations concentrate on business logic. J2EE is a enterprise reference architecture for Java enterprise applications. J2EE not only supports EJB components but also supports other Web components such as JSP and Servlets.

Overview of the EJB Architecture and J2EE platform (cont.) The EJB architecture makes Web enterprise application development much easier because most of system level services such as transaction management, security management, and multithreading management are supported by the EJB container instead of applications themselves. The EJB architecture also manages the EJB component lifecycle from the creation to the termination including activation and deactivation of an EJB component. An EJB component is a server side component which provides services to remote Web clients or local and remote application clients.

Overview of the EJB Architecture and J2EE platform (cont.) Web clients access this application via a Web browser in the client tier; The services may be provided by Java Servlets or JSPs on Web servers in the Web tier; The Servlets or JSPs need to access services provided by EJB beans located on remote distributed application servers in the business tier; The business tier is supported by databases in the Enterprise Information System (EIS) data tier. The Web servers, application servers, and data servers may be all located in different locations connected by Internet. The EJB technology is suitable for developments of very large and complex distributed applications such as business to business (B2B).

Overview of the EJB Architecture and J2EE platform (cont.) J2EE EJB architecture

EJB Container All EJB instances are running within the EJB container. The container is a runtime environment (set of classes generated by deployment) that controls an EJB component instance and provides all necessary management services for its whole lifetime. Below is a list of such services: Transaction management: ensuring transaction properties of multiple distributed transaction executions. Persistence management: ensuring a persistent state of an entity bean that is backed up by database. Life cycle management: ensuring the EJB component state transitions in its life cycle. Security management: authentication and authorization services, integrity, and encryption management.

EJB Container (cont.) All access requests to the EJB component and responses from the EJB component must get through the EJB container. The EJB container is a run time environment which isolates EJB component from direct access by its clients. The container will intercept the invocation from clients to ensure the persistence, properties of transaction, security of client operations on EJB.

EJB Container (cont.) The EJB container supports all services EJB components need and an EJB component needs the container to reach outside and to obtain necessary information from its context interface. The EJB container is in charge of generating an EJB home object, which helps to locate, create, and remove the EJB component object. The EJB context interface provided by the EJB container encapsulates relevant information of the container environment and initialization parameters.

EJB Components An enterprise bean is a distributed server component that lives in an EJB container and is accessed by remote clients over network via its remote interface or is accessed by other local enterprise beans on the same server via its local interface. The EJB component is a remotely executable component deployed on its server and it is a selfdescriptive component specified by its Deployment Descriptor (DD) in a XML format. Each EJB component has a business logic interface that clients can run the business logic operations via this interface without knowing the detail implementation behind the interface.

EJB Components (cont.) We call such interface as a remote or local interface. An instance of an EJB component is created and managed by its factory named home interface on the EJB container. Every enterprise bean must have a home interface and a remote (local) interface. The EJB component can be configured at the deployment time by specifying its deployment descriptor.

EJB Components (cont.) The EJB classes behind home and remote (or local) interfaces are the implementations of these two interfaces. An EJB component is a black-box component. A client of an EJB component only knows what the component does but not how it does. A client makes a request to an EJB component with its deployed name by looking up at JNDI to get an Object Reference (OR) of this EJB component.

EJB Components (cont.) The client can then create an instance of this EJB component on the server according to the reference. Finally, the client invokes the business methods of this EJB instance. The EJB class may also locate and access other EJB beans at remote sites by using EJB context information. The message driven bean is an exception which does not have any interface like the home and remote interfaces that a classic EJB has.

1.Lookup( EJB ) JNDI Registers with Client 2,Create() 3. Invoke method EJB Home Interface EJB Object Interface New() EJB Class EJB Context EJB container (security, transaction, life cycle, persistence) EJB Server The Client access to EJB on server

EJB Components (cont.) The EJB technology supports the following enterprise bean categories: Session Bean Stateless session beans that implement various business logics, such as language translation, logon process, tax calculation, and currency conversion Stateless session beans that is wrapped in a Web service Any existing enterprise bean can be encapsulated in an external web service by a WSDL document which describes the web service endpoint of the bean implementations. Such special bean does not provide interfaces that a regular EJB component provides. Stateful session beans, which play the same roles as stateless session beans except they keep tracking the states of the conversation during a session. For instance, a shopping cart bean can be a typical stateful session bean. A session bean does not have its permanent state.

Entity Bean Bean Managed Persistence (BMP) entity beans, where persistent storage management (JDBC SQL) is coded by bean developers.. Container Managed Persistence (CMP) entity beans, where the persistent storage management is specified by the deployment tool and managed by the container. An entity bean is backed up by a relational database.

Message-Driven Beans (MDB) MDB represents a new EJB component type that works in an asynchronous communication mode just like an event-driven delegation model in Java. EJB interfaces

Message-Driven Beans (MDB) (cont.) The Remote interface of an EJB component implements javax.ejb.ejbobject interface which in turn implements java.rmi.remote interface. The Home interface of an EJB component implements javax.ejb.ejbhome interface which again implements java.rmi.remote interface. A local interface implements javax.ejb.ejblocalobject interface and a local home interface implements javax.ejb.ejblocalhome interface. The local interface is used by another EJB component running on the same server so that it can reduce the overhead caused by remote access.

Message-Driven Beans (MDB) (cont.) The remote interface provides the location independence but it is more expensive since it must provide stub and skeleton to support the remote communications. The local interface makes invocation much more efficient than remote. Another important difference between local and remote interfaces is that method invocation in local interface uses passing by reference and the method invocation in remote interface uses passing by value which needs serialization, i.e., marshaling and unmarshaling.

The EJB implementation class implements either sessionbean or entitybean interface, both of that implement EnterpriseBean interface EJB implementation class hierarchy