SlideShare a Scribd company logo
1 of 24
Download to read offline
Introduction to Enterprise Java
Beans [EJB]
Lecture Series Under IFS-PERA collaboration
[2010]
Tharindu Weerasinghe [MSc.Eng, BSc.Eng (Hons), MIEEE, AMIESL]
Software Engineer, IFS R&D International
© 2010 IFS
EJB Framework - Overview
What is EJB?
❑ Enterprise Java Beans are the Java EE server
side components that run inside the EJB container
and encapsulates the business logic of an
enterprise application.
❑It is an architecture for server-side component
based distributed applications written in Java.
Basic EJB Environment
Contents of the EJB environment
➢ The EJB components are running inside the container of an
EJB server.
➢ The container has the connection to the database or to
other components.
➢ An EJB client can access the EJBs from the same Java
Virtual Machine (JVM) or from another JVM over remote
interfaces. The EJB home component is comparable to a
factory for the EJB objects. The EJB objects retrieved from the
home components can be also local or remote objects.
Why EJB ?
➢Numerous Web sites are up and running using Java without
any EJB technology. Developers have been using servlet/JSP
models and managing transactions themselves using commit
and rollback functionality that is built into JDBC without the
help of application servers.
➢But when doing so, the application developers are
confronted with many challenges. Some of the most important
ones are managing concurrency, persistence and
transactions. As a result, the developers have to either
develop proprietary code or buy supporting frameworks.
Why EJB ?
➢Above problems are solved by using enterprise beans.
The use of enterprise beans allow developers to focus on
the business logic and release them from coding
infrastructure and middleware logic, and developers
become more productive and efficient.
Benefits of EJB
➢EJB container provides the system-level services (like
transaction management and security authorization) to the
enterprise beans. These services simplifies the development
process of large and distributed applications and the
developer just have to concentrate on solving the problem
occurred in it.
➢The client developer can focus only on the representation
style of the client as all the business logic of the application is
contained in the enterprise beans. The client developer does
not bother about the code that implements business logic or
the logic to access the databases. This means that the
clients are thinner. It benefits the client to be thin because
the client runs on the small devices.
When to use EJB?
Applications developed by using the EJB, deal with a variety of
clients, simply by writing few lines of code, the client can
locate the enterprise beans. The client locating the enterprise
bean may be various, numerous and thin.
Enterprise beans support transaction to ensure the integrity of
the database. Transaction is the mechanism of managing the
concurrent access of shared objects.
Managing the fast growing number of users requires
distributed application components across multiple machines
means that the application must be scalable.
EJB Roles
Bean provider
The bean provider is the developer of the code, and is
responsible for converting the business requirements into
actual physical code. He or she must provide the necessary
classes that constitute an EJB, as well as providing the
deployment file describing the runtime settings for the bean.
The bean provider’s final product is an EJB JAR file.
(Most of you guys/gals fall into this category ☺)
EJB Roles
Application assembler
This may be the same as the bean provider, or a senior team
lead. The application assembler’s responsibility is to package
all the different EJB components, along with any other
application components, the final product being an enterprise
application EAR file.
Deployer
This person is responsible for deploying the EJB application on
the target runtime environment. The deployer should be
familiar with all aspects of the environment, including
transaction and security support.
EJB Roles
Server provider
The job of the server provider is to provide a runtime EJB
server environment that is compliant with the EJB
specification. IBM is a server provider of the WebSphere
Application Server.
Container provider
The job of the container provider is to provide a runtime EJB
container environment that is compliant with the EJB
specification, and is generally the same as the server provider.
The server and container cooperate to provide the quality-of-
service runtime environment for the EJBs.
EJB Roles
Systems administrator
The system administrator’s task is to ensure that the runtime
environment is configured in such a way that the application
can function correctly, and is integrated with all of the required
external components.
MAIN EJB FRAMEWORK COMPONENTS
❑EJB server
Provides the actual primary services to all EJBs. An EJB server
may host one or more EJB containers. It is also called
generically an Enterprise Java Server (EJS). WebSphere
Application Server is an EJS.
❑EJB container
Provides the runtime environment for the enterprise bean
instances, and is the intermediary between the EJB
component and the server.
MAIN EJB FRAMEWORK COMPONENTS
❑ EJB component
These represent the actual EJBs themselves. There are three
types of enterprise beans: entity, session, and message-driven
beans.
❑EJB interfaces and EJB bean
The interfaces for client access (EJB home and EJB object)
and the EJB bean class.
MAIN EJB FRAMEWORK COMPONENTS
❑EJB deployment descriptor
The descriptor defines the runtime quality of service settings
for the bean when it is deployed. Many of the settings of an
EJB, such as the transactional settings, are defined in the
deployment descriptor. The deployment descriptor is an
external entity from the bean, and therefore decouples the
bean component itself from the runtime characteristics.
❑EJB client
A client that accesses EJBs.
WE TALK MORE ON
EJB COMPONENTS
© 2009 IFS
EJB COMPONENTS
❑The EJB components refer to the beans themselves, and
include all the classes, interfaces, and constructs that make
up the enterprise bean.
❑There are three types of enterprise beans:
➢Entity
➢Session
➢Message-driven
❑The rules for bean construction (which interfaces to use,
classes to extend, and so forth) are governed by the type of
bean, so a quick introduction to the types of enterprise beans
is presented here.
MAIN EJB FRAMEWORK COMPONENTS
EJB TYPES
❑Entity Beans:
Entity beans are modeled to represent business or domain-
specific concepts, and are typically the nouns of your system,
such as customers and accounts. They usually represent data
(entities) stored in a database.
❑Session Beans:
A session bean is modeled to represent a task or workflow of a
system, and provide coordination of those activities between
beans, such as a banking service, allowing for a transfer
between accounts.
EJB TYPES
Session beans have two types:
1. Stateful Session Beans
2. Stateless Session Beans
❑Message-driven beans
Like session beans, message-driven beans (MDB) may also be
modeled to represent tasks. However, they are invoked by the
receipt of asynchronous messages. The bean either listens for
or subscribes to messages that it is to receive.
SYNCHRONOUS VS ASYNCHRONOUS INVOCATION
Entity and Session beans are accessed synchronously through
a remote or local EJB interface method invocation. This is
referred to as synchronous invocation, because there is a
request, and a (blocking) wait for the return.
Clients of EJBs invoke methods on session and entity beans.
An EJB client may be an external construct like a servlet
(remote) or another EJB within the same JVM (local).
SYNCHRONOUS VS ASYNCHRONOUS INVOCATION
The Message-driven bean is not accessible through a remote
or local interface. The only way for an EJB client to
communicate with a message-driven bean is by sending a JMS
message.
This is an example of asynchronous communication. The client
does not invoke the method on the bean directly, but rather,
uses JMS constructs to send a message. The container
delegates the message to a suitable message-driven bean
instance to handle the invocation.
SPECIAL MENTION:
All on-line material referred when preparing these slides.
© 2009 IFS
www.IFSWORLD.com
THIS DOCUMENT MAY CONTAIN STATEMENTS OF POSSIBLE FUTURE FUNCTIONALITY FOR IFS’S SOFTWARE PRODUCTS AND
TECHNOLOGY. SUCH STATEMENTS OF FUTURE FUNCTIONALITY ARE FOR INFORMATION PURPOSES ONLY AND SHOULD NOT BE
INTERPRETED AS ANY COMMITMENT OR REPRESENTATION. IFS AND ALL IFS PRODUCT NAMES ARE TRADEMARKS OF IFS. THE
NAMES OF ACTUAL COMPANIES AND PRODUCTS MENTIONED HEREIN MAY BE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.
© 2009 IFS

