EJB Fundamentals Celsina Bignoli

Slides:



Advertisements
Similar presentations
11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
Advertisements

Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Remote Method Invocation
Enterprise JavaBeans Ruslana Svidzinska CSE690. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports.
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D.
June 1999 EJB1 EJB and CHAIMS Dorothea Beringer Enterprise Java Beans and how to build a CHAIMS infrastructure using the EJB paradigm.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
Introduction to Enterprise JavaBeans. Integrating Software Development Server-side Component Model Distributed Object Architecture –CORBA –DCOM –Java.
Overview of The Java Platform Solution for E-Business Applications : JSP, Servlet and EJB.
EJB Design. Server-side components Perform –complex algorithms –high volume transactions Run in –highly available environment (365 days/year) –fault tolerant.
Enterprise Java Beans Welcome to the world of “Distributed System” Presented By: Sameer Nanda Date: 12/17/03.
Copyright W. Howden1 Lecture 19: Intro to O/O Components.
Introduction to Remote Method Invocation (RMI)
How Does Remote Method Invocation Work? –Systems that use RMI for communication typically are divided into two categories: clients and servers. A server.
Communication in Distributed Systems –Part 2
J2EE Kenneth M. Anderson CSCI Web Technologies October 3, 2001.
15 - RMI/EJBCSC4071 Distributed Objects Java Remote Method Invocation Enterprise Java Beans.
1 J2EE Components. 2 Application Servers relieve the programming burden for business distributed components. They provide support for system level services.
1 Session Bean Chuyên đề Lập trình Java & J2EE Chương 14 Biên soạn: Th.S Nguyễn văn Lành.
J2EE Part 2: Enterprise JavaBeans CSCI 4300 Images and code samples from jGuru EJB tutorial,
EJB Enterprise Java Bean.
CORBA Celsina Bignoli Enterprise Computing Corporation have similar computing environments: –mixed set of HW platforms –a mixed set.
Entity Beans BMP Celsina Bignoli
Advanced Java Session 7 New York University School of Continuing and Professional Studies.
© jGuru.com Enterprise JavaBeans Fundamentals.
Enterprise JavaBeans Umer Farooq CS6704: Design Patterns & Component FrameworksFebruary 25, 2002.
Enterprise Java Beans Part II Kyungmin Cho 2001/04/13.
The Triad of Beans I Oleh: Dini Addiati ( ) Fahrurrozi Rahman ( Y) Irfan Hilmy ( ) Salman Azis A ( ) Aziiz Surahman.
Presented By Pradeep K Sahu. What will be the Contents of the Seminar ? What is EJB ? EJB Architecture Types of EJB Session Entity Why EJB ? Writing a.
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.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
1 Modeling Server-side Components with UML Junichi Suzuki, Ph.D. School of Information and Computer Science University.
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Structure & Definitions Catie Welsh CSE 432
Enterprise Java Beans Java for the Enterprise Server-based platform for Enterprise Applications Designed for “medium-to-large scale business, enterprise-wide.
Enterprise JavaBeans Understanding EJB Components Version 0.1 Kamal Wickramanayake
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Remoting Simplifying.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Introduction to Enterprise JavaBeans Topics In Systems Architecture Barry Herbold
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
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.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Enterprise Java Beans N.V.RAJASEKHAR REDDY. Definition of EJB EJBs are the components that are the set of classes and interfaces deployed within a container.
Copyright © 2002 ProsoftTraining. All rights reserved. Enterprise JavaBeans.
13 Copyright © 2004, Oracle. All rights reserved. Managing Persistent Data in the Business Tier Entity EJBs.
Remote Method Invocation A Client Server Approach.
©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.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
Java RMI. RMI Any object whose methods can be invoked from another Java VM is called a remote object.
Middleware Technology (J2EE/EJB) EJB Fundamentals.
Advanced Java Session 7 New York University School of Continuing and Professional Studies.
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.
14 Copyright © 2004, Oracle. All rights reserved. Achieving State Management in the Business Tier.
©NIIT Session Beans Lesson 1B/ Slide 1 of 37J2EE Server Components Objectives In this lesson, you will learn to: Describe the characteristics of session.
Java Distributed Computing
EJB Architecture and Design
Remote Method Invocation
What is RMI? Remote Method Invocation
Structure of Enterprise Java Beans
Introduction to Enterprise JavaBean
Component--based development
Enterprise Java Beans.
Presentation transcript:

EJB Fundamentals Celsina Bignoli

Enterprise Bean Server-side software component that can be deployed in a distributed multi-tier environment Must conform to the EJB specification –Must expose specific methods –Methods are used by the EJB container (Application Server) to manage the bean

