SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
MyExamCloud
© EPractize Labs Software. All rights reserved
Presentation by MyExamCloud
Introduction to Java EE EJB Component
MyExamCloud
Introduction to Java EE EJB Component
This presentation deeply discusses the usage of EJB component in Java EE architecture.
Before start reading about EJB, it is advisable to understand the history behind
component-container architecture.
Introduction
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
The WWW technology is moved from 2 tier to 3 tier, 3 tier to n-tier and now n-tier to
SOA based solutions for easy integration and maintenance.
Evolution of Component-Container Architecture
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Single Tier
Mainframe based systems where presentation, business logic and database are on
same node.
Evolution of Component-Container Architecture
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Two-Tier
Client-Server model where presentation logic is moved to client machine.
Evolution of Component-Container Architecture
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Three-Tier
Introducing browser based applications where web server will handle all requests.
Presentation, Business Logic and Database are separated.
Evolution of Component-Container Architecture
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
N-Tier
Introducing component-container approach with application server to run business
logic components. Presentation, Business Logic, Integration (Data/Legacy) and
Database.
Evolution of Component-Container Architecture
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
SOA
Service Oriented Architecture to interact with other systems. Both WSDL based SOAP or
JSON based web services are getting more popular in current trend.
Evolution of Component-Container Architecture
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Normally, in N-Tiered applications we need to handle transaction and state management, multi-
threading, resource pooling, and other complex low-level services. The component-based and platform-
independent Java EE architecture simplifies these services with the help of containers. We just need to
write business logic and it is organized into reusable components.
The Java EE server provides underlying services in the form of a container for every component type.
Because we do not have to develop these services, we are free to concentrate on solving the business
problem at hand.
Java EE Containers
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
EJB is a component to write business logic in an enterprise application and it runs inside a container
named EJB container. The typical Java EE application server architecture is shown below:
Introducing EJB Component
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
The run-time portion of a Java EE product. A Java EE application server provides EJB and Web
containers.
Java EE Application Server
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Manages the execution of EJBs for Java EE applications. Enterprise beans and their container run on the
Java EE application server.
Enterprise JavaBeans (EJB) container
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Manages the execution of JSP page and servlet components for Java EE applications. Web components
and their container run on the Java EE application server.
Web container
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Manages the execution of application client components. Application clients and their container run on
the client.
Application client container
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Java EE provides the following EJB components.
1. Stateful Session Bean
2. Stateless Session Bean
3. Singleton Session Bean
4. Message Driven Bean
Note that Singleton bean is under session type introduced in Java EE 6.
EJB Components
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Using Stateless Session Beans
You are developing a business component where it does not contain the data for a specific client. Your
search component will be a best example for this scenario. Note that search requires only one method
invocation with search query among all the clients to perform the generic task (executing search query
on server side).
Example: Google search, Yahoo search and MSN search.
The following contents are taken from Oracle:
When to use Stateful Session Bean:
If the bean does not contain the data for a specific client.
If there is only one method invocation among all the clients to perform the generic task.
EJB Design Decision
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Using Stateful Session Beans
You are developing a business component where it wants to hold information about the client across
method invocation. The most common example for this type of implementation would be “Shopping
Cart”, where it needs to hold client specific information.
Example: Gmail, Yahoo Mail and Facebook.
The following contents are taken from Oracle:
When to use Stateful Session Bean:
What the bean wants to holds information about the client across method invocation.
When the bean works as the mediator between the client and the other component of the application.
When the bean have to manage the workflow of several other enterprise beans.
EJB Design Decision
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Using Singleton Session Beans
You can easily decide by the name itself, when you want to have exactly one instance of a session bean
go for Singleton session bean. You are developing an application where you want to have some
configuration parameters needs to be used across different modules and they needs to be available
during your server startup. You can easily implement this scenario by using Singleton Session bean.
The following contents are taken from Oracle:
When to use Singleton Session Bean:
State needs to be shared across the application.
A single enterprise bean needs to be accessed by multiple threads concurrently.
The application needs an enterprise bean to perform tasks upon application startup and shutdown.
The bean implements a web service.
EJB Design Decision
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Using Message Driven Beans
Unless like regular Java method calls MDBs are called asynchronously without blocking. Note that Java
EE 6. Note that Session beans allow you to send JMS messages and to receive them synchronously but
not asynchronously. To avoid tying up server resources, do not to use blocking synchronous receives in
a server-side component; in general, JMS messages should not be sent or received synchronously. To
receive messages asynchronously, we should use a message-driven bean.
EJB Design Decision
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
One better way to study EJB is by taking Oracle’s Java EE 7 Developer Certification.
Prepare for your Java EE 7 Application Developer Certification using MyExamCloud course:
https://www.myexamcloud.com/onlineexam/1z0-900-mock-exams-ocp-java-ee-aplication-developer.course
Java EE 7 Developer Certification
© EPractize Labs Software. All rights reserved

