0% found this document useful (0 votes)
26 views13 pages

Chapter 03

This module discusses converting POJOs to Enterprise Java Beans (EJBs). It covers the different types of EJBs - session and message driven beans. Session beans can be stateless, stateful, or singletons, while message driven beans process messages asynchronously. The module demonstrates how to automatically generate EJBs in Eclipse and convert a POJO by annotating it with Java EE annotations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views13 pages

Chapter 03

This module discusses converting POJOs to Enterprise Java Beans (EJBs). It covers the different types of EJBs - session and message driven beans. Session beans can be stateless, stateful, or singletons, while message driven beans process messages asynchronously. The module demonstrates how to automatically generate EJBs in Eclipse and convert a POJO by annotating it with Java EE annotations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Module 03

CREATING ENTERPRISE JAVA BEANS


Agenda
• Converting a POJO to an EJB
ENTERPRISE JAVA BEANS (EJB)
• EJBs provide low-level system services
• The business logic is encapsulated into a portable component
• Client code is simplified
• EJBs provide transactional capabilities
• EJB components can be secured for access on a group or role basis
• EJBs can be accessed by multiple different types of clients,
REVIEWING THE TYPES OF EJB
• Session:
• Message Driven Bean (MDB):
SESSION BEANS
• Stateless Session Beans
• Stateful Session Beans
• Singleton
MESSAGE DRIVEN BEANS
• To process messages asynchronously
• onMessage()
• The MDB is stateless and does not maintain any conversational state
with clients.
• They can also participate in transactions and the application
• There are numerous use cases where MDBs can be used.
GENERATING AN EJB AUTOMATICALLY
• In Project Explorer pane, New
• Once the search pane opens, navigate to EJB and choose Session
Bean (EJB 3.x).
GENERATING AN EJB AUTOMATICALLY
• Provide the package name, and then click Next
GENERATING AN EJB AUTOMATICALLY
• Optionally, specify an alternative name to be used when injecting this
EJB
GENERATING AN EJB AUTOMATICALLY
• The new EJB class opens in the editor window
CONVERTING A POJO TO AN EJB
• simple process of annotating the POJO with one or more annotations
defined in the Java EE standard
• Example :
GUIDED EXERCISE
• CREATING A STATELESS EJB
SUMMARY
• In this Module, you learned:
• An Enterprise Java Bean (EJB)
• An EJB provides multi-threading, concurrency, transactions
• There are two different types of EJB
• A Message Driven Bean (MDB)

You might also like