Enterprise JavaBeans

Enterprise JavaBeans are server-side components that encapsulate the business logic of an application. Enterprise JavaBeans (EJB) simplify application development by automatically taking care of transaction management and security. There are two types of Enterprise JavaBean: session beans, which perform business logic, and message-driven beans, which act as a message listener.

Readers familiar with previous versions of J2EE will notice that entity beans were not mentioned in the preceding paragraph. In Java EE 5, entity beans were deprecated in favor of the Java Persistence API (JPA). Entity beans are still supported for backwards compatibility; however, the preferred way of doing Object Relational Mapping (ORM) is through the JPA.

The following topics will be covered in this chapter:

  • Session beans
  • A simple session bean
  • A more realistic example
  • Using a session bean to implement the DAO design pattern
    • Singleton session beans
  • Message-driven beans
  • Transactions in enterprise JavaBeans
  • Container-managed transactions
  • Bean-managed transactions
  • Enterprise JavaBeans life cycles
  • Stateful session bean life cycle
  • Stateless session bean life cycle
  • Message-driven bean life cycle
  • EJB timer service
  • EJB Security
..................Content has been hidden....................

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