Showing posts with label EJB Interview Questions and Answers. Show all posts
Showing posts with label EJB Interview Questions and Answers. Show all posts

Wednesday, October 14, 2015

EJB Interview Questions and Answers

8. Explain briefly about the EJB components ?
  • EJB Container : It provides runtime environment for the EJB components and services, such as Life cycle management, connection pooling and security.
  • EJB Component : It is a java class that follows the Enterprise Java Bean specification to implement the business logic of an application. Enterprise Java Bean components are deployed in container and are accessed using the remote and home interfaces of an enterprise bean.
  • EJB Object : Enterprise Java Bean container generates Enterprise Java Bean object, when a client needs to access an instance of the enterprise java bean. The Enterprise Java Bean object acts as an interface between the client and bean instances.
  • Remote Interface : It declares methods, which an enterprise bean provides to clients in order to enable them to perform business operations.
  • Home Object : Home objects are generated by Enterprise Java Bean container. Clients access Enterprise Java Bean objects that are stored at different java virtual machine, using the home object.
Task performed by EJB Object
  • Creating EJB objects
  • Searching EJB Objects
  • Removing EJB Objects
EJB Interfaces
  • Home Interface : It declares the various life cycle methods that involve operations, such as creating, finding, removing enterprise beans.
  • Local Interface : These are used when the enterprise bean and the client machine are stored in the same JVM.
9. what are the system services provided by EJB container?
Container provides system services such as:
  • Persistence
  • Security
  • Transaction
  • Connection pooling
  • Component lifecycle management
  • Threading
10. Mention the steps to call a remote method in EJB?
  • The client calls a local stub that is an object of the remote interface.
  • The stub marshals the parameters of the message into a form that can be sent over the network.
  • The call is sent over the network connection to the skeleton that is present at the server.
  • The skeleton demarshals the parameter in a form suitable for calling the EJB object.
  • The skeleton calls the EJB object that provides the middleware services, such as transaction and security.
  • The EJB object calls the instance of enterprise bean.
  • The Enterprise bean instance performs the tasks that are defined in the called method.

Tuesday, October 13, 2015

EJB Interview Questions and Answers

1. What is EJB?
Enterprise Java Beans are the server side components that run inside the EJB container and encapsulates the business logic of an enterprise application.
2. What is a J2EE container?
Containers are the interface between a component and the low level platform specific functionality that supports the component. The application server maintains control and provides services through an interface or framework known as a container.
3. What are the types of J2EE container types according to J2EE specification?
There are five defined J2EE container types (three server side and two client side). Three server side containers are as follows:
  • The server itself, which provides the J2EE runtime environment.
  • An EJB container to manage EJB components.
  • A web container to manage servlets and java server pages.
Two client side containers are as follows:
  • An application container for standalone GUIs, console, and batch type programs.
  • An applet container, meaning a browser, usually with the java plug-in.
4. what is a J2EE component and what are its types?
It is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and that communicates with other components. There are three types of components: 
  • Client components, which correlate to the client containers. 
  • Web components - Servlets and JSPs. 
  • EJB components - are business components that run on the server, which is logic that solves or meets the needs of a particular business domain such as banking, retail, or finance.