You are previewing Beginning EJB 3: Java EE 7 Edition.
O'Reilly logo
Beginning EJB 3: Java EE 7 Edition

Book Description

Targeted at Java and Java EE developers both with and without prior Enterprise JavaBeans (EJB) experience, Beginning EJB 3, Java EE 7 Edition will guide you in building enterprise software based on the latest cross-platform industry standards. Learn how to use the EJB 3 API to develop powerful, standards-based backend business logic for creating the complex enterprise applications that run today's transactions and more.

With over 20 years of combined EJB experience, the authors offer many practical insights into designing and coding EJB components in combination with related Java EE technologies. EJB has made huge advances in the ease of building enterprise, server-side Java components and business logic development, and has drastically simplified programming models and design patterns. Use this book to harness that power and take your enterprise Java development to the next level.

Table of Contents

  1. Title Page
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. About the Authors
  6. About the Technical Reviewer
  7. Preface
  8. Acknowledgments
  9. CHAPTER 1: Introduction to the EJB Architecture
    1. An Introduction to EJB
    2. How This Book Is Organized
    3. Getting Started
    4. Conclusion
  10. CHAPTER 2: EJB Session Beans
    1. Introduction to Session Beans
    2. Stateless Session Beans
    3. Stateful Session Beans
    4. Singleton Session Beans
    5. Timer Service
    6. Client View for Session Beans
    7. Compiling, Deploying, and Testing the Session Beans
    8. Conclusion
  11. CHAPTER 3: Entities and the Java Persistence API
    1. An Entity Example
    2. The Persistence Archive
    3. The EntityManager
    4. The Entity Life Cycle
    5. O/R Mapping
    6. Entity Relationships
    7. Java Persistence Query Language (JPQL)
    8. Persistence vs. Adaption
    9. Example Application: CustomerOrderManager
    10. Compiling, Deploying, and Testing the JPA Entities
    11. Conclusion
  12. CHAPTER 4: Advanced Persistence Features
    1. Mapping Entity Inheritance Hierarchies
    2. Using Abstract Entities, Mapped Superclasses, and Non-Entity Classes in an Inheritance Hierarchy
    3. Polymorphic Relationships
    4. Polymorphic JPQL Queries
    5. Using Native SQL Queries
    6. The Query Criteria API
    7. Composite Primary Keys and Nested Foreign Keys
    8. Support for Optimistic Locking (@Version)
    9. Support for Autogenerated Primary Key Values (@GeneratedValue)
    10. Interceptors: Entity Callback Methods
    11. Compiling, Deploying, and Testing the JPA Entities
    12. Conclusion
  13. CHAPTER 5: EJB Message-Driven Beans
    1. Message-Oriented Architecture
    2. Using MDBs
    3. Compiling, Deploying, and Testing MDBs
    4. Conclusion
  14. CHAPTER 6: EJB and Web Services
    1. What Are Web Services?
    2. Java EE and Web Services
    3. EJB Stateless Session Beans as Web Services
    4. Packaging, Deploying, and Testing Web Services
    5. Web Service Client View
    6. Conclusion
  15. CHAPTER 7: Integrating Session Beans, Entities, Message-Driven Beans, and Web Services
    1. Introduction
    2. Application Overview
    3. Application Components and Services
    4. The Wines Online Application Business Process
    5. In-Depth Component/Service Walkthrough
    6. Building, Deploying, and Testing the Application
    7. Conclusion
  16. CHAPTER 8: Transaction Support in EJB
    1. What Is a Transaction?
    2. Transaction Support in EJB
    3. Session Bean Transactional Behavior in the Service Model
    4. Using Transactions with JPA Entities
    5. Two Sample Scenarios
    6. Building, Deploying, and Testing: A Transactional Scenario from the Wines Online Application
    7. Conclusion
  17. CHAPTER 9: EJB 3 Performance and Testing
    1. The Testing Methodology
    2. The Grinder
    3. The Test Application
    4. The Performance Test
    5. Conclusion
  18. CHAPTER 10: Contexts and Dependency Injection
    1. What Is CDI?
    2. Relationship with EJB
    3. CDI Concepts
    4. Interaction with Session Beans
    5. Compiling, Deploying, and Testing the CDI Application
    6. Conclusion
  19. CHAPTER 11: EJB Packaging and Deployment
    1. A Note on Deployment Tools
    2. Overview of the Packaging and Deployment Processes
    3. Java EE Deployment Infrastructure
    4. Java EE Deployment Components
    5. Application Servers and Platform Independence
    6. Deployment Roles
    7. Assembling an EJB JAR Module
    8. Assembling a Persistence Unit
    9. Conclusion
  20. CHAPTER 12: EJB Client Applications
    1. Application Architecture
    2. JSF
    3. Developing Web Applications Using JSF and EJB
    4. Compiling, Deploying, and Testing the JSF Application
    5. The Application Client Container
    6. Conclusion
  21. CHAPTER 13: Testing in an Embeddable EJB Container
    1. Test Clients
    2. EJB Lite
    3. Embeddable EJB Container
    4. How This Chapter Is Organized
    5. JUnit Tests
    6. Building and Testing the Sample Code
    7. Conclusion
  22. Index