SlideShare a Scribd company logo
1 of 14
java bean
What is java bean?
 Java Beans are software component models.
 A java bean is a general purpose component
model.
 A java bean is a reusable software component
that can be visually manipulated in builder
tools.
 Their primary goal of java bean is WORA
(Write Once Run Anywhere).
 Java beans should adhere to portability,
reusability and interoperability.
Enterprise Java Beans
 Enterprise JavaBeans (EJB) technology is the
server-side component architecture for Java
Platform, Enterprise Edition (Java EE).
 EJB technology enables rapid and simplified
development of distributed, transactional,
secure and portable applications based on
Java technology.
Advantages of EJB
 EJB gives developers architectural independence.
 EJB is WORA for server side components.
 EJB establishes roles for application development.
 EJB takes care of transaction management.
 EJB provides distributed transaction support.
 EJB help create portable and scalable solutions.
 EJB integrates seamlessly with CORBA
 EJB provides for vender specific enhancements.
EJB Architecture
EJB Architecture
EJB Container
 An EJB container is a runtime environment that manages
one or more enterprise beans.
 The EJB container manages the life cycles of enterprise
bean objects, coordinates distributed transactions, and
implements object security.
 Generally, each EJB container is provided by an EJB server
and contains a set of enterprise beans that run on the
server.
 If we want to execute an enterprise bean it must be placed
in one of the EJB container, which provides system level
services for its execution.
EJB Clients
 EJB client applications utilize the Java Naming
and Directory interface (JNDI) to look up
references to home interfaces and use home
and remote EJB interface to utilize all EJB
based functionality.
EJB home interface and stubs
 EJB home interfaces provide operations for
clients to create remove and find handles to EJB
remote interface objects. Underlying stubs
marshal home interface requests and unmarshal
home interface responses for the client.
EJB remote interfaces and
stubs
 EJB remote interfaces provide business
specific client interface methods defined
for a particular EJB. Underlying stubs
marshal remote interface request and
unmarshal remote interface responses
for the client.
Types of Enterprise Beans
 Entity bean
 Session bean
 Message Driven
Entity bean
 An entity bean represents the business data.
 An entity bean is an object representation of persistent data
maintained in a permanent data store such as a database.
A primary key identifies each instance of an entity bean.
 Entity beans are transactional and are recoverable in the
event of a system crash.
 Entity beans are representations of explicit data or
collections of data, such as a row in a relational database.
Entity bean methods provide procedures for acting on the
data representation of the bean. An entity bean is persistent
and survives as long as its data remains in the database.
Session Bean
 A Session bean represents the business processing
logic.
 It is a java class that implements the methods in
Session Interface.
 A session bean usually performs operations such as
calculations or database access on behalf of the
client. While a session bean may be transactional, it
is not recoverable if a system crash occurs.
 There are two types of session beans:
◦ Stateful
◦ Stateless.
Stateful Session Beans
 The state of an object consists of the values of its
instance variables. In a stateful session bean, the
instance variables represent the state of a unique
client-bean session. Because the client interacts
(“talks”) with its bean, this state is often called the
conversational state.
 The state is retained for the duration of the client-
bean session. If the client removes the bean or
terminates, the session ends and the state
disappears. This transient nature of the state is not a
problem, however, because when the conversation
between the client and the bean ends there is no
need to retain the state.
Stateless Session Beans
 A stateless session bean does not maintain a
conversational state with the client. When a client invokes
the methods of a stateless bean, the bean’s instance
variables may contain a state specific to that client, but only
for the duration of the invocation. When the method is
finished, the client specific state should not be retained.
 Clients may, however, change the state of instance
variables in pooled stateless beans, and this state is held
over to the next invocation of the pooled stateless bean.
Except during method invocation, all instances of a
stateless bean are equivalent, allowing the EJB container
to assign an instance to any client. That is, the state of a
stateless session bean should apply across all clients.
Message Driven Bean
 A message-driven bean is an enterprise bean that
allows Java EE applications to process messages
asynchronously. It normally acts as a JMS message
listener, which is similar to an event listener except
that it receives JMS messages instead of events.
 The messages can be sent by any Java EE
component (an application client, another enterprise
bean, or a web component) or by a JMS application
or system that does not use Java EE technology.
 Message-driven beans can process JMS messages
or other kinds of messages.

More Related Content

What's hot (20)

JVM
JVMJVM
JVM
 
Introduction to EJB
Introduction to EJBIntroduction to EJB
Introduction to EJB
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
Java beans
Java beansJava beans
Java beans
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
Java layoutmanager
Java layoutmanagerJava layoutmanager
Java layoutmanager
 
Java beans
Java beansJava beans
Java beans
 
Jdk,jre,jvm
Jdk,jre,jvmJdk,jre,jvm
Jdk,jre,jvm
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
 
