0% found this document useful (0 votes)
19 views13 pages

Overview of Enterprise Java Beans

Enterprise Java Beans (EJBs) are server-side components that contain business logic. EJBs focus on writing business logic and are not concerned with system services like security, transactions, and persistence, as the EJB container handles these. The EJB container manages system-level services for EJBs and acts as an interface between EJBs and web components. There are three types of EJBs: entity beans for persistent data storage, session beans for client tasks, and message-driven beans for asynchronous message processing.

Uploaded by

Jai Balaji
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views13 pages

Overview of Enterprise Java Beans

Enterprise Java Beans (EJBs) are server-side components that contain business logic. EJBs focus on writing business logic and are not concerned with system services like security, transactions, and persistence, as the EJB container handles these. The EJB container manages system-level services for EJBs and acts as an interface between EJBs and web components. There are three types of EJBs: entity beans for persistent data storage, session beans for client tasks, and message-driven beans for asynchronous message processing.

Uploaded by

Jai Balaji
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd

Enterprise Java Bean

Enterprise JavaBean(EJB)
EJB is a server side component that contains business logic of an
application
EJB class focusses on writing business logic to respond to requests of web-
services without bothering about system-level services.
EJB server takes care of system level services such as security,transaction
and persistance using EJB written them.
Architecture of EJB
Web Server
Client
Web container
Browser Servlets and JSP

Application
container
Appln

EJB Server
Appln
EJB Container
EJB DB
EJB
Need of EJB
Generally EJB is useful in building enterprise-level application.
Olden days CORBA had been used which has the following problems
Outdated persistence

Unable to manage transactions

Lacks scalability,portability
Advantages of EJB
Simplicity
Reusability
Scalability
Portability
EJB Container

It is a vendor-provided entity located on the EJB server that


manages system-level services for EJB.
EJB server may have many EJB container and EJB container may
have many EJBs
EJB container acts as a interface between EJB and JSP/Servlet
JSP/Servlet uses JNDI to search for the correct EJB
EJB Interfaces
Each EJB should have two interfaces to use the business logic of that EJB
Home Interface
It contains methods to create, remove and to find EJB objects.

Remote Interface
It contains lists of business methods to implement business logic of EJB
EJB Class
There are 3 types of classes in EJB
1. Entity Bean
This contains persistent data and provides persistent
storage to that data in a database
2. Session Bean
It describes the task to be done for a client
3. Message Driven Bean
This bean is to process messages asynchronously i.e., it is
used for operations which do not require immediate
response
Entity Bean
This contains persistent data and provides persistent storage to the data in db.
Data collected and managed by an entity bean is referred to as persistent data
Two types
Bean managed persistence:
persistence of data is handled by itself
Container managed persistence:
persistence is handled by container

You might also like