EJB containers

What is EJB container?- An EJB container will provide the runtime environment for EJB applications within the application server.

- It is responsible for all the operations of the EJB applications.

- The container acts as an intermediary action between the business logic of the bean and the rest of the world of the enterprise application.

- One or more EJB modules can be installed within a single EJB container.

- The role of EJB container is to perform transactional actions such as,

1. Starting a transaction.

2. Rollback a transaction or commit a transaction.

3. Managing various connection pools for the database resources.

4. Bean’s instance variables with corresponding data items which are stored in a database will be synchronized.

Explain the four types of container that J2EE supports.

EJB Container:

- An EJB container will provide the runtime environment for EJB applications within the application server.

- It is responsible for all the operations of the EJB applications.

- The container acts as an intermediary action between the business logic of the bean and the rest of the world of the enterprise application.

- One or more EJB modules can be installed within a single EJB container. The role of EJB container is to perform transactional actions such as,

1. Starting a transaction.

2. Rollback a transaction or commit a transaction.

3. Managing various connection pools for the database resources.

4. Bean’s instance variables with corresponding data items which are stored in a database will be synchronized.

Web Container:

- A web container implements a web component such as servlet container.

- A servlet container supports the operations of a servlet.

- It supports the web server operations and the client java operations such as JRE,maps the URL specific requests into servlet requests.

- The servlet cotainers have the ability to dynamically add or remove servlets from the system.

- Individual servlets will get registered by the servlet container.

- The servlet API is provided by different vendors for a specific servlet standard.

Application Client 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.

Applet client container:

- Like application client container, applet container executes the client applications.

- The difference is an applet executes the application in a separate browser.

- They execute on their own JVMs.

- It supports the applet programming model.

- JEE client may use java plug-in to provide the required environment that executes the applet.

Developer classes vs. container classes.

- The developer classes are the classes that are authored by the developers

- The container classes are the classes which supports the container to manage the container specific functionality.

Explain the difference between servers and containers.

- The server receives the requests from client and sends the responses to the client.

- If it is a web server or EJB server, the request will be sent to the web container or to the EJB container.

- A web server responds requests over the web.

- The container creates the required objects pertaining to the requests and responses, and invokes the appropriate service methods.

- Containers also provide the communication support, life cycle management, multithreading support and declarative security.

- A container runs inside the web or application server which could produce dynamic content.
Explain EJB in brief.
EJB is a standard for developing server side in JAVA. It specifies agreement between components and application..
EJB Kinds - What are the kinds of EJB's?
EJB Kinds - There are 3 kinds of EJB's - Session beans, Entity Beans, Message-driven beans..
EJB Passivation and activation - What is Passivation and activation in EJB?
EJB Passivation and activation - EJB saves data from memory to hard disk thus allowing memory to be reclaimed. This process of saving memory data to hard disk is called passivation...
Post your comment