Types of Beans Session Beans –Model business processes –Ex: pricing engine, catalog engine, credit card authorizer Entity Beans –Model business data –Ex: product, order, employee Message-driven Beans –Similar to session beans –Can only be called implicitly via messages –Ex: beans that receive credit card authorization messages

Distributed Objects EJB components are based on distributed objects A distributed object is an object that is callable from a remote system –In-process client –Out-process client –Client located elsewhere on the network

Distributed Objects Client StubSkeleton Implementation Object Network Remote Interface

Distributed Objects(2) Stub: client-side proxy object –Masks network communications from the client –Knows how to call over the network using sockets –Knows how to convert parameters into their network representation Skeleton: server-side proxy object –Masks network communication from the distributed object –Understands how to receive calls on a socket –Knows how to convert parameters from their network representation to their Java representation

Distribution Transparency The stub, skeleton and implementation object together constitute the abstraction known as distributed object The client has the impression it is calling the object directly – instead, it calls an empty stub which knows how to go over the network The stub clones the implementation object signatures (both implement same interface) Can be achieved using several technologies (CORBA, DCOM, RMI-IIOP)

Middleware Distributed objects allow to distribute an application across a network. They require middleware services Explicit Middleware –Difficult to write Requires unnecessary large amounts of code –Difficult to maintain Need to write new code to accomplish changes –Difficult to support Code is not distributed to clients Clients cannot make changes

Middleware(2) Implicit Middleware –Easy to write No middleware code Declare things in a text file (descriptor file) –Easy to maintain Separation between business logic and middleware Changes to middleware do not require changes to code –Easy to support Changes can be accomplished by tweaking descriptor file

Enterprise Bean Class Contains implementation details of the component (i.e. the logic) It is a Java class that conforms to a well- defined interface and obeys certain rules All beans implement the javax.ejb.EnterpriseBean java.io.Serializable javax.ejb.EnterpriseBean javax.ejb.SessionBean javax.ejb.MessageDrivenBean javax.ejb.EntityBean

The EJB Object Surrogate object that knows about networking, transactions, security etc… It is request interceptor, or glue between the client and the bean Replicates and exposes every method that the bean itself exposes Delegates client requests to beans Each container generates automatically a vendor specific EJB class object

The Remote Interface Special interface created by the Bean Provider Must comply with special rules defined by the EJB specification –Must derive from javax.ejb.EJBObject –Must duplicate the bean’s business methods Client code does not call the bean object directly but the EJBObject methods. When the client invokes a business object method the EJB object delegates the method to the bean, where the actual implementation of the method resides

The Remote Interface public interface javax.ejb.EJBObject extends java.rmi.Remote { public javax.ejb.EJBHome getEJBHome() throws java.rmi.RemoteException; public java.jang.Object getPrimaryKey() throws java.rmi.RemoteException; public void remove() throws java.rmi.RemoteException, javax.ejb.RemoveException; public javax.ejb.Handle getHandle() throws java.rmi.RemoteException; public boolean isIdentical(javax.ejb.EJBObject) throws java.rmi.RemoteException; }

The Home Object Create EJB objects –Clients cannot instantiate EJB objects directly because EJB objects might reside on a different machine Finds existing EJB objects Remove EJB objects Home objects are specific to the container therefore they are automatically generated by the container

The Home Interface Define methods for creating, finding and destroying EJB objects The container’s home Object implement the (user-defined) Home Interface javax.ejb.EJBHome define required methods all Home Interfaces must support

Home Interface public interface javax.ejb.EJBHome extends java.rmi.Remote { public EJBMetaData getEJBMetaData() throws java.rmi.RemoteException; public javax.ejb.HomeHandle getHomeHandle() throws java.rmi.RemoteException; public void remove(javax.ejb.Handle handle) throws java.rmi.RemoteException, javax.ejb.RemoveException; public void remove(Object primaryKey) throws java.rmi.RemoteException, javax.ejb.RemoveException; }

The Local Interfaces Used to improve performance. Similar to the remote interfaces and objects except they are local, therefore eliminate some tasks only work when calling beans in the same process.

Deployment Descriptor File key to implicit middleware used by the container to determine what services to provide for the bean Used to specify bean requirements –bean management and lifecycle –persistence –transaction –security

Ejb-jar File compressed file that follows the.zip compression format Home InterfacesLocal InterfacesEnterprise Bean Classes Remote InterfacesDeployment Descriptor Vendor-specific files Jar File Creator EJB Jar File