Java Reference
In-Depth Information
Chapter 3. Beginning Java EE 6 - EJBs
In the previous chapter, we learned some basics about how to set up and deploy a
HelloWorld application on JBoss AS 7. In this chapter, we will go a little deeper and
learn how to create, deploy, and assemble Enterprise JavaBeans, which are at the
heart of most Enterprise applications.
In greater detail, here is what you will learn in this chapter:
• What the new EJB 3.1 features introduced by the Java EE 6 specification
are
• How to develop a singleton EJB
• How to create stateless and stateful Enterprise JavaBeans
• How to add schedulers and timers to your application
• How to make use of asynchronous APIs in an EJB project
EJB 3.1 - new features
Based on the Enterprise JavaBeans ( EJB ) specification, Enterprise JavaBeans are
Java components that typically implement the business logic of Java Enterprise Edi-
tion ( JEE ) applications as well as data access.
There are basically three types of Enterprise JavaBeans:
Stateless Session Beans ( SLSB ): SLSB are objects whose instances
have no conversational state. This means that all these bean instances
are equivalent when they are not servicing a client.
Stateful Session Beans ( SFSB ): SFSB support conversational services
with tightly coupled clients. A stateful session bean accomplishes a task
for a particular client. It maintains the state for the duration of a client ses-
sion. After session completion, the state is not retained.
Message-driven beans ( MDB ): MDB are a kind of Enterprise Bean that
are able to asynchronously process messages sent by any JMS producer.
(We will discuss MDB in Chapter 7 , Adding Java Message Service to Your
Applications .)
Search WWH ::




Custom Search