Java-java virtual machine
Java-java virtual machineJava-java virtual machine
Java-java virtual machine
 
Packages in java
Packages in javaPackages in java
Packages in java
 
Javabeans .pdf
Javabeans .pdfJavabeans .pdf
Javabeans .pdf
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented Testing
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
 
Java byte code presentation
Java byte code presentationJava byte code presentation
Java byte code presentation
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Java Development Kit (jdk)
Java Development Kit (jdk)Java Development Kit (jdk)
Java Development Kit (jdk)
 
C# Framework class library
C# Framework class libraryC# Framework class library
C# Framework class library
 
Android User Interface
Android User InterfaceAndroid User Interface
Android User Interface
 

Similar to Java bean

Similar to Java bean (20)

EJB Interview Questions
EJB Interview QuestionsEJB Interview Questions
EJB Interview Questions
 
J2 ee tutorial ejb
J2 ee tutorial ejbJ2 ee tutorial ejb
J2 ee tutorial ejb
 
Ch4 ejb
Ch4 ejbCh4 ejb
Ch4 ejb
 
Enterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEnterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business Logic
 
Introcution to EJB
Introcution to EJBIntrocution to EJB
Introcution to EJB
 
Ejb - september 2006
Ejb  - september 2006Ejb  - september 2006
Ejb - september 2006
 
Ejb intro
Ejb introEjb intro
Ejb intro
 
Ejb intro
Ejb introEjb intro
Ejb intro
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
 
EJB3 Basics
EJB3 BasicsEJB3 Basics
EJB3 Basics
 
Unite5-EJB-2019.ppt
Unite5-EJB-2019.pptUnite5-EJB-2019.ppt
Unite5-EJB-2019.ppt
 
EJB 2
EJB 2EJB 2
EJB 2
 
Entity beans in java
Entity beans in javaEntity beans in java
Entity beans in java
 
Aravind vinnakota ejb_architecture
Aravind vinnakota ejb_architectureAravind vinnakota ejb_architecture
Aravind vinnakota ejb_architecture
 
Session 3 Tp3
Session 3 Tp3Session 3 Tp3
Session 3 Tp3
 
Ejb notes
Ejb notesEjb notes
Ejb notes
 
Java j2eeTutorial
Java j2eeTutorialJava j2eeTutorial
Java j2eeTutorial
 
Session 4 Tp4
Session 4 Tp4Session 4 Tp4
Session 4 Tp4
 
1-introduction to ejb
1-introduction to ejb1-introduction to ejb
1-introduction to ejb
 
EJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionEJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another Introduction
 

More from Jafar Nesargi

Network adpater,cabel,cards ,types, network devices
Network adpater,cabel,cards ,types, network devicesNetwork adpater,cabel,cards ,types, network devices
Network adpater,cabel,cards ,types, network devicesJafar Nesargi
 
An introduction to networking
An introduction to networkingAn introduction to networking
An introduction to networkingJafar Nesargi
 
Computer basics Intro
Computer basics IntroComputer basics Intro
Computer basics IntroJafar Nesargi
 
Chapter 7 relation database language
Chapter 7 relation database languageChapter 7 relation database language
Chapter 7 relation database languageJafar Nesargi
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
Chapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organizationChapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organizationJafar Nesargi
 
Introduction to-oracle
Introduction to-oracleIntroduction to-oracle
Introduction to-oracleJafar Nesargi
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetsJafar Nesargi
 
Session1 gateway to web page development
Session1   gateway to web page developmentSession1   gateway to web page development
Session1 gateway to web page developmentJafar Nesargi
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jspJafar Nesargi
 
Record storage and primary file organization
Record storage and primary file organizationRecord storage and primary file organization
Record storage and primary file organizationJafar Nesargi
 
Introduction to-oracle
Introduction to-oracleIntroduction to-oracle
Introduction to-oracleJafar Nesargi
 

More from Jafar Nesargi (20)

Network adpater,cabel,cards ,types, network devices
Network adpater,cabel,cards ,types, network devicesNetwork adpater,cabel,cards ,types, network devices
Network adpater,cabel,cards ,types, network devices
 
An introduction to networking
An introduction to networkingAn introduction to networking
An introduction to networking
 
Computer basics Intro
Computer basics IntroComputer basics Intro
Computer basics Intro
 
Css
CssCss
Css
 
Chapter 7 relation database language
Chapter 7 relation database languageChapter 7 relation database language
Chapter 7 relation database language
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Chapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organizationChapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organization
 
Chapter3
Chapter3Chapter3
Chapter3
 
Introduction to-oracle
Introduction to-oracleIntroduction to-oracle
Introduction to-oracle
 