Más contenido relacionado

Similar a Introduction to Java EE EJB Component

Enterprise application developement
Enterprise application developementEnterprise application developement
Enterprise application developementArchana Jha
 
JEE Course - EJB
JEE Course - EJBJEE Course - EJB
JEE Course - EJBodedns
 
Aravind vinnakota ejb_architecture
Aravind vinnakota ejb_architectureAravind vinnakota ejb_architecture
Aravind vinnakota ejb_architecturetayab4687
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts frameworks4al_com
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptKalsoomTahir2
 
Free EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggetsFree EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggetsVirtual Nuggets
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptrani marri
 
Servlets and jsp pages best practices
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practicesejjavies
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overviewsbobde
 
Bea weblogic job_interview_preparation_guide
Bea weblogic job_interview_preparation_guideBea weblogic job_interview_preparation_guide
Bea weblogic job_interview_preparation_guidePankaj Singh
 
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to strutsAnup72
 

Similar a Introduction to Java EE EJB Component (20)

Enterprise application developement
Enterprise application developementEnterprise application developement
Enterprise application developement
 
JEE Course - EJB
JEE Course - EJBJEE Course - EJB
JEE Course - EJB
 
Aravind vinnakota ejb_architecture
Aravind vinnakota ejb_architectureAravind vinnakota ejb_architecture
Aravind vinnakota ejb_architecture
 
Java EE 7 introduction
Java EE 7  introductionJava EE 7  introduction
Java EE 7 introduction
 
Java ee introduction
Java ee introductionJava ee introduction
Java ee introduction
 
Ejbandjsp 200119145750
Ejbandjsp 200119145750Ejbandjsp 200119145750
Ejbandjsp 200119145750
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
 
Frameworks in java
Frameworks in javaFrameworks in java
Frameworks in java
 
Free EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggetsFree EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggets
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
 
Advance java1.1
Advance java1.1Advance java1.1
Advance java1.1
 
Servlets and jsp pages best practices
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practices
 
Ejb and jsp
Ejb and jspEjb and jsp
Ejb and jsp
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overview
 
Bea weblogic job_interview_preparation_guide
Bea weblogic job_interview_preparation_guideBea weblogic job_interview_preparation_guide
Bea weblogic job_interview_preparation_guide
 
Virtual Classroom
Virtual ClassroomVirtual Classroom
Virtual Classroom
 
Lec2 ecom fall16
Lec2 ecom fall16Lec2 ecom fall16
Lec2 ecom fall16
 
Java EE EJB Applications
Java EE EJB ApplicationsJava EE EJB Applications
Java EE EJB Applications
 
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to struts
 

Último

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 

