Book description
The new 2.1 version of the Enterprise JavaBeans (EJB) spec extends its support for web services and the Java Web Services APIs, expands its asynchronous messaging support, adds XML Schema for deployment descriptors, and introduces a new Timer service, which allows for scheduling EJB jobs. The essential--and award winning--book on EJBs, Enterprise JavaBeans, has been completely revised and updated in this new fourth edition, to provide the real-world, nitty-gritty detail developers need to master EJB 2.1. Previous editions of this clear and engaging introduction to EJBs were voted the "Best Java Book" by the editors and readers of Java Developer's Journal, the "Best Java Book for Experts," by JavaPro editors, and one of the Top Computer Books by Amazon.com. The fourth edition lives up to--and surpasses--the excellent reputation earned by its predecessors. This authoritative and thorough guide includes everything that made previous editions the single must-have book for EJB developers: the authors solid grasp on the complexities of EJBs coupled with his succinct, easy-to-follow style; hundreds of clear, practical examples; adept coverage the key concepts EJBs ; and diagrams to illustrate the concepts presented. It also includes everything you need to get up to speed quickly on the changes wrought by EJB version 2.1, an architecture overview, information on resource management and primary services, design strategies, and XML deployment descriptors. In this edition, we're adding an EJB workbook for JBoss 4.0. The workbook shows how to deploy all of the examples on the JBoss 4.0 application server. It addresses an important problem with EJB: deploying the software on a server can be extremely difficult. JBoss is an open source project that has become the most widely used J2EE application server. Good technical authors may lay the facts before you, but great ones offer the distilled essence of their own experience and insight. Richard Monson-Haefel has provided just what Java developers need to know to harness the complexity of EJBs. What makes Monson-Haefel a master of technical authoring can be seen in his well-thought-out and logical progression of ideas, and in his examples practical, precise, usable examples, large enough to test key concepts but still small enough to be comprehensible taken apart and explained in the detail you need to deploy those principles in other situations. If you work with EJBs--or want to--this book will earn a favored spot on your bookshelf.
Publisher resources
Table of contents
-
Enterprise JavaBeans, 4th Edition
- Preface
-
I. Lay of the Land
- 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 Remote and Local Client View
- 6. CMP: Basic Persistence
-
7. 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. 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
- Functional Expressions
- EJB 2.1: The ORDER BY Clause
- Problems with EJB QL
- 9. Bean-Managed Persistence
-
10. The Entity-Container Contract
- The Primary Key
- The Callback Methods
- 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
-
11. Session Beans
-
The Stateless Session Bean
-
The ProcessPayment EJB
- The database table (PAYMENT)
- The remote interface (ProcessPaymentRemote)
- Dependent objects (CreditCardDO and CheckDO classes)
- An application exception (PaymentException)
- The home interface (ProcessPaymentHomeRemote)
- The bean class (ProcessPaymentBean)
- Accessing environment properties (JNDI ENC)
- The ProcessPayment EJBâs deployment descriptor
- Local component interfaces
-
The ProcessPayment EJB
- The Life Cycle of a Stateless Session Bean
-
The Stateful Session Bean
- Getting Set Up for the TravelAgent EJB
-
The TravelAgent EJB
- The remote interface (TravelAgent)
- Dependent object (TicketDO)
- The home interface (TravelAgentHomeRemote)
- Taking a peek at the client view
- TravelAgentBean: The bean class
- JNDI ENC and EJB references
- Remote EJB references in the JNDI ENC
- Local EJB references in the JNDI ENC
- The bookPassage( ) method
- Why use a Reservation entity bean?
- Listing behavior (listAvailableCabins( ))
- The TravelAgent deployment descriptor
- The Life Cycle of a Stateful Session Bean
-
The Stateless Session Bean
-
12. Message-Driven Beans
- JMS and Message-Driven Beans
- JMS-Based Message-Driven Beans
- The Life Cycle of a Message-Driven Bean
- Connector-Based Message-Driven Beans
- EJB 2.1: Message Linking
- 13. Timer Service
- 14. EJB 2.1: Web Service Standards
- 15. EJB 2.1 and Web Services
-
16. Transactions
- ACID Transactions
- Declarative Transaction Management
- Isolation and Database Locking
- Nontransactional Beans
- Explicit Transaction Management
- Exceptions and Transactions
- Transactional Stateful Session Beans
- 17. J2EE
-
18. XML Deployment Descriptors
- The ejb-jar File
- The Contents of a Deployment Descriptor
- The Document Headerand Schema Declarations
- The Descriptorâs Body
- Describing Enterprise Beans
- Describing Relationships
- Describing Bean Assembly
- 19. EJB Design in the Real World
-
II. JBoss Workbook
- 20. Introduction
- 21. JBoss Installation and Configuration
- 22. Exercises for Chapter 4
- 23. Exercises for Chapter 5
- 24. Exercises for Chapter 6
- 25. Exercises for Chapter 7
- 26. Exercises for Chapter 8
- 27. Exercises for Chapter 9
- 28. Exercises for Chapter 11
-
29. Exercises for Chapter 12
- Exercise 12.1: JMS as a Resource
- Exercise 12.2: The Message-Driven Bean
- 30. Exercises for Chapter 13
- 31. Exercises for Chapter 15
- A. Database Configuration
- Index
- Colophon
Product information
- Title: Enterprise JavaBeans, Fourth Edition
- Author(s):
- Release date: June 2004
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596005306
You might also like
book
Enterprise JavaBeans, Third Edition
Enterprise JavaBeans was recently voted "Best Java Book" by the editors and readers of Java Developer's …
book
Enterprise JavaBeans 3.1, 6th Edition
Learn how to code, package, deploy, and test functional Enterprise JavaBeans with the latest edition of …
book
Enterprise JavaBeans 3.0, 5th Edition
If you're up on the latest Java technologies, then you know that Enterprise JavaBeans (EJB) 3.0 …
book
J2EE™ Technology in Practice: Building Business Applications With the Java™ 2 Platform, Enterprise Edition
Since its introduction, The Java 2 Platform, Enterprise Edition (J2EE) has achieved remarkable success among application …