Chapter2
Chapter2Chapter2
Chapter2
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Session1 gateway to web page development
Session1   gateway to web page developmentSession1   gateway to web page development
Session1 gateway to web page development
 
Introduction to jsp
Introduction to jspIntroduction to jsp
Introduction to jsp
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
 
Rmi
RmiRmi
Rmi
 
Networking
NetworkingNetworking
Networking
 
Chapter2 j2ee
Chapter2 j2eeChapter2 j2ee
Chapter2 j2ee
 
Chapter 1 swings
Chapter 1 swingsChapter 1 swings
Chapter 1 swings
 
Record storage and primary file organization
Record storage and primary file organizationRecord storage and primary file organization
Record storage and primary file organization
 
Introduction to-oracle
Introduction to-oracleIntroduction to-oracle
Introduction to-oracle
 

Recently uploaded

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

Java bean

  • 2. What is java bean?  Java Beans are software component models.  A java bean is a general purpose component model.  A java bean is a reusable software component that can be visually manipulated in builder tools.  Their primary goal of java bean is WORA (Write Once Run Anywhere).  Java beans should adhere to portability, reusability and interoperability.
  • 3. Enterprise Java Beans  Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform, Enterprise Edition (Java EE).  EJB technology enables rapid and simplified development of distributed, transactional, secure and portable applications based on Java technology.
  • 4. Advantages of EJB  EJB gives developers architectural independence.  EJB is WORA for server side components.  EJB establishes roles for application development.  EJB takes care of transaction management.  EJB provides distributed transaction support.  EJB help create portable and scalable solutions.  EJB integrates seamlessly with CORBA  EJB provides for vender specific enhancements.
  • 6. EJB Architecture EJB Container  An EJB container is a runtime environment that manages one or more enterprise beans.  The EJB container manages the life cycles of enterprise bean objects, coordinates distributed transactions, and implements object security.  Generally, each EJB container is provided by an EJB server and contains a set of enterprise beans that run on the server.  If we want to execute an enterprise bean it must be placed in one of the EJB container, which provides system level services for its execution.
  • 7. EJB Clients  EJB client applications utilize the Java Naming and Directory interface (JNDI) to look up references to home interfaces and use home and remote EJB interface to utilize all EJB based functionality. EJB home interface and stubs  EJB home interfaces provide operations for clients to create remove and find handles to EJB remote interface objects. Underlying stubs marshal home interface requests and unmarshal home interface responses for the client.
  • 8. EJB remote interfaces and stubs  EJB remote interfaces provide business specific client interface methods defined for a particular EJB. Underlying stubs marshal remote interface request and unmarshal remote interface responses for the client.
  • 9. Types of Enterprise Beans  Entity bean  Session bean  Message Driven
  • 10. Entity bean  An entity bean represents the business data.  An entity bean is an object representation of persistent data maintained in a permanent data store such as a database. A primary key identifies each instance of an entity bean.  Entity beans are transactional and are recoverable in the event of a system crash.  Entity beans are representations of explicit data or collections of data, such as a row in a relational database. Entity bean methods provide procedures for acting on the data representation of the bean. An entity bean is persistent and survives as long as its data remains in the database.
  • 11. Session Bean  A Session bean represents the business processing logic.  It is a java class that implements the methods in Session Interface.  A session bean usually performs operations such as calculations or database access on behalf of the client. While a session bean may be transactional, it is not recoverable if a system crash occurs.  There are two types of session beans: ◦ Stateful ◦ Stateless.
  • 12. Stateful Session Beans  The state of an object consists of the values of its instance variables. In a stateful session bean, the instance variables represent the state of a unique client-bean session. Because the client interacts (“talks”) with its bean, this state is often called the conversational state.  The state is retained for the duration of the client- bean session. If the client removes the bean or terminates, the session ends and the state disappears. This transient nature of the state is not a problem, however, because when the conversation between the client and the bean ends there is no need to retain the state.
  • 13. Stateless Session Beans  A stateless session bean does not maintain a conversational state with the client. When a client invokes the methods of a stateless bean, the bean’s instance variables may contain a state specific to that client, but only for the duration of the invocation. When the method is finished, the client specific state should not be retained.  Clients may, however, change the state of instance variables in pooled stateless beans, and this state is held over to the next invocation of the pooled stateless bean. Except during method invocation, all instances of a stateless bean are equivalent, allowing the EJB container to assign an instance to any client. That is, the state of a stateless session bean should apply across all clients.
  • 14. Message Driven Bean  A message-driven bean is an enterprise bean that allows Java EE applications to process messages asynchronously. It normally acts as a JMS message listener, which is similar to an event listener except that it receives JMS messages instead of events.  The messages can be sent by any Java EE component (an application client, another enterprise bean, or a web component) or by a JMS application or system that does not use Java EE technology.  Message-driven beans can process JMS messages or other kinds of messages.