Enterprise JavaBeans

Enterprise JavaBeans (EJBs) are the Java classes where you can write your business logic. Though it is not a strict requirement to use EJBs to write business logic, they do provide many of the services that are essential in enterprise applications. These services are security, transaction management, component lookup, object pooling, and so on.

You can have EJBs distributed across multiple servers and let the application container (also called the EJB container) take care of component lookup (searching component) and component pooling (useful for scalability). This can improve the scalability of the application.

EJBs are of two types:

  • Session beans: Session beans are called directly by clients or middle-tier objects
  • Message-driven beans: Message-driven beans are called in response to Java Messaging Service (JMS) events

JMS and message-driven beans can be used for handling asynchronous requests. In a typical asynchronous request processing scenario, the client puts a request in a messaging queue or a topic and does not wait for immediate response. An application on the server side gets the request message, either directly using JMS APIs or by using MDBs. It processes the request and may put the response in a different queue or topic, to which the client would listen and get the response.

Java EE 8 contains EJB specification 3.2 and JMS specification 2.0.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.216.254