Enterprise Java Beans.

Slides:



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

1 Copyright © 2005, Oracle. All rights reserved. Introduction.
11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
EJB Design. Server-side components Perform –complex algorithms –high volume transactions Run in –highly available environment (365 days/year) –fault tolerant.
Enterprise Java Beans Adam, Engels, Josh, Marc, Tim.
Application Server Lecture Paulo Barroso Kris Carver Todd Kitterman Eric Silva.
Copyright W. Howden1 Lecture 19: Intro to O/O Components.
Point Of Sale(POS) J2EE Application Department : Computer Science Degree : Master Student : Woojin Choi ID : (POS J2EE Application with JRun)
J2EE Kenneth M. Anderson CSCI Web Technologies October 3, 2001.
M.Sc. Course, Dept. of Informatics and Telecommunications, University of Athens S.Hadjiefthymiades “Web Application Servers” Basics on WAS WAS are necessary.
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 Overview Celsina Bignoli Distributed Business Applications Server DB Client DB Server DB.
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
1 J2EE Components. 2 Application Servers relieve the programming burden for business distributed components. They provide support for system level services.
Enterprise Java Beans CS-422. Application Servers In the late 1980s and though the mid 1990s a number of corporations (Broadvision, Netscape…) marketed.
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Container-Managed Persistence (CMP) Entity Beans Lesson 3A / Slide 1 of 42J2EE Server Components Objectives In this lesson, you will learn to: Identify.
1 Stateful Session Beans Stateless Session Beans Michael Brockway Sajjad Shami Northumbria University School of Computing, Engineering & Information Sciences.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
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.
Message-Driven Beans and EJB Security Lesson 4B / Slide 1 of 37 J2EE Server Components Objectives In this lesson, you will learn about: Identify features.
JBoss at Work JAW Motors Application Chapter 1-3 Jeff Schmitt October 9, 2006.
Java Server Pages A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format,
J2EE Structure & Definitions Catie Welsh CSE 432
Enterprise JavaBeans Understanding EJB Components Version 0.1 Kamal Wickramanayake
1 Architectural Overview For application developers, assembling enterprise beans requires little or no expertise in the complex system-level issues that.
1 Java EE Programming Enterprise JavaBeans. 2 Topics J2EE Overview Enterprise JavaBeans Overview Enterprise Entity Beans Case Study How to build them.
Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP.
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.
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.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
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.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 9 Case Study.
©NIIT Session Beans Lesson 1B/ Slide 1 of 37J2EE Server Components Objectives In this lesson, you will learn to: Describe the characteristics of session.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
J2EE Lecture 10: EJB 3.0 Overview
J2EE Platform Overview (Application Architecture)
Point Of Sale(POS) J2EE Application
Structure of a web application
Java Servlets By: Tejashri Udavant..
EJB (Enterprise Java Beans)
Introduction to J2EE Architecture
Enterprise Java Bean. Overview of EJB View of EJB Conversation Roles in EJB, Types of Enterprise Beans Lifecycle of Beans Developing Applications using.
Java Messaging Service (JMS)
J2EE Application Development
Introduction to Enterprise JavaBean
Distributed System Using Java 2 Enterprise Edition (J2EE)
Java Messaging Service (JMS)
Understanding and Designing with EJB
Luca Simone Software Engineering 2 a.a. 2001/2002
Objectives In this lesson, you will learn to:
Objectives In this lesson you will learn about: Need for servlets
Understanding and Designing with EJB
Enterprise Java Beans Bina Ramamurthy 1/13/2019 B.Ramamurthy.
Component-based Applications
Component Technology Bina Ramamurthy 2/25/2019 B.Ramamurthy.
Understanding and Designing with EJB
Seminarium on Component-based Software Engineering
Knowledge Byte In this section, you will learn about:
Objectives In this lesson, you will learn about:
Enterprise Java Beans.
Presentation transcript:

Enterprise Java Beans

What Are EJB’s? Enterprise Java Beans EJB: special kind of JavaBean for performing server-side business logic More powerful version of the regular beans

Where they fit in a system

Developing EJP

Create enterprise application project

Create your EJP

Put business logic into your EJP

Create servlet which will call your business logic

Define dependency between Servlet and EJP

Put controller logic into your servlet

Create JSP File

Fill JSP file with user interface code

Deploy and Run

What Are EJB’s? Enterprise Java Beans EJB: special kind of JavaBean for performing server-side business logic More powerful version of the regular beans that we’ve used in class

Where they fit in a system

EJB’s in J2EE

EJB Container Functions as a runtime environment for EJB components beans Containers are transparent to the client in that there is no client API to manipulate the container Container provides EJB instance life cycle management and EJB instance identification. Manages the connections to the enterprise information systems (EISs)

EJB Container(cont’d) Java Naming and Directory Interface, Enterprise Naming Context 

EJB Class A bean has a single Java class at its core This class is written by a developer if it’s a session bean This class is sometimes generated by a tool if it’s an entity bean Implements application-specific business logic Implements one of the following contracts: javax.ejb.EntityBean javax.ejb.SessionBean These contracts provide for consistent behavior when activating beans, passivating beans, reading data, writing data Every container can expect these methods in every bean

Three kinds of EJB’s Session associate client information with a specific client both stateless and stateful versions Entity groups associated information in an abstraction that provides transaction support Message Bean - rarely used, hardly supported

What is a Session Bean? Represents a single Client inside the J2EE server one client at a time/ not persistent when the client terminates, the session bean is disassociated from the client There are two types: Stateful and Stateless...

Stateful These represent a set of interactions between client and server. Example: shopping cart Saves information over several method invocations. There is a lot of overhead associated with using stateful beans

Stateless Beans A stateless bean does not save information between method calls. Limited application Little overhead multiple clients can use the same bean instance without alteration Example: fetch from a read-only database or send a confirmation email for an order

Entity Beans Associates pieces of information in a group Accessed by multiple clients at a time Persistent and Serializable The container loads and stores the entity beans in the database These are more similar to regular beans

More on Entity Beans Transactions: this is what makes an Entity Bean special. Entity beans rely on the container to enforce robust transactions example: Airline booking: if the flight booking action fails, then the credit card charge action fails, or vice versa.

Persistence in Entity Beans Container managed persistence the container controls when the bean is read from or written to the database Bean managed persistence the bean’s implementation performs all of the sql operations that loads, stores, and updates the bean’s data to or from the database. Bean is responsible for connection allocation to the database

Connection Pooling Setting up connections to the database is resource intensive Connection pooling maintains a pool of database connections for the entity beans so that the connection is maintained when a bean finishes, and is available for other entity beans. Specific to database and EJB container implementation

Message Beans A message bean is an enterprise bean that allows J2EE applications to process messages asynchronously. It acts as a JMS message listener, which is similar to an event listener except that it receives messages instead of events. Many systems do not yet support JMS, message bean use is currently not widespread

Using an Entity bean from a Session bean An entity bean can be shared by multiple sessions. This allows for data encapsulation; clients can interact with data via session beans within transaction boundaries. Can do all database interaction from session bean as an alternative encapsulation is weakened

Using EJB’s

An EJB Example... Online Banking Application Demonstrates how all the component technologies--enterprise beans, J2EE application clients, and Web components fit together

Online Banking Application Two clients: a J2EE application client used by administrators to manage customers and accounts Web client used by customers to access account histories and perform transactions. The clients access the customer, account, and transaction information maintained in a database through enterprise beans.

Online Bank Application Overview

Session beans used The online bank application has three session beans: AccountControllerEJB, CustomerControllerEJB, and TxControllerEJB. These session beans provide a client's view of the application's business logic. Hidden from the clients are the server-side routines that implement the business logic, access databases, manage relationships, and perform error checking.

Entity Beans used For each business entity represented in our simple bank, the bank application has a matching entity bean: AccountEJB, CustomerEJB, TxEJB The purpose of these beans is to provide an object view of these database tables: account, customer, and tx. For each column in a table, the corresponding entity bean has an instance variable. Because they use bean-managed persistence, the entity beans contain the SQL statements that access the tables. For example, the create method of the CustomerEJB entity bean calls the SQL INSERT command.

Database

JAR FILE Packaging EJB Components An EJB application and its various components are deployed and distributed in the form of packages. The process of packaging: Enables you to handle and use multiple files related to one EJB component, simultaneously. Saves disk space by compressing files. The EJB components of an EJB application are packaged into Java Archive (JAR) files and the Web components are packaged into Web Archive (WAR) files.

The components of an enterprise bean are packaged as an ejb-jar file. The various component files that are packaged into an ejb-jar file are: Bean class file Remote interface file Local interface file Local home interface file Home interface file Deployment descriptor file