0
4.2kviews
Explain with respect to EJB - Roles in EJB and types of Beans

Mumbai University > Information Technology > Sem 6 > Distributed System

Marks: 10 Marks

Year: May 2016

1 Answer
0
6views

EJB specification gives a clear description of each of these roles and their associated responsibilities.

a) Enterprise Bean Provider

  • It is the person or group that writes and packages EJBs. It might be a third-party vendor of EJB components, or it might be an information systems programmer who writes EJBs to implement their company’s business logic.
  • Because the container must provide transaction and network communication support, the enterprise bean provider does not need to be an expert at low-level system programming, networking or transaction processing.

b) Deployer

  • The deployer takes an ejb-jar file and installs it into an EJB container.
  • The deployer’s task begins with the receipt of an ejb-jar file, and ends with the installation of the ejb-jar file in the container.
  • This task is typically handled by the System Administrator in MIS world.

c) Application Assembler

  • An application assembler builds applications using EJBs classes.
  • An MIS programmer may purchase a prepackaged set of EJBs that implement an accounting system.
  • Then the programmer might use tools to customize the beans.

d) EJB Server Provider

  • An EJB Server Provider provides a server that can contain EJB containers.
  • The EJB 1.0 specification does not describe the interface between the server and the container, so the EJB server provider and the EJB container provider will likely be one and the same for any given product.

e) EJB Container Provider

  • An EJB container is the world in which an EJB bean lives.
  • The container services requests from the EJB, forwards requests from the client to the EJB, and interacts with the EJB server.
  • The container provider must provide transaction support, security and persistence to beans.
  • It is also responsible for running the beans and for ensuring that the beans are protected from the outside world.

f) System Administrator

  • System Administrators are responsible for the day-to-day operation of the EJB server.
  • Their responsibilities include keeping security information up-to-date and monitoring the performance of the server.

EJB are primarily of three types which are briefly described below:

1. Session Bean:

  • The client’s business logic is implemented by a session bean of EJB.

  • For example a session bean can calculate interest on deposits for a banking application.

  • Session beans are used as reusable components in EJB architecture that encapsulate the business logic and can be used by other clients. These clients can optimize the use of EJB container.

  • The name is derived as they are live as long as a client’s session using them.

2. Entity Bean:

  • It is a data component that persists data onto a secondary storage such as a database.

  • Like a simple java class, the Entity Bean has attributes and methods. Attributes are used to store data and methods are to perform operations on the fields.

  • Entity beans can be viewed as a record in a database. An Entity Bean lasts as long as the data it represents.

3. Message-Driven Bean:

  • A Message-Driven Bean is an enterprise bean that is used to manage messages asynchronously. It acts as a listener to receive messages.

  • The message can be sent by using any J2EE component-application client, another enterprise bean, a web component or by a JMS application.

  • Clients do not access the message driven beans through interfaces.

  • Message Driven Beans are primarily focused on JMS.

  • It is possible to get messages by multiple parties.

Please log in to add an answer.