100% found this document useful (1 vote)
218 views4 pages

Assignment 2: 1) What Is EJB? and Explain EJB Architecture in Detail

The document discusses Enterprise JavaBeans (EJB), including its architecture and key concepts. EJB allows developing distributed applications and resides within an EJB container that provides services like persistence, security, transactions, and concurrency. The EJB architecture involves clients interacting with EJB components through JNDI lookup or CORBA, then invoking methods on remote or local interfaces. Roles in EJB development include bean providers, application assemblers, deployers, administrators, container providers, and tool vendors.

Uploaded by

Nikhil Patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
100% found this document useful (1 vote)
218 views4 pages

Assignment 2: 1) What Is EJB? and Explain EJB Architecture in Detail

The document discusses Enterprise JavaBeans (EJB), including its architecture and key concepts. EJB allows developing distributed applications and resides within an EJB container that provides services like persistence, security, transactions, and concurrency. The EJB architecture involves clients interacting with EJB components through JNDI lookup or CORBA, then invoking methods on remote or local interfaces. Roles in EJB development include bean providers, application assemblers, deployers, administrators, container providers, and tool vendors.

Uploaded by

Nikhil Patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

Assignment 2

1) What is EJB? And explain EJB architecture in detail.

Ans: Enterprise JavaBeans (EJB) is a specification for developing large-scale, distributed


business applications on the Java platform. EJB 1.0 was released in 1998. The most current
release, EJB 3.2.3, has been adopted for inclusion in Jakarta EE, where it will be renamed
Jakarta Enterprise Beans.
Enterprise JavaBeans (EJB) is the server-side and platform-independent Java application
programming interface (API) for Java Platform, Enterprise Edition (Java EE). EJB is used to
simplify the development of large distributed applications.
Enterprise JavaBeans (EJB) are reusable Java components that implement business logic and
enable you to develop component-based distributed business applications.
EJBs reside in an EJB container, which provides a standard set of services such as
 Persistence,
 Security,
 Transactions, and
 Concurrency.
Enterprise JavaBeans are the standard for defining server-side components. WebLogic Server's
implementation of the Enterprise JavaBeans component architecture is based on Sun
Microsystems EJB specification.

EJB Architecture

The following are the flows of the EJB architecture.

1. The client is working on a web browser.


2. There is a database server that hosts a database, like MySQL / Oracle.
3. The J2EE server machine is running on an application server
4. The client interface is provided with JSP / Servlet. The enterprise beans reside in the
business tier providing to the client tier.
5. The Application Server manages the relationships between the client and database
machines.

2) Explain EJB conversation with neat Diagram

Ans: EJB is a Server side component to get the services hosted by EJB, the client has to
communicate with the ejb Component. To converse with Enterprise beans the client has to
perform folly task
1)Locating the enterprise Bean -:
 its done through naming service that associates a symbolic name with object a DNS
maps the symbolic m/c name to ip.
 when client queries DNS server for a particular bean object the IP address is returned
if the DNS server can resolve the same. otherwise Client queries for another DNS for
the same object. Once server is able to resolve the name it returns address to client.
 There two ways used by client to find a beans
1) Using Java Naming & Directory Interface java client uses JNDI to lookup EJB
component JNDI call returns a ref to obj implementing EJB component.
2) Using CORBA’S Common object service(cos) naming service of COS can also
be used for this purpose.
2) Accessing Bean-:
 The look method in the naming service returns a reference to the home object that
implements a home interface of the EJB component. The client then uses the
home interface to lookup for existing ejb instances if no such instances is
available then new one is created.
 This lookup method returns a reference to the ejb object remote interface. The
client then uses this interface to interact with the EJB object in the server.
3) Calling Bean method-:
Once the client obtains the reference of the remote object it can then invoke the public
methods on the remote ejb object.
4) Destroying bean-:
When the client has completed its interaction with the remote enterprise bean it invoke
the remove() on the home interface or on the objects remote interface.

5) Explain Roles in EJB development in detail with Diagram.

Ans: To have an ejb deployed and running needs more than an application server and
components parties associated with EJB development and deployment.
1) Bean provider He supplies the business components that can be assembled in to an
enterprise application each business component is an individual Entity that can perform
its task.
2) Application assembler He is responsible for integrating the component COPMILED
BY BJ 20 To develop the enterprise application. he may also need to provide user
interface client program he is analogous to system integrator
3) EJB deployer He configures the security, transactions and the performance of the
system this is essential to install the application in application server he receives the
EJB-JAR files and install it in container. He is like System Administrator.
4) System Administrator He is responsible for maintaining and monitoring the deployed
system he uses monitoring and management tools for this purpose.
5) EJB Container/Server provider an ejb server provider provides services to the ejb
container which provide services to an enterprise bean he supplies the ejb container and
the run time environment for the beans also provides middleware services to the
component and manages them.
6) Tool vendors They supply IDEs to facilitate the rapid modeling building and debugging
of the components some e.g of such tools are Rational rose modeling, Eclipse for
building application and unit for testing.

6) Explain following terms with respect to EJB architecture in short


a) EJB Clients
b) Application Server
c) Web Container
d) Application Container
e) Home Interface
d) Remote / Local Interface
f) EJB Bean class
Ans: Above points can be explained as follows:
 EJB Clients: These make use of the EJB Beans for their operations. They find the EJB
container that contains the bean through the Java Naming and Directory (JNDI)
interface. They then make use of the EJB Container to invoke EJB Bean methods.
 Application Server: Application servers are commonly used as a base platform in
building these multitier, Web-based applications. With the emergence of multitier
architecture, a number of high-end capabilities have been introduced by application
server vendors, including massive scalability, transaction support, database integration,
load balancing, redundancy, failover, and so on. Many of these capabilities have been
through proprietary architecture, requiring solutions to be developed for individual
application servers.
 Web Container: Web container: Manages the execution of web pages, servlets, and
some EJB components for Java EE applications. Web components and
their container run on the Java EE server. Application client container: Manages the
execution of application client components. Application clients and their container run
on the client.
 Application Container: An application client container includes set of java classes,
libraries and the set of files that are needed and distributed among various java client
applications which executes on their own JVMs. The ACC is responsible for managing
the applications execution by providing all the system services that are needed for the
execution of java client programs. It is light-weighted and communicates with different
application servers.
 Home interface: The home interface is a contract between an EJB component class and
its container, which defines construction, destruction, and lookup of EJB instances.
An EJB home interface extends the interface javax. ejb. EJBHome, which defines
base-level functionality for a home interface.
 Remote/Local interface: An EJB component can have remote and local interfaces.
Clients not located in the same application server instance as the bean (remote clients)
use the remote interface to access the bean. Calls to the remote interface require
marshalling arguments, transportation of the marshalled data over the network, un-
marshaling the arguments, and dispatch at the receiving end. Thus, using the remote
interface entails significant overhead. If an EJB component has a local interface, then
local clients in the same application server instance can use it instead of the remote
interface. Using the local interface is more efficient, since it does not require
argument marshalling, transportation, and un-marshalling.

You might also like