J2EE Part 2: Enterprise JavaBeans CSCI 4300 Images and code samples from jGuru EJB tutorial,

Slides:



Advertisements
Similar presentations
12 Copyright © 2005, Oracle. All rights reserved. Implementing Business Tasks with Session EJBs.
Advertisements

11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
Technische universität dortmund Service Computing Service Computing Prof. Dr. Ramin Yahyapour IT & Medien Centrum 12. November 2009.
Development and Deployment Roles Venugopal Pakanati.
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.
Universität Bonn, Seminar Softwaretechnologie SS 2003, Duc Luu 1 Topics: Java Remote Method Invocation (RMI) Enterprise JavaBeans (EJB) Overview.
Enterprise Java Beans Adam, Engels, Josh, Marc, Tim.
Enterprise Java Beans Welcome to the world of “Distributed System” Presented By: Sameer Nanda Date: 12/17/03.
Application Server Lecture Paulo Barroso Kris Carver Todd Kitterman Eric Silva.
Copyright W. Howden1 Lecture 19: Intro to O/O Components.
SEI/CBS Initiative Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department of Defense © 1999.
J2EE Kenneth M. Anderson CSCI Web Technologies October 3, 2001.
Emmanuel Cecchet et al.  Performance Scalability of J2EE application servers.  Test effect of: ◦ Application Implementation Methods ◦ Container Design.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
EJB Fundamentals Celsina Bignoli
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
Brad Rippe Fullerton College. What you need to get started? JDK 1.3 standard for compilation J2EE - SDK1.2.1 App Server - An EJB Container/Web Container.
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.
Enterprise Java Beans - (EJB)
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Seminar: Enterprise JavaBeans. Agenda Agenda Java™ 2 Platform Java™ 2 Platform Java™ 2 Platform,Enterprise Edition(J2EE) Java™ 2 Platform,Enterprise Edition(J2EE)
Writing Enterprise Applications with J2EE (Second lesson) Alessio Bechini June 2002 (based on material by Monica Pawlan)
Advanced Java Session 7 New York University School of Continuing and Professional Studies.
© jGuru.com Enterprise JavaBeans Fundamentals.
Entity Java Beans Jorg Janke Open Source ERP & CRM.
Container-Managed Persistence (CMP) Entity Beans Lesson 3A / Slide 1 of 42J2EE Server Components Objectives In this lesson, you will learn to: Identify.
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.
Enterprise Java Bean Computer Networks Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University.
Session Beans -) stateless -) stateful. Session Beans A session bean represents a single client inside the J2EE server. To access an application that.
A TUTORIAL TO USING EJBs by SHREERAM IYER 09/17/2001.
Enterprise JavaBeans Understanding EJB Components Version 0.1 Kamal Wickramanayake
© jGuru.com Enterprise JavaBeans Fundamentals.
© jGuru.com Enterprise JavaBeans Fundamentals.
20 September 2007Kaiser: COMS W4156 Fall COMS W4156: Advanced Software Engineering Prof. Gail Kaiser
Introduction to Enterprise JavaBeans Topics In Systems Architecture Barry Herbold
Entity Beans & Persistence Chris Alexander CS 486 Spring 2001.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Session Beans Based on: Patel, Brose, Silverman, Mastering Enterprise JavaBeans 3.0.
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.
©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.
Middleware Technology (J2EE/EJB) EJB Fundamentals.
Advanced Java Session 7 New York University School of Continuing and Professional Studies.
Enterprise JavaBeans™ Trademark of Sun Microsystems, Inc.
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.
Structure of Enterprise Java Beans
J2EE Application Development
Introduction to Enterprise JavaBean
Objectives In this lesson, you will learn to:
Enterprise Java Beans Bina Ramamurthy 1/13/2019 B.Ramamurthy.
Understanding and Designing with EJB
Enterprise Java Beans Bina Ramamurthy 4/5/2019 B.Ramamurthy.
Enterprise Java Beans.
Presentation transcript:

J2EE Part 2: Enterprise JavaBeans CSCI 4300 Images and code samples from jGuru EJB tutorial,

EJB container Created by an application server program We use SUN Application Server on zion.cs.uga.edu Must write EJB to specified interfaces

EJB Interfaces Client: a Java program (servlet, bean) Home interface: local object Remote interface: access the actual EJB, possibly across a network

EJB Interface example CustomerHome home = //... // Use the home interface to create a new instance of the Customer bean. Customer customer = home.create(customerID); // using a business method on the Customer. customer.setName(someName);

Entity beans represent data objects: import javax.ejb.EJBObject; import java.rmi.RemoteException; public interface Customer extends EJBObject { public Name getName() throws RemoteException; public void setName(Name name) throws RemoteException; public Address getAddress() throws RemoteException; public void setAddress(Address address) throws RemoteException; }

Session Beans represent business processes: public interface HotelClerk extends EJBObject { public void reserveRoom(Customer cust, RoomInfo ri, Date from, Date to) throws RemoteException; public RoomInfo availableRooms( Location loc, Date from, Date to) throws RemoteException; }

An Entity Bean class The Bean class actually implements the EntityBean interface (business logic) For example, maintains a database connection for customer info Client reads and writes the bean, and does not need to do DB access

EJB lifecycle methods (home interface) public interface CustomerHome extends EJBHome { public Customer create(Integer customerNumber) throws RemoteException, CreateException; public Customer findByPrimaryKey( Integer customerNumber) throws RemoteException, FinderException; public Enumeration findByZipCode(int zipCode) throws RemoteException, FinderException; } -- these return instances of Customer, the remote interface

Stub and Skeleton Methods Stub method on local system represents the remote object Skeleton method on remote system represents the local client

Container-Managed Persistence Persistence: arranging that data stored will be available in a later session Container-Managed Persistence: EJB container automatically saves EntityBean contents to a database and restores on demand Developer writes no DB code! Easiest for developer, hardest for EJB container

EntityBean creation code

EntityBean business logic

EntityBean Callback methods

Customer Data Members

Serializable objects Serializable: an object can be saved to a string and correctly restored from the string A class whose data members are primitive values is automatically serializable Classes that use trees, etc. can be made serializable:

Automatically generated SQL for this EntityBean:

Bean-Managed persistence The entity bean itself must contain the DB code to: Store the bean data contents into the database Restore the bean from its stored contents These methods invoked as callbacks from the EJB container

Stateless Session Beans Represent business processes (transactions) Contain no persistent data Shared among multiple clients

Acme SessionBean creation JNDI: Java Directory and Naming Interface (find objects in a networked environment) InitialContext: provided by EJB container, gives JNDI access

Acme SessionBean operations Normally, we would open an output stream and write the request to the server!

EJB Descriptor

Assembly descriptor

EJB Deployment The EJB jar file contains: Home interface class Remote interface class Bean implementation class META-INF/ejb-jar.xml Then, drop it into the JBOSS deploy directory!

WAR and EAR files Buildfile source: