Book description
Enterprise JavaBeans was recently voted "Best Java Book" by the editors and readers of Java Developer's Journal. Readers of JavaPro named it the "Best Java Book for Experts." And Amazon.com included it in the Top Computer Books for 2000. Now the best only gets better! In the new 3rd edition, Enterprise JavaBeans has been completely revised and updated with a thorough introduction to the new 2.0 version of the EJB specification. Significantly different from the earlier version, the 2.0 specification introduces three dramatic improvements: A completely new version of container-managed persistence; local interfaces; and a totally new kind of bean called the "message driven bean." The new version of container-managed persistence (CMP) beans in 2.0 is more portable and robust than in the older 1.1 version. Most significant is the introduction of the relationship fields, which allow entity beans to declare relationships with each other as natural references. In order to make this huge leap in component relationships possible, EJB 2.0 had to redesign how entity beans are defined and interact. Our new 3rd edition examines this critical CMP model in detail. Local interfaces are thoroughly discussed as well. Local interfaces allow beans that are co-located to interact without the overhead of remote method calls. This improves the performance of beans considerably and complements the CMP relationship fields. Message driven beans are a new kind of enterprise bean based on asynchronous messaging and the Java Message service (JMS). Instead of responding to Java RMI calls, message driven beans process JMS messages sent by messaging clients. An entire chapter is devoted to message-driven beans and how to use them effectively. In addition, the 3rd edition contains an architecture overview, information on resource management and primary services, design strategies, and XML deployment descriptors.
Table of contents
-
Enterprise JavaBeans, 3rd Edition
- Dedication
- Preface
- 1. Introduction
- 2. Architectural Overview
- 3. Resource Management and the Primary Services
-
4. Developing Your First Enterprise Beans
- Choosing and Setting Up an EJB Server
- Developing an Entity Bean
- Developing a Session Bean
- 5. The Client View
- 6. EJB 2.0 CMP: Basic Persistence
-
7. EJB 2.0 CMP: Entity Relationships
-
The Seven Relationship Types
- Abstract Persistence Schema
- Database Modeling
- One-to-One Unidirectional Relationship
- One-to-One Bidirectional Relationship
- One-to-Many Unidirectional Relationship
- The Cruise, Ship, and Reservation EJBs
- Many-to-One Unidirectional Relationship
- One-to-Many Bidirectional Relationship
- Many-to-Many Bidirectional Relationship
- Many-to-Many Unidirectional Relationship
- Co-location and the Deployment Descriptor
- Cascade Delete and Remove
-
The Seven Relationship Types
-
8. EJB 2.0 CMP: EJB QL
- Declaring EJB QL
- The Query Methods
-
EJB QL Examples
- Simple Queries
- Simple Queries with Paths
- The IN Operator
- Using DISTINCT
- The WHERE Clause and Literals
- The WHERE Clause and Input Parameters
- The WHERE Clause and Operator Precedence
- The WHERE Clause and CDATA Sections
- The WHERE Clause and Arithmetic Operators
- The WHERE Clause and Logical Operators
- The WHERE Clause and Comparison Symbols
- The WHERE Clause and Equality Semantics
- The WHERE Clause and BETWEEN
- The WHERE Clause and IN
- The WHERE Clause and IS NULL
- The WHERE Clause and IS EMPTY
- The WHERE Clause and MEMBER OF
- The WHERE Clause and LIKE
- The WHERE Clause and Functional Expressions
- Problems with EJB QL
- 9. EJB 1.1 CMP
- 10. Bean-Managed Persistence
-
11. The Entity-Container Contract
- The Primary Key
- The Callback Methods
- EJB 2.0: ejbHome( )
- EntityContext
-
The Life Cycle of an Entity Bean
- Does Not Exist
- The Pooled State
-
The Ready State
- Transitioning from the Pooled state to the Ready state via creation
- Transitioning from the Pooled state to the Ready state via a query method
- Transitioning from the Pooled state to the Ready state via activation
- Transitioning from the Ready state to the Pooled state via passivation
- Transitioning from the Ready state to the Pooled state via removal
- Life in the Ready State
- End of the Life Cycle
-
12. Session Beans
-
The Stateless Session Bean
-
The ProcessPayment EJB
- PAYMENT: The database table
- ProcessPaymentRemote: The remote interface
- Dependent objects: The CreditCardDO and CheckDO classes
- PaymentException: An application exception
- ProcessPaymentHomeRemote: The home interface
- ProcessPaymentBean: The bean class
- JNDI ENC: Accessing environment properties
- EJBContext
- The ProcessPayment EJB’s deployment descriptor
- EJB 2.0: Local component interfaces
-
The ProcessPayment EJB
- The Life Cycle of a Stateless Session Bean
-
The Stateful Session Bean
- EJB 2.0: Getting Set Up for the TravelAgent EJB
- EJB 1.1: Getting Set Up for the TravelAgent EJB
-
The TravelAgent EJB
- TravelAgent: The remote interface
- Dependent object: TicketDO
- TravelAgentHomeRemote: The home interface
- Taking a peek at the client view
- TravelAgentBean: The bean class
- JNDI ENC and EJB references
- The bookPassage( ) method
- Why use a Reservation entity bean?
- listAvailableCabins( ): Listing behavior
- EJB 2.0: The TravelAgent deployment descriptor
- EJB 1.1: The TravelAgent deployment descriptor
- The Life Cycle of a Stateful Session Bean
-
The Stateless Session Bean
-
13. Message-Driven Beans
- JMS as a Resource
-
Message-Driven Beans
-
The ReservationProcessor EJB
- The ReservationProcessorBean Class
- MessageDrivenBean interface
- MessageDrivenContext
- MessageListener interface
- The onMessage( ) method: Workflow and integration for B2B
- Sending messages from a message-driven bean
- XML deployment descriptor
- <message-selector>
- Message selector examples
- <acknowledge-mode>
- <message-driven-destination>
- The ReservationProcessor clients
- The Life Cycle of a Message-Driven Bean
-
The ReservationProcessor EJB
-
14. Transactions
- ACID Transactions
- Declarative Transaction Management
- Isolation and Database Locking
- Nontransactional Beans
- Explicit Transaction Management
- Exceptions and Transactions
- Transactional Stateful Session Beans
-
15. Design Strategies
- Hash Codes in Compound Primary Keys
- Passing Objects by Value
- Improved Performance with Session Beans
- Bean Adapters
- Implementing a Common Interface
- Entity Beans Without Create Methods
- EJB 1.1: Object-to-Relational Mapping Tools
- Avoid Emulating Entity Beans with Session Beans
- Direct Database Access from Session Beans
- Avoid Chaining Stateful Session Beans
-
16. XML Deployment Descriptors
- What Is an XML Deployment Descriptor?
- The Contents of a Deployment Descriptor
- The Document Header
- The Descriptor’s Body
- Describing Enterprise Beans
- EJB 2.0: Describing Relationships
- Describing Bean Assembly
- The ejb-jar File
- 17. Java 2, Enterprise Edition
-
A. The Enterprise JavaBeans API
-
Package: javax.ejb
- EJB 2.0: AccessLocalException
- CreateException
- DuplicateKeyException
- EJBContext
- EJBException
- EJBHome
- EJB 2.0: EJBLocalHome
- EJB 2.0: EJBLocalObject
- EJBMetaData
- EJBObject
- EnterpriseBean
- EntityBean
- EntityContext
- FinderException
- Handle
- HomeHandle
- EJB 2.0: MessageDrivenBean
- EJB 2.0: MessageDrivenContext
- NoSuchEntityException
- ObjectNotFoundException
- RemoveException
- SessionBean
- SessionContext
- SessionSynchronization
- EJB 2.0: TransactionRequiredLocalException
- EJB 2.0: TransactionRolledbackLocalException
- EJB 2.0: Package: javax.jms
- EJB 2.0: Package: javax.ejb.spi
-
Package: javax.ejb
- B. State and Sequence Diagrams
- C. EJB Vendors
- Index
- Colophon
Product information
- Title: Enterprise JavaBeans, Third Edition
- Author(s):
- Release date: September 2001
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596002268
You might also like
book
Enterprise JavaBeans, Fourth Edition
The new 2.1 version of the Enterprise JavaBeans (EJB) spec extends its support for web services …
book
EJB™ 2.1 Kick Start
Not just another EJB book, EJB 2.1 Kick Start distinguishes itself in two key ways. First, …
book
Expert One-on-One™ J2EE™ Development without EJB™
What is this book about? Expert One-on-One J2EE Development without EJB shows Java developers and architects …
book
Running Applications on Oracle Exadata
Maximize Application Performance on Oracle Exadata Written by an enterprise architect specializing in applications on Oracle's …