Skip to Main Content
Enterprise JavaBeans 3.1, 6th Edition
book

Enterprise JavaBeans 3.1, 6th Edition

by Andrew Lee Rubinger, Bill Burke
September 2010
Intermediate to advanced content levelIntermediate to advanced
766 pages
18h 35m
English
O'Reilly Media, Inc.
Content preview from Enterprise JavaBeans 3.1, 6th Edition

Chapter 4. Developing Your First EJBs

Now that we’ve covered the concepts behind the various component models and container services provided by the specification, it’s time to start putting these lessons into practice. In this chapter we’ll introduce the terminology and syntax necessary to code, package, deploy, and test some functional EJBs.

Step 1: Preparation

Let’s briefly lay out some definitions and conventions, and then we’ll get to hacking away.

Definitions

EJBs are composed from the following.

Bean implementation class (session and message-driven beans)

This class, written by the bean provider, contains the business logic for a session or message-driven bean. It is annotated with the appropriate bean type: @javax.ejb.Stateless, @javax.ejb.Stateful, or @javax.ejb.MessageDriven. For instance:

@javax.ejb.Stateless
public class MyFirstBean{...}

is all that’s needed to declare an SLSB.

Bean instance (session and message-driven beans)

The EJB Container internally contains one or more instances of the bean implementation class to service session or message-driven invocations. These are not exposed to the client, but are instead abstracted out by way of the client view. Entity bean instances are POJOs that may be created directly by the client using the new operator.

Client view (session and message-driven beans)

Because clients do not invoke upon bean instances directly, this is the contract with which a client will interact with the EJB. In the case of a session bean, the client view will ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick
JavaServer Faces

JavaServer Faces

Hans Bergsten
EJB 3 Developer Guide

EJB 3 Developer Guide

Michael Sikora

Publisher Resources

ISBN: 9781449399139Errata Page