Último (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 

Introduction to Java EE EJB Component

  • 1. MyExamCloud © EPractize Labs Software. All rights reserved Presentation by MyExamCloud Introduction to Java EE EJB Component
  • 2. MyExamCloud Introduction to Java EE EJB Component This presentation deeply discusses the usage of EJB component in Java EE architecture. Before start reading about EJB, it is advisable to understand the history behind component-container architecture. Introduction © EPractize Labs Software. All rights reserved
  • 3. MyExamCloud Introduction to Java EE EJB Component The WWW technology is moved from 2 tier to 3 tier, 3 tier to n-tier and now n-tier to SOA based solutions for easy integration and maintenance. Evolution of Component-Container Architecture © EPractize Labs Software. All rights reserved
  • 4. MyExamCloud Introduction to Java EE EJB Component Single Tier Mainframe based systems where presentation, business logic and database are on same node. Evolution of Component-Container Architecture © EPractize Labs Software. All rights reserved
  • 5. MyExamCloud Introduction to Java EE EJB Component Two-Tier Client-Server model where presentation logic is moved to client machine. Evolution of Component-Container Architecture © EPractize Labs Software. All rights reserved
  • 6. MyExamCloud Introduction to Java EE EJB Component Three-Tier Introducing browser based applications where web server will handle all requests. Presentation, Business Logic and Database are separated. Evolution of Component-Container Architecture © EPractize Labs Software. All rights reserved
  • 7. MyExamCloud Introduction to Java EE EJB Component N-Tier Introducing component-container approach with application server to run business logic components. Presentation, Business Logic, Integration (Data/Legacy) and Database. Evolution of Component-Container Architecture © EPractize Labs Software. All rights reserved
  • 8. MyExamCloud Introduction to Java EE EJB Component SOA Service Oriented Architecture to interact with other systems. Both WSDL based SOAP or JSON based web services are getting more popular in current trend. Evolution of Component-Container Architecture © EPractize Labs Software. All rights reserved
  • 9. MyExamCloud Introduction to Java EE EJB Component Normally, in N-Tiered applications we need to handle transaction and state management, multi- threading, resource pooling, and other complex low-level services. The component-based and platform- independent Java EE architecture simplifies these services with the help of containers. We just need to write business logic and it is organized into reusable components. The Java EE server provides underlying services in the form of a container for every component type. Because we do not have to develop these services, we are free to concentrate on solving the business problem at hand. Java EE Containers © EPractize Labs Software. All rights reserved
  • 10. MyExamCloud Introduction to Java EE EJB Component EJB is a component to write business logic in an enterprise application and it runs inside a container named EJB container. The typical Java EE application server architecture is shown below: Introducing EJB Component © EPractize Labs Software. All rights reserved
  • 11. MyExamCloud Introduction to Java EE EJB Component The run-time portion of a Java EE product. A Java EE application server provides EJB and Web containers. Java EE Application Server © EPractize Labs Software. All rights reserved
  • 12. MyExamCloud Introduction to Java EE EJB Component Manages the execution of EJBs for Java EE applications. Enterprise beans and their container run on the Java EE application server. Enterprise JavaBeans (EJB) container © EPractize Labs Software. All rights reserved
  • 13. MyExamCloud Introduction to Java EE EJB Component Manages the execution of JSP page and servlet components for Java EE applications. Web components and their container run on the Java EE application server. Web container © EPractize Labs Software. All rights reserved
  • 14. MyExamCloud Introduction to Java EE EJB Component Manages the execution of application client components. Application clients and their container run on the client. Application client container © EPractize Labs Software. All rights reserved
  • 15. MyExamCloud Introduction to Java EE EJB Component Java EE provides the following EJB components. 1. Stateful Session Bean 2. Stateless Session Bean 3. Singleton Session Bean 4. Message Driven Bean Note that Singleton bean is under session type introduced in Java EE 6. EJB Components © EPractize Labs Software. All rights reserved
  • 16. MyExamCloud Introduction to Java EE EJB Component Using Stateless Session Beans You are developing a business component where it does not contain the data for a specific client. Your search component will be a best example for this scenario. Note that search requires only one method invocation with search query among all the clients to perform the generic task (executing search query on server side). Example: Google search, Yahoo search and MSN search. The following contents are taken from Oracle: When to use Stateful Session Bean: If the bean does not contain the data for a specific client. If there is only one method invocation among all the clients to perform the generic task. EJB Design Decision © EPractize Labs Software. All rights reserved
  • 17. MyExamCloud Introduction to Java EE EJB Component Using Stateful Session Beans You are developing a business component where it wants to hold information about the client across method invocation. The most common example for this type of implementation would be “Shopping Cart”, where it needs to hold client specific information. Example: Gmail, Yahoo Mail and Facebook. The following contents are taken from Oracle: When to use Stateful Session Bean: What the bean wants to holds information about the client across method invocation. When the bean works as the mediator between the client and the other component of the application. When the bean have to manage the workflow of several other enterprise beans. EJB Design Decision © EPractize Labs Software. All rights reserved
  • 18. MyExamCloud Introduction to Java EE EJB Component Using Singleton Session Beans You can easily decide by the name itself, when you want to have exactly one instance of a session bean go for Singleton session bean. You are developing an application where you want to have some configuration parameters needs to be used across different modules and they needs to be available during your server startup. You can easily implement this scenario by using Singleton Session bean. The following contents are taken from Oracle: When to use Singleton Session Bean: State needs to be shared across the application. A single enterprise bean needs to be accessed by multiple threads concurrently. The application needs an enterprise bean to perform tasks upon application startup and shutdown. The bean implements a web service. EJB Design Decision © EPractize Labs Software. All rights reserved
  • 19. MyExamCloud Introduction to Java EE EJB Component Using Message Driven Beans Unless like regular Java method calls MDBs are called asynchronously without blocking. Note that Java EE 6. Note that Session beans allow you to send JMS messages and to receive them synchronously but not asynchronously. To avoid tying up server resources, do not to use blocking synchronous receives in a server-side component; in general, JMS messages should not be sent or received synchronously. To receive messages asynchronously, we should use a message-driven bean. EJB Design Decision © EPractize Labs Software. All rights reserved
  • 20. MyExamCloud Introduction to Java EE EJB Component One better way to study EJB is by taking Oracle’s Java EE 7 Developer Certification. Prepare for your Java EE 7 Application Developer Certification using MyExamCloud course: https://www.myexamcloud.com/onlineexam/1z0-900-mock-exams-ocp-java-ee-aplication-developer.course Java EE 7 Developer Certification © EPractize Labs Software. All rights reserved