did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9781590596715

Beginning Ejb 3 Application Development

by
  • ISBN13:

    9781590596715

  • ISBN10:

    1590596714

  • Format: Paperback
  • Copyright: 2006-09-25
  • Publisher: Apress
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $54.99 Save up to $1.65
  • Buy New
    $53.34
    Add to Cart Free Shipping Icon Free Shipping

    USUALLY SHIPS IN 2-3 BUSINESS DAYS

Supplemental Materials

What is included with this book?

Summary

EJB 3.0 has made huge advances in ease of development, and its drastically simplified programming model has been widely acclaimed. Targeted at Java and J2EE developers both with and without prior EJB experience, Beginning EJB 3 takes readers through the details of the EJB 3.0 architecture, and shows how EJB can be used to develop powerful, standards-based backend business logic. With 12 years of combined EJB experience, the authors offer many practical insights into the entire EJB architecture and cover all areas of the EJB 3.0 specification. With Java and SQL under your belt, this book will teach you EJB 3 from the ground up. It provides a complete and practical roadmap to EJB 3 architecture and programming. And it covers upgrade issues that you'll encounter when migrating from EJB 2.1 to EJB 3.0, so it's highly relevant if you're already an EJB developer.

Table of Contents

Foreword xix
About the Authors xxiii
About the Technical Reviewer xxv
Acknowledgments xxvii
Introduction to the EJB 3 Architecture
1(26)
An Introduction to EJB
2(8)
What Is EJB?
2(1)
The EJB Component Model
3(1)
The EJB Framework
3(1)
Core Features of EJB
3(2)
Progression of the EJB Spec
5(1)
EJB 3 Simplified Development Model
6(3)
Distributed Computing Model
9(1)
How This Book Is Organized
10(3)
Chapter 1: Introduction to the EJB 3 Architecture
11(1)
Chapter 2: EJB 3 Session Beans
11(1)
Chapter 3: Entities and the Java Persistence API
11(1)
Chapter 4: Advanced Persistence Features
11(1)
Chapter 5: EJB 3 Message-Driven Beans
11(1)
Chapter 6: EJB 3 and Web Services
12(1)
Chapter 7: Integrating Session Beans, Entities, Message-Driven Beans, and Web Services
12(1)
Chapter 8: Transaction Support in EJB 3
12(1)
Chapter 9: EJB 3 Performance and Testing
12(1)
Chapter 10: Migrating EJB 2.x Applications to EJB 3
12(1)
Chapter 11: EJB 3 Deployment
12(1)
Chapter 12: EJB 3 Client Applications
13(1)
Getting Started
13(12)
Prerequisites for Installing the GlassFish Application Server
14(1)
Installing the GlassFish Application Server
15(2)
Environment Variables Setup
17(3)
Starting and Testing the GlassFish Installation
20(5)
Conclusion
25(2)
EJB 3 Session Beans
27(30)
Introduction
27(1)
Introduction to Session Beans
27(4)
Types of Session Beans
28(1)
When Do You Use Session Beans?
28(3)
Stateless Session Beans
31(9)
The Bean Class
31(1)
The Business Interface
32(3)
Business Methods
35(1)
Dependency Injection
36(1)
Callback Methods
37(1)
Interceptors
38(2)
Stateful Session Beans
40(6)
The Bean Class
40(1)
The Business Interface
41(2)
Business Methods
43(1)
Callback Methods
44(2)
Interceptors
46(1)
Exception Handling
46(1)
Client View for Session Beans
46(4)
Packaging, Deploying, and Testing the Session Beans
50(6)
Prerequisites
50(1)
Compiling the Session Beans
51(1)
Packaging the Session Beans
52(1)
Deploying the Session Beans
53(1)
Compiling the Client Programs
54(1)
Running the Client Programs
54(2)
Conclusion
56(1)
Entities and the Java Persistence API
57(46)
An Entity Example
59(14)
A Simple JavaBean: Customer.java
59(1)
A Simple Entity: Customer.java
59(2)
An Entity with Defaults Exposed: Customer.java
61(3)
Coding Requirements
64(2)
Example: Annotating Instance Variables
66(1)
Example: Annotating Property Accessors
67(1)
Declaring the Primary Key
68(1)
Simple Primary Key
69(1)
Composite Primary Key
70(3)
Summary of Entity Examples
73(1)
The Persistence Archive
73(1)
The persistence.xml File
73(1)
The EntityManager
74(3)
Persistence Context
74(1)
Acquiring an EntityManager Instance
75(2)
Transaction Support
77(1)
The Entity Life Cycle
77(2)
The Life Cycle of a New Entity Instance
77(2)
O/R Mapping
79(3)
The @Table Annotation (Revisited)
80(1)
The @Column Annotation (Revisited)
81(1)
Complex Mappings
82(1)
Entity Relationships
82(4)
@OneToOne
82(1)
@OneToMany and @ManyToOne
83(1)
@ManyToMany
84(1)
Lazy vs. Eager Field Bindings
85(1)
Cascading Operations
86(1)
JPQL
86(4)
@NamedQuery and @NamedQueries
87(1)
Binding Query Parameters
88(1)
Dynamic Queries
88(1)
Bulk Update and Delete Operations
89(1)
Complex Queries
90(1)
Forward Generation vs. Reverse Engineering
90(1)
Forward Generation == Persistence
90(1)
Reverse Engineering == Adaption
90(1)
Which One Is Right for Your Project?
91(1)
Example Application: CustomerOrderManager
91(11)
Customer.java
91(2)
CustomerOrder.java
93(3)
Address.java
96(3)
CustomerOrderManager.java
99(1)
CustomerOrderClient.java
100(1)
persistence.xml
101(1)
Conclusion
102(1)
Advanced Persistence Features
103(46)
Mapping Entity Inheritance Hierarchies
104(23)
Getting Started
105(1)
Entity Inheritance Mapping Strategies
105(3)
Single-Table-per-Class Inheritance Hierarchy (InheritanceType.Single_Table)
108(10)
Common Base Table with Joined Subclass Tables (InheritanceType.JOINED)
118(4)
Single-Table-per-Outermost Concrete Entity Class (InheritanceType.TABLE_PER_CLASS)
122(4)
Comparison of O/R Implementation Approaches
126(1)
Using Abstract Entities, Mapped Superclasses, and Non-Entity Classes in an Inheritance Hierarchy
127(6)
Abstract Entity Class
127(1)
Mapped Superclass (@MappedSuperclass)
128(2)
Non-Entity Class
130(1)
Embedded Non-Entity Class Usage (@Embeddable and @Embedded)
131(2)
Polymorphic Relationships
133(1)
Relationship Mapping
134(1)
Polymorphic JPQL Queries
134(1)
Using Native SQL Queries
135(1)
Composite Primary Keys and Nested Foreign Keys
136(5)
Using an Embedded Composite Key (@Embeddedld)
136(2)
Exposing Composite Key Class Fields Directly on the Entity Class (@IdClass)
138(1)
Mapping Relationships That Use Composite Keys
139(2)
Support for Optimistic Locking (@Version)
141(1)
Support for Autogenerated Primary Key Values (@GeneratedValue)
142(2)
Interceptors: Entity Callback Methods
144(1)
Conclusion
145(4)
EJB 3 Message-Driven Beans
149(28)
Introduction
149(1)
Message-Oriented Architecture
149(4)
What Is JMS?
150(1)
Messaging Application Architecture
151(2)
Using MDBs
153(16)
When Do You Use MDBs?
153(1)
MDB Classes
154(3)
Configuration Properties
157(4)
Dependency Injection in MDBs
161(2)
Callback Methods
163(1)
Interceptors
163(2)
Exception Handling
165(1)
Client View
165(4)
Packaging, Deploying, and Testing MDBs
169(7)
Prerequisites
169(1)
Compiling the Session Beans and MDBs
169(1)
Packaging the Session Beans and MDBs
170(1)
Creating the JMS and JavaMail Resources
171(2)
Deploying the Session Beans and MDBs
173(1)
Compiling the Client Programs
174(1)
Running the Client Programs
175(1)
Conclusion
176(1)
EJB 3 and Web Services
177(28)
Introduction
177(1)
What Are Web Services?
177(8)
UDDI
178(1)
WSDL
179(4)
SOAP
183(2)
When Do You Use Web Services?
185(1)
Java EE and Web Services
185(1)
JAX-WS
185(1)
JAXB
186(1)
JAXR
186(1)
SAAJ
186(1)
JSR 181
186(1)
EJB 3 Stateless Session Beans As Web Services
186(5)
Developing a New Web Service
187(4)
Packaging, Deploying, and Testing Web Services
191(6)
Prerequisites
191(1)
Compiling the Session Bean
192(1)
Packaging the Session Bean
193(1)
Deploying the Session Bean
194(1)
Testing the Credit Service Using the GlassFish Console
195(2)
Web Service Client View
197(6)
Developing a Java Client That Accesses the Web Service
198(4)
Session Beans as Web Service Clients
202(1)
Conclusion
203(2)
Integrating Session Beans, Entities, Message-Driven Beans, and Web Services
205(52)
Introduction
205(1)
Application Overview
205(1)
Application Components and Services
206(2)
The Shopping Cart Component
206(1)
The Search Facade Component
207(1)
The Customer Facade Component
207(1)
The Order Processing Facade Component
207(1)
Persistence Services
207(1)
The E-mail Service
207(1)
The Credit Service
207(1)
The Order Processing Service
208(1)
The Wines Online Application Business Process
208(1)
In-Depth Component/Service Walkthrough
209(30)
Persistence Services
209(1)
The Customer Facade Component
210(3)
The Search Facade Component
213(2)
The Shopping Cart Component
215(7)
The Order Processing Facade Component
222(7)
The Order Processing Service
229(7)
The E-mail Service
236(2)
The Credit Service
238(1)
The Database Schema
238(1)
Packaging, Deploying, and Testing the Application
239(11)
Prerequisites
240(1)
Deploying the Credit Service
240(1)
Compiling the Persistence Unit
241(1)
Packaging the Persistence Unit
242(1)
Compiling the Business Services (Session Beans and MDBs)
243(1)
Packaging the Business Services
244(1)
Assembling the Application
245(1)
Creating the Database Schema
245(1)
Creating Data Sources, JMS Resources, and Mail Resources
245(5)
Deploying the Application
250(1)
A Simple Test Client for the Application
250(5)
Running the Client Program
253(2)
Conclusion
255(2)
Transaction Support in EJB 3
257(34)
What Is a Transaction?
258(2)
Distributed Transactions
258(1)
The ACID Properties of a Transaction
259(1)
The JTA
260(1)
The Two-Phase Commit Protocol
260(1)
Transaction Support in EJB
260(2)
EJB Transaction Services
261(1)
Session Bean Transactional Behavior in the Service Model
262(5)
Container-Managed Transaction Demarcation
262(4)
Bean-Managed Transaction Demarcation
266(1)
Entity Transactional Behavior in the Persistence Model
267(2)
How Entities Become Associated with a Transaction Context
267(1)
Container-Managed vs. Application-Managed Persistence Context
268(1)
Transaction-Scoped Persistence Context vs. Extended Persistence Context
268(1)
JTA vs. Resource-Local EntityManager
269(1)
A Transactional Scenario from the Wines Online Application
269(21)
Setting Up the Examples
270(1)
Stateless Session Beans with CMT Demarcation
271(10)
Stateful Session Beans with BMT Demarcation and Extended Persistence Context
281(9)
Conclusion
290(1)
EJB 3 Performance and Testing
291(30)
The Testing Methodology
292(6)
Performance Criteria
293(2)
Simulating Application Usage
295(1)
Defining Test Metrics
296(2)
The Grinder
298(2)
The Test Application
300(4)
The Performance Test
304(16)
The Test Environment
304(1)
The Test Script
305(1)
Setup
306(5)
Preliminary Tests
311(2)
Sample Size
313(1)
Calibration
313(1)
The Actual Test Runs
314(2)
Analyzing the Results
316(4)
Conclusion
320(1)
Migrating EJB 2.x Applications to EJB 3
321(40)
Getting Started
322(1)
Session Bean Migration
323(8)
EJB 2.1 Session Bean
323(1)
EJB 2.1 ejb-jar.xml File
324(1)
EJB 3 Session Bean Class
325(1)
Migrating the EJB 2.1 Session Bean Class
326(1)
Migrating the EJB 2.1 Session Bean Interfaces
327(1)
Migrating the EJB 2.1 Session Bean ejb-jar.xml Properties
328(2)
Migrating an EJB 2.1 Web Service Endpoint Interface
330(1)
Session Bean Migration Wrap-Up
331(1)
MDB Migration
331(2)
Entity Bean Migration
333(2)
EJB Client Migration
335(1)
Migrating an EJB 2.1 Session Bean Client
335(1)
End-to-End EJB Application Migration Example
336(19)
EJB 2.1 Application Source
337(11)
EJB 3 Application Source
348(7)
Migrating Our Application to Run Outside a Java EE Container
355(4)
EJB 3 Session Bean Class Running Outside the EJB Container
356(1)
EJB 3 persistence.xml File with an Outside-the-Container Persistence Unit
357(1)
EJB 3 Application-Managed EntityManager Client
358(1)
Conclusion
359(2)
EJB 3 Deployment
361(24)
A Note on Deployment Tools
362(1)
Overview of the Deployment Process
363(5)
The Provider
363(1)
The Assembler
363(3)
The Deployer
366(2)
Java EE Deployment Infrastructure
368(1)
The Java EE Server
368(1)
The Java EE Containers
368(1)
Java EE Deployment Components
369(6)
The Java EE Application
369(1)
Java EE Module Types
369(3)
Library Components
372(3)
Application Servers and Platform Independence
375(1)
Deployment Tools
376(1)
The Deployment Plan
376(1)
Deployment Roles
376(5)
The Application Assembler
377(3)
The Application Deployer
380(1)
Assembling an EJB JAR Module
381(1)
Naming Scope
382(1)
Assembling a Persistence Unit
382(1)
Naming Scope
383(1)
Conclusion
383(2)
EJB 3 Client Applications
385(60)
Application Architecture
385(5)
JSF
390(6)
Evolution of Java EE Web Technologies
391(2)
JSF Architecture
393(2)
JSF Tools and Components
395(1)
Developing Web Applications Using JSF and EJB
396(36)
The Login Page
398(4)
The New Customer Registration Page
402(7)
The Links Page
409(4)
The Search Page
413(6)
The Wine List Page
419(4)
The Display Selected Wine Details Page
423(5)
The Display Cart Items Page
428(3)
The Notification Page
431(1)
Packaging, Deploying, and Testing the Application
432(10)
Prerequisites
432(1)
Compiling and Packaging the JSF Application
433(1)
Assembling the Wine Store Application
434(1)
Deploying the Wine Store Application
434(1)
Running the Wine Store Application
435(7)
The Application Client Container
442(1)
Conclusion
443(2)
APPENDIX Performance: EJB 2 vs. EJB 3
445(20)
The DTO Design Pattern
446(10)
The Session Facade Design Pattern
456(4)
Container-Managed Relationships
460(4)
Conclusion
464(1)
Index 465

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program