More Related Content

What's hot

BEAAUTIFUL presentation of java
BEAAUTIFUL  presentation of javaBEAAUTIFUL  presentation of java
BEAAUTIFUL presentation of javarana usman
 
Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".SudhanshuVijay3
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruitersph7 -
 
Summer internship report
Summer internship reportSummer internship report
Summer internship reportIpsit Pradhan
 
C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...MCM COmpetitive Classes
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaTraining on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaShravan Sanidhya
 
Overview of Java
Overview of JavaOverview of Java
Overview of Javajosemachoco
 
Java presentation
Java presentationJava presentation
Java presentationsurajdmk
 
A seminar report on core java
A  seminar report on core javaA  seminar report on core java
A seminar report on core javaAisha Siddiqui
 
CR Bridge Solutions Pvt Ltd. Java slides
CR Bridge Solutions Pvt Ltd. Java slidesCR Bridge Solutions Pvt Ltd. Java slides
CR Bridge Solutions Pvt Ltd. Java slidesCRBTech
 
10 interesting things about java
10 interesting things about java10 interesting things about java
10 interesting things about javakanchanmahajan23
 
Java Presentation
Java PresentationJava Presentation
Java Presentationaitrichtech
 

What's hot (20)

130700548484460000
130700548484460000130700548484460000
130700548484460000
 
BEAAUTIFUL presentation of java
BEAAUTIFUL  presentation of javaBEAAUTIFUL  presentation of java
BEAAUTIFUL presentation of java
 
Java vs python
Java vs pythonJava vs python
Java vs python
 
Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruiters
 
Summer internship report
Summer internship reportSummer internship report
Summer internship report
 
Java
JavaJava
Java
 
Java project
Java projectJava project
Java project
 
C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...
 
Features of java
Features of javaFeatures of java
Features of java
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaTraining on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan Sanidhya
 
Bn1005 demo ppt core java
Bn1005 demo ppt core javaBn1005 demo ppt core java
Bn1005 demo ppt core java
 
Overview of Java
Overview of JavaOverview of Java
Overview of Java
 
Java presentation
Java presentationJava presentation
Java presentation
 
A seminar report on core java
A  seminar report on core javaA  seminar report on core java
A seminar report on core java
 
Suman
SumanSuman
Suman
 
CR Bridge Solutions Pvt Ltd. Java slides
CR Bridge Solutions Pvt Ltd. Java slidesCR Bridge Solutions Pvt Ltd. Java slides
CR Bridge Solutions Pvt Ltd. Java slides
 
10 interesting things about java
10 interesting things about java10 interesting things about java
10 interesting things about java
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Java part1
Java part1Java part1
Java part1
 

Similar to Introcution to EJB

Aravind vinnakota ejb_architecture
Aravind vinnakota ejb_architectureAravind vinnakota ejb_architecture
Aravind vinnakota ejb_architecturetayab4687
 
EJB Interview Questions
EJB Interview QuestionsEJB Interview Questions
EJB Interview Questionsguest346cb1
 
EJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionEJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionKelum Senanayake
 
Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJBPeter R. Egli
 
Introduction to Java EE EJB Component
Introduction to Java EE EJB ComponentIntroduction to Java EE EJB Component
Introduction to Java EE EJB ComponentGanesh P
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptrani marri
 
Ejb training institute in navi-mumbai
Ejb training institute in navi-mumbaiEjb training institute in navi-mumbai
Ejb training institute in navi-mumbaivibrantuser
 
J2ee web services(overview)
J2ee web services(overview)J2ee web services(overview)
J2ee web services(overview)Prafull Jain
 
Ejb course in-mumbai
Ejb course in-mumbaiEjb course in-mumbai
Ejb course in-mumbaivibrantuser
 
Ejb - september 2006
Ejb  - september 2006Ejb  - september 2006
Ejb - september 2006achraf_ing
 
JEE Course - EJB
JEE Course - EJBJEE Course - EJB
JEE Course - EJBodedns
 

Similar to Introcution to EJB (20)

Unite5-EJB-2019.ppt
Unite5-EJB-2019.pptUnite5-EJB-2019.ppt
Unite5-EJB-2019.ppt
 
Ejb notes
Ejb notesEjb notes
Ejb notes
 
Aravind vinnakota ejb_architecture
Aravind vinnakota ejb_architectureAravind vinnakota ejb_architecture
Aravind vinnakota ejb_architecture
 
EJB 2
EJB 2EJB 2
EJB 2
 
Ch4 ejb
Ch4 ejbCh4 ejb
Ch4 ejb
 
EJB Interview Questions
EJB Interview QuestionsEJB Interview Questions
EJB Interview Questions
 
enterprise java bean
enterprise java beanenterprise java bean
enterprise java bean
 
EJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionEJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another Introduction
 
Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJB
 
Introduction to Java EE EJB Component
Introduction to Java EE EJB ComponentIntroduction to Java EE EJB Component
Introduction to Java EE EJB Component
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
 
Ejb training institute in navi-mumbai
Ejb training institute in navi-mumbaiEjb training institute in navi-mumbai
Ejb training institute in navi-mumbai
 
UNIT 4.pptx
UNIT 4.pptxUNIT 4.pptx
UNIT 4.pptx
 
J2ee web services(overview)
J2ee web services(overview)J2ee web services(overview)
J2ee web services(overview)
 
EJB3 Basics
EJB3 BasicsEJB3 Basics
EJB3 Basics
 
Ejb intro
Ejb introEjb intro
Ejb intro
 
Ejb course in-mumbai
Ejb course in-mumbaiEjb course in-mumbai
Ejb course in-mumbai
 
Java j2eeTutorial
Java j2eeTutorialJava j2eeTutorial
Java j2eeTutorial
 
Ejb - september 2006
Ejb  - september 2006Ejb  - september 2006
Ejb - september 2006
 
JEE Course - EJB
JEE Course - EJBJEE Course - EJB
JEE Course - EJB
 

More from Tharindu Weerasinghe

Basics of Computer Networks in Sinhala
Basics of Computer Networks in SinhalaBasics of Computer Networks in Sinhala
Basics of Computer Networks in SinhalaTharindu Weerasinghe
 
Data Structures & Algorithms in Sinhala
Data Structures & Algorithms in SinhalaData Structures & Algorithms in Sinhala
Data Structures & Algorithms in SinhalaTharindu Weerasinghe
 
Object Oriended Programming in Sinhala
Object Oriended Programming in Sinhala Object Oriended Programming in Sinhala
Object Oriended Programming in Sinhala Tharindu Weerasinghe
 
Tips For A Better Undergraduate Research
Tips For A Better Undergraduate ResearchTips For A Better Undergraduate Research
Tips For A Better Undergraduate ResearchTharindu Weerasinghe
 
Cloud Conputing Basics and some Related Research Topics
Cloud Conputing Basics and some Related Research TopicsCloud Conputing Basics and some Related Research Topics
Cloud Conputing Basics and some Related Research TopicsTharindu Weerasinghe
 
Basic Concepts and Trends in Emerging Technologies
Basic Concepts and Trends in Emerging TechnologiesBasic Concepts and Trends in Emerging Technologies
Basic Concepts and Trends in Emerging TechnologiesTharindu Weerasinghe
 
Things to ponder before you start building [cooperate] software
Things to ponder before you start building [cooperate] softwareThings to ponder before you start building [cooperate] software
Things to ponder before you start building [cooperate] softwareTharindu Weerasinghe
 
How to make screens and the internet safe for Children
How to make screens and the internet safe for Children How to make screens and the internet safe for Children
How to make screens and the internet safe for Children Tharindu Weerasinghe
 
A Survey Study on Higher Education Trends among Sri Lankan IT Professionals
A Survey Study on Higher Education Trends among Sri Lankan IT ProfessionalsA Survey Study on Higher Education Trends among Sri Lankan IT Professionals
A Survey Study on Higher Education Trends among Sri Lankan IT ProfessionalsTharindu Weerasinghe
 
A Survey Study on Higher Education Trends among Information Technology Prof...
A Survey Study  on  Higher Education Trends among Information Technology Prof...A Survey Study  on  Higher Education Trends among Information Technology Prof...
A Survey Study on Higher Education Trends among Information Technology Prof...Tharindu Weerasinghe
 

More from Tharindu Weerasinghe (20)

C Propgramming.pdf
C Propgramming.pdfC Propgramming.pdf
C Propgramming.pdf
 
Basics of Computer Networks in Sinhala
Basics of Computer Networks in SinhalaBasics of Computer Networks in Sinhala
Basics of Computer Networks in Sinhala
 
Data Structures & Algorithms in Sinhala
Data Structures & Algorithms in SinhalaData Structures & Algorithms in Sinhala
Data Structures & Algorithms in Sinhala
 
Object Oriended Programming in Sinhala
Object Oriended Programming in Sinhala Object Oriended Programming in Sinhala
Object Oriended Programming in Sinhala
 
Tips For A Better Undergraduate Research
Tips For A Better Undergraduate ResearchTips For A Better Undergraduate Research
Tips For A Better Undergraduate Research
 
Basics of Block Chain
Basics of Block ChainBasics of Block Chain
Basics of Block Chain
 
Basics of IoT
Basics of IoTBasics of IoT
Basics of IoT
 
REST API Basics
REST API BasicsREST API Basics
REST API Basics
 
Cloud Conputing Basics and some Related Research Topics
Cloud Conputing Basics and some Related Research TopicsCloud Conputing Basics and some Related Research Topics
Cloud Conputing Basics and some Related Research Topics
 
Basic Concepts and Trends in Emerging Technologies
Basic Concepts and Trends in Emerging TechnologiesBasic Concepts and Trends in Emerging Technologies
Basic Concepts and Trends in Emerging Technologies
 
Things to ponder before you start building [cooperate] software
Things to ponder before you start building [cooperate] softwareThings to ponder before you start building [cooperate] software
Things to ponder before you start building [cooperate] software
 
How to make screens and the internet safe for Children
How to make screens and the internet safe for Children How to make screens and the internet safe for Children
How to make screens and the internet safe for Children
 
Different Concepts on Databases
Different Concepts on DatabasesDifferent Concepts on Databases
Different Concepts on Databases
 
A Survey Study on Higher Education Trends among Sri Lankan IT Professionals
A Survey Study on Higher Education Trends among Sri Lankan IT ProfessionalsA Survey Study on Higher Education Trends among Sri Lankan IT Professionals
A Survey Study on Higher Education Trends among Sri Lankan IT Professionals
 
A Survey Study on Higher Education Trends among Information Technology Prof...
A Survey Study  on  Higher Education Trends among Information Technology Prof...A Survey Study  on  Higher Education Trends among Information Technology Prof...
A Survey Study on Higher Education Trends among Information Technology Prof...
 
Triggers and Stored Procedures
Triggers and Stored ProceduresTriggers and Stored Procedures
Triggers and Stored Procedures
 
Database Intergrity
Database IntergrityDatabase Intergrity
Database Intergrity
 
Cursors in MySQL
Cursors in MySQL Cursors in MySQL
Cursors in MySQL
 
Business Rules in Databases
Business Rules in DatabasesBusiness Rules in Databases
Business Rules in Databases
 
Data and Database Systems
Data and Database Systems Data and Database Systems
Data and Database Systems
 

Recently uploaded

Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 

Recently uploaded (20)

Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 

Introcution to EJB

  • 1. Introduction to Enterprise Java Beans [EJB] Lecture Series Under IFS-PERA collaboration [2010] Tharindu Weerasinghe [MSc.Eng, BSc.Eng (Hons), MIEEE, AMIESL] Software Engineer, IFS R&D International © 2010 IFS
  • 2. EJB Framework - Overview What is EJB? ❑ Enterprise Java Beans are the Java EE server side components that run inside the EJB container and encapsulates the business logic of an enterprise application. ❑It is an architecture for server-side component based distributed applications written in Java.
  • 4. Contents of the EJB environment ➢ The EJB components are running inside the container of an EJB server. ➢ The container has the connection to the database or to other components. ➢ An EJB client can access the EJBs from the same Java Virtual Machine (JVM) or from another JVM over remote interfaces. The EJB home component is comparable to a factory for the EJB objects. The EJB objects retrieved from the home components can be also local or remote objects.
  • 5. Why EJB ? ➢Numerous Web sites are up and running using Java without any EJB technology. Developers have been using servlet/JSP models and managing transactions themselves using commit and rollback functionality that is built into JDBC without the help of application servers. ➢But when doing so, the application developers are confronted with many challenges. Some of the most important ones are managing concurrency, persistence and transactions. As a result, the developers have to either develop proprietary code or buy supporting frameworks.
  • 6. Why EJB ? ➢Above problems are solved by using enterprise beans. The use of enterprise beans allow developers to focus on the business logic and release them from coding infrastructure and middleware logic, and developers become more productive and efficient.
  • 7. Benefits of EJB ➢EJB container provides the system-level services (like transaction management and security authorization) to the enterprise beans. These services simplifies the development process of large and distributed applications and the developer just have to concentrate on solving the problem occurred in it. ➢The client developer can focus only on the representation style of the client as all the business logic of the application is contained in the enterprise beans. The client developer does not bother about the code that implements business logic or the logic to access the databases. This means that the clients are thinner. It benefits the client to be thin because the client runs on the small devices.
  • 8. When to use EJB? Applications developed by using the EJB, deal with a variety of clients, simply by writing few lines of code, the client can locate the enterprise beans. The client locating the enterprise bean may be various, numerous and thin. Enterprise beans support transaction to ensure the integrity of the database. Transaction is the mechanism of managing the concurrent access of shared objects. Managing the fast growing number of users requires distributed application components across multiple machines means that the application must be scalable.
  • 9. EJB Roles Bean provider The bean provider is the developer of the code, and is responsible for converting the business requirements into actual physical code. He or she must provide the necessary classes that constitute an EJB, as well as providing the deployment file describing the runtime settings for the bean. The bean provider’s final product is an EJB JAR file. (Most of you guys/gals fall into this category ☺)
  • 10. EJB Roles Application assembler This may be the same as the bean provider, or a senior team lead. The application assembler’s responsibility is to package all the different EJB components, along with any other application components, the final product being an enterprise application EAR file. Deployer This person is responsible for deploying the EJB application on the target runtime environment. The deployer should be familiar with all aspects of the environment, including transaction and security support.
  • 11. EJB Roles Server provider The job of the server provider is to provide a runtime EJB server environment that is compliant with the EJB specification. IBM is a server provider of the WebSphere Application Server. Container provider The job of the container provider is to provide a runtime EJB container environment that is compliant with the EJB specification, and is generally the same as the server provider. The server and container cooperate to provide the quality-of- service runtime environment for the EJBs.
  • 12. EJB Roles Systems administrator The system administrator’s task is to ensure that the runtime environment is configured in such a way that the application can function correctly, and is integrated with all of the required external components.
  • 13. MAIN EJB FRAMEWORK COMPONENTS ❑EJB server Provides the actual primary services to all EJBs. An EJB server may host one or more EJB containers. It is also called generically an Enterprise Java Server (EJS). WebSphere Application Server is an EJS. ❑EJB container Provides the runtime environment for the enterprise bean instances, and is the intermediary between the EJB component and the server.
  • 14. MAIN EJB FRAMEWORK COMPONENTS ❑ EJB component These represent the actual EJBs themselves. There are three types of enterprise beans: entity, session, and message-driven beans. ❑EJB interfaces and EJB bean The interfaces for client access (EJB home and EJB object) and the EJB bean class.
  • 15. MAIN EJB FRAMEWORK COMPONENTS ❑EJB deployment descriptor The descriptor defines the runtime quality of service settings for the bean when it is deployed. Many of the settings of an EJB, such as the transactional settings, are defined in the deployment descriptor. The deployment descriptor is an external entity from the bean, and therefore decouples the bean component itself from the runtime characteristics. ❑EJB client A client that accesses EJBs.
  • 16. WE TALK MORE ON EJB COMPONENTS © 2009 IFS
  • 17. EJB COMPONENTS ❑The EJB components refer to the beans themselves, and include all the classes, interfaces, and constructs that make up the enterprise bean. ❑There are three types of enterprise beans: ➢Entity ➢Session ➢Message-driven ❑The rules for bean construction (which interfaces to use, classes to extend, and so forth) are governed by the type of bean, so a quick introduction to the types of enterprise beans is presented here.
  • 18. MAIN EJB FRAMEWORK COMPONENTS
  • 19. EJB TYPES ❑Entity Beans: Entity beans are modeled to represent business or domain- specific concepts, and are typically the nouns of your system, such as customers and accounts. They usually represent data (entities) stored in a database. ❑Session Beans: A session bean is modeled to represent a task or workflow of a system, and provide coordination of those activities between beans, such as a banking service, allowing for a transfer between accounts.
  • 20. EJB TYPES Session beans have two types: 1. Stateful Session Beans 2. Stateless Session Beans ❑Message-driven beans Like session beans, message-driven beans (MDB) may also be modeled to represent tasks. However, they are invoked by the receipt of asynchronous messages. The bean either listens for or subscribes to messages that it is to receive.
  • 21. SYNCHRONOUS VS ASYNCHRONOUS INVOCATION Entity and Session beans are accessed synchronously through a remote or local EJB interface method invocation. This is referred to as synchronous invocation, because there is a request, and a (blocking) wait for the return. Clients of EJBs invoke methods on session and entity beans. An EJB client may be an external construct like a servlet (remote) or another EJB within the same JVM (local).
  • 22. SYNCHRONOUS VS ASYNCHRONOUS INVOCATION The Message-driven bean is not accessible through a remote or local interface. The only way for an EJB client to communicate with a message-driven bean is by sending a JMS message. This is an example of asynchronous communication. The client does not invoke the method on the bean directly, but rather, uses JMS constructs to send a message. The container delegates the message to a suitable message-driven bean instance to handle the invocation.
  • 23. SPECIAL MENTION: All on-line material referred when preparing these slides. © 2009 IFS
  • 24. www.IFSWORLD.com THIS DOCUMENT MAY CONTAIN STATEMENTS OF POSSIBLE FUTURE FUNCTIONALITY FOR IFS’S SOFTWARE PRODUCTS AND TECHNOLOGY. SUCH STATEMENTS OF FUTURE FUNCTIONALITY ARE FOR INFORMATION PURPOSES ONLY AND SHOULD NOT BE INTERPRETED AS ANY COMMITMENT OR REPRESENTATION. IFS AND ALL IFS PRODUCT NAMES ARE TRADEMARKS OF IFS. THE NAMES OF ACTUAL COMPANIES AND PRODUCTS MENTIONED HEREIN MAY BE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS. © 2009 IFS