| Acknowledgments |
|
xvi | |
| Introduction |
|
xvii | |
| Part One Overview |
|
1 | (76) |
|
|
|
3 | (24) |
|
The Motivation for Enterprise JavaBeans |
|
|
4 | (3) |
|
|
|
7 | (2) |
|
Service-Oriented Architectures |
|
|
8 | (1) |
|
Divide and Conquer to the Extreme with Reusable Services |
|
|
9 | (2) |
|
Introducing Enterprise JavaBeans |
|
|
11 | (4) |
|
|
|
12 | (1) |
|
EJB as a Business Tier Component |
|
|
13 | (2) |
|
|
|
15 | (6) |
|
|
|
16 | (1) |
|
The Application Assembler |
|
|
16 | (1) |
|
|
|
17 | (1) |
|
|
|
17 | (1) |
|
The Container and Server Provider |
|
|
18 | (1) |
|
|
|
18 | (1) |
|
|
|
19 | (2) |
|
The Java 2 Platform, Enterprise Edition (J2EE) |
|
|
21 | (5) |
|
|
|
22 | (4) |
|
|
|
26 | (1) |
|
Chapter 2 EJB Fundamentals |
|
|
27 | (26) |
|
|
|
27 | (3) |
|
|
|
28 | (2) |
|
Distributed Objects: The Foundation for EJB |
|
|
30 | (2) |
|
Distributed Objects and Middleware |
|
|
32 | (4) |
|
|
|
33 | (1) |
|
|
|
34 | (2) |
|
What Constitutes an Enterprise Bean? |
|
|
36 | (16) |
|
The Enterprise Bean Class |
|
|
36 | (1) |
|
|
|
37 | (5) |
|
|
|
42 | (2) |
|
|
|
44 | (4) |
|
|
|
48 | (1) |
|
|
|
49 | (1) |
|
|
|
49 | (1) |
|
|
|
50 | (2) |
|
|
|
52 | (1) |
|
Chapter 3 Writing Your First Bean |
|
|
53 | (24) |
|
How to Develop an EJB Component |
|
|
54 | (1) |
|
|
|
55 | (1) |
|
|
|
56 | (1) |
|
|
|
57 | (2) |
|
|
|
59 | (2) |
|
|
|
61 | (3) |
|
The Deployment Descriptor |
|
|
64 | (1) |
|
The Vendor-Specific Files |
|
|
65 | (1) |
|
|
|
65 | (1) |
|
|
|
66 | (1) |
|
The Optional EJB Client JAR File |
|
|
67 | (1) |
|
Understanding How to Call Beans |
|
|
68 | (4) |
|
|
|
68 | (4) |
|
|
|
72 | (1) |
|
|
|
73 | (1) |
|
|
|
73 | (1) |
|
Implementing Component Interfaces |
|
|
73 | (2) |
|
|
|
74 | (1) |
|
|
|
75 | (2) |
| Part Two The Triad of Beans |
|
77 | (190) |
|
Chapter 4 Introduction to Session Beans |
|
|
79 | (24) |
|
|
|
79 | (1) |
|
|
|
80 | (3) |
|
|
|
80 | (1) |
|
|
|
81 | (2) |
|
Special Characteristics of Stateful Session Beans |
|
|
83 | (19) |
|
Achieving the Effect of Pooling with Stateful Beans |
|
|
83 | (1) |
|
The Rules Governing Conversational State |
|
|
84 | (1) |
|
Activation and Passivation Callbacks |
|
|
85 | (3) |
|
Method Implementation Summary |
|
|
88 | (1) |
|
A Simple Stateful Session Bean |
|
|
88 | (10) |
|
Life Cycle Diagrams for Session Beans |
|
|
98 | (4) |
|
|
|
102 | (1) |
|
Chapter 5 Writing Session Bean Web Services |
|
|
103 | (16) |
|
|
|
103 | (7) |
|
|
|
106 | (3) |
|
XML Artifacts and Platform Independence |
|
|
109 | (1) |
|
Implementing a Web Service |
|
|
110 | (4) |
|
The JAX-RPC Service Endpoint Interface |
|
|
111 | (2) |
|
WSDL and the XML/Java Mapping |
|
|
113 | (1) |
|
Packaging and Deploying a Web Service Session Bean |
|
|
113 | (1) |
|
Implementing a Web Service Client |
|
|
114 | (3) |
|
|
|
117 | (2) |
|
Chapter 6 Introduction to Entity Beans |
|
|
119 | (22) |
|
|
|
119 | (3) |
|
Object-Relational Mapping |
|
|
120 | (2) |
|
|
|
122 | (3) |
|
About the Files That Make Up an Entity Bean |
|
|
124 | (1) |
|
|
|
125 | (11) |
|
Entity Beans Survive Failures |
|
|
125 | (1) |
|
Entity Bean Instances Are a View into a Database |
|
|
126 | (1) |
|
Several Entity Bean Instances May Represent the Same Underlying Data |
|
|
127 | (1) |
|
Entity Bean Instances Can Be Pooled |
|
|
128 | (3) |
|
There Are Two Ways to Persist Entity Beans |
|
|
131 | (1) |
|
Creation and Removal of Entity Beans |
|
|
132 | (4) |
|
Entity Beans Can Be Found |
|
|
136 | (3) |
|
You Can Modify Entity Bean Data without Using EJB |
|
|
136 | (1) |
|
|
|
137 | (1) |
|
getEJBLocalObject()/getEJBObject() |
|
|
138 | (1) |
|
|
|
138 | (1) |
|
|
|
139 | (2) |
|
Chapter 7 Writing Bean-Managed Persistent Entity Beans |
|
|
141 | (40) |
|
Entity Bean Coding Basics |
|
|
141 | (9) |
|
Finding Existing Entity Beans: Finder Methods |
|
|
143 | (7) |
|
Bean-Managed Persistence Example: A Bank Account |
|
|
150 | (25) |
|
|
|
151 | (1) |
|
|
|
152 | (1) |
|
|
|
153 | (2) |
|
|
|
155 | (1) |
|
|
|
156 | (2) |
|
|
|
158 | (12) |
|
|
|
170 | (1) |
|
|
|
171 | (2) |
|
The Deployment Descriptor |
|
|
173 | (2) |
|
The Container-Specific Deployment Descriptor |
|
|
175 | (1) |
|
|
|
175 | (1) |
|
Running the Client Program |
|
|
175 | (2) |
|
|
|
175 | (2) |
|
|
|
177 | (1) |
|
Putting It All Together: Walking through a BMP Entity Bean's Life Cycle |
|
|
177 | (3) |
|
|
|
180 | (1) |
|
Chapter 8 Writing Container-Managed Persistent Entity Beans |
|
|
181 | (36) |
|
Features of CMP Entity Beans |
|
|
181 | (10) |
|
CMP Entity Beans Are Subclassed |
|
|
181 | (1) |
|
CMP Entity Beans Have No Declared Persistent Fields |
|
|
182 | (2) |
|
CMP Get/Set Methods Are Defined in the Subclass |
|
|
184 | (2) |
|
CMP Entity Beans Have an Abstract Persistence Schema |
|
|
186 | (1) |
|
CMP Entity Beans Have a Query Language |
|
|
187 | (2) |
|
CMP Entity Beans Can Have ejbSelect() Methods |
|
|
189 | (2) |
|
Implementation Guidelines for Container-Managed Persistence |
|
|
191 | (5) |
|
Container-Managed Persistence Example: A Product Line |
|
|
196 | (18) |
|
|
|
197 | (1) |
|
|
|
198 | (1) |
|
|
|
198 | (2) |
|
|
|
200 | (1) |
|
|
|
201 | (2) |
|
|
|
203 | (4) |
|
The Deployment Descriptor |
|
|
207 | (3) |
|
The Container-Specific Deployment Descriptor |
|
|
210 | (2) |
|
|
|
212 | (2) |
|
Running the Client Program |
|
|
214 | (1) |
|
The Life Cycle of a CMP Entity Bean |
|
|
214 | (2) |
|
|
|
216 | (1) |
|
Chapter 9 Introduction to Message-Driven Beans |
|
|
217 | (38) |
|
Motivation to Use Message-Driven Beans |
|
|
217 | (2) |
|
|
|
219 | (7) |
|
|
|
220 | (2) |
|
|
|
222 | (4) |
|
|
|
226 | (5) |
|
What Is a Message-Driven Bean? |
|
|
227 | (4) |
|
Developing Message-Driven Beans |
|
|
231 | (10) |
|
|
|
231 | (3) |
|
|
|
234 | (7) |
|
|
|
241 | (3) |
|
JMS Message-Driven Bean Gotchas |
|
|
244 | (10) |
|
|
|
245 | (1) |
|
|
|
245 | (1) |
|
|
|
246 | (3) |
|
How to Return Results Back to Message Producers |
|
|
249 | (5) |
|
The Future: Asynchronous Method Invocations |
|
|
254 | (1) |
|
|
|
254 | (1) |
|
Chapter 10 Adding Functionality to Your Beans |
|
|
255 | (12) |
|
Calling Beans from Other Beans |
|
|
255 | (4) |
|
|
|
256 | (1) |
|
Understanding EJB References |
|
|
257 | (2) |
|
|
|
259 | (3) |
|
|
|
262 | (1) |
|
|
|
263 | (2) |
|
|
|
264 | (1) |
|
|
|
265 | (2) |
| Part Three Advanced Enterprise JavaBeans Concepts |
|
267 | (386) |
|
Chapter 11 EJB Best Practices |
|
|
269 | (30) |
|
|
|
270 | (2) |
|
How to Choose a Web Application Framework to Work with EJB |
|
|
272 | (3) |
|
Applying Model Driven Development in EJB Projects |
|
|
275 | (2) |
|
Applying Extreme Programming in EJB Projects |
|
|
277 | (2) |
|
|
|
279 | (3) |
|
|
|
279 | (1) |
|
Use Frameworks for EJB Unit Testing |
|
|
280 | (2) |
|
Implementing Client-Side Callback Functionality in EJB |
|
|
282 | (2) |
|
|
|
282 | (1) |
|
|
|
283 | (1) |
|
|
|
283 | (1) |
|
Choosing Between Servlets and Stateless Session Beans as Service Endpoints |
|
|
284 | (1) |
|
Considering the Use of Aspect-Oriented Programming Techniques in EJB Projects |
|
|
284 | (3) |
|
Aspect-Oriented Programming |
|
|
285 | (1) |
|
When to Use AOP in EJB Applications |
|
|
285 | (2) |
|
Reflection, Dynamic Proxy, and EJB |
|
|
287 | (1) |
|
Deploying EJB Applications to Various Application Servers |
|
|
288 | (2) |
|
|
|
290 | (1) |
|
Inheritance and Code Reuse in EJB |
|
|
291 | (2) |
|
Writing Singletons in EJB |
|
|
293 | (1) |
|
|
|
293 | (1) |
|
When to Use Messaging Versus RMI-IIOP |
|
|
294 | (3) |
|
|
|
297 | (2) |
|
|
|
299 | (50) |
|
Motivation for Transactions |
|
|
300 | (3) |
|
|
|
300 | (1) |
|
Network or Machine Failure |
|
|
301 | (1) |
|
Multiple Users Sharing Data |
|
|
302 | (1) |
|
|
|
303 | (3) |
|
|
|
304 | (2) |
|
|
|
306 | (4) |
|
|
|
306 | (2) |
|
|
|
308 | (2) |
|
Other Transactional Models |
|
|
310 | (1) |
|
Enlisting in Transactions with Enterprise JavaBeans |
|
|
310 | (7) |
|
Underlying Transaction System Abstraction |
|
|
310 | (1) |
|
Declarative, Programmatic, and Client-Initiated Transactions |
|
|
310 | (4) |
|
Choosing a Transaction Style |
|
|
314 | (3) |
|
Container-Managed Transactions |
|
|
317 | (7) |
|
EJB Transaction Attribute Values |
|
|
318 | (6) |
|
Programmatic Transactions in EJB |
|
|
324 | (6) |
|
CORBA Object Transaction Service |
|
|
324 | (1) |
|
The Java Transaction Service |
|
|
325 | (1) |
|
|
|
325 | (3) |
|
Declarative versus Programmatic Transactions Example |
|
|
328 | (2) |
|
Transactions from Client Code |
|
|
330 | (1) |
|
|
|
331 | (9) |
|
The Need for Concurrency Control |
|
|
332 | (2) |
|
|
|
334 | (2) |
|
The Unrepeatable Read Problem |
|
|
336 | (1) |
|
|
|
336 | (1) |
|
Transaction Isolation Summary |
|
|
337 | (1) |
|
|
|
338 | (1) |
|
Pessimistic and Optimistic Concurrency Control |
|
|
339 | (1) |
|
|
|
340 | (3) |
|
Durability and the Two-Phase Commit Protocol |
|
|
340 | (2) |
|
The Transactional Communications Protocol and Transaction Contexts |
|
|
342 | (1) |
|
Designing Transactional Conversations in EJB |
|
|
343 | (3) |
|
J2EE Transaction Service and Extended Transactions |
|
|
346 | (2) |
|
|
|
348 | (1) |
|
|
|
349 | (42) |
|
|
|
350 | (3) |
|
Violations, Vulnerabilities, and Risk |
|
|
351 | (1) |
|
|
|
351 | (2) |
|
|
|
353 | (4) |
|
Authentication in Web Applications |
|
|
354 | (1) |
|
|
|
355 | (1) |
|
Confidentiality and Integrity |
|
|
356 | (1) |
|
Understanding EJB Security |
|
|
357 | (21) |
|
|
|
357 | (11) |
|
|
|
368 | (9) |
|
|
|
377 | (1) |
|
|
|
378 | (3) |
|
|
|
379 | (1) |
|
|
|
379 | (2) |
|
|
|
381 | (8) |
|
|
|
382 | (1) |
|
XML Digital Signature and XML Encryption |
|
|
383 | (3) |
|
|
|
386 | (1) |
|
|
|
387 | (2) |
|
|
|
389 | (2) |
|
|
|
391 | (18) |
|
|
|
391 | (1) |
|
|
|
392 | (2) |
|
|
|
394 | (5) |
|
|
|
395 | (3) |
|
Interaction between the EJB and the Timer Service |
|
|
398 | (1) |
|
Timer Example: CleanDayLimitOrdersEJB |
|
|
399 | (7) |
|
The CleanDayLimitOrders EJB Remote Interface |
|
|
400 | (1) |
|
The CleanDayLimitOrders EJB Bean Class |
|
|
400 | (3) |
|
The CleanDayLimitOrders EJB Home Interface |
|
|
403 | (1) |
|
The CleanDayLimitOrders EJB Deployment Descriptor |
|
|
403 | (1) |
|
The CleanDayLimitOrders EJB Client |
|
|
404 | (1) |
|
|
|
405 | (1) |
|
Strengths and Limitations of EJB Timer Service |
|
|
406 | (2) |
|
|
|
408 | (1) |
|
Chapter 15 BMP and CMP Relationships |
|
|
409 | (36) |
|
The CMP and BMP Difference |
|
|
410 | (1) |
|
|
|
411 | (17) |
|
|
|
412 | (4) |
|
|
|
416 | (5) |
|
|
|
421 | (7) |
|
|
|
428 | (5) |
|
Implementing Directionality with BMP |
|
|
429 | (1) |
|
Implementing Directionality with CMP |
|
|
430 | (1) |
|
Directionality May Not Map to Database Schemas |
|
|
431 | (2) |
|
Bidirectional or Unidirectional? |
|
|
433 | (1) |
|
|
|
433 | (1) |
|
Aggregation Versus Composition and Cascading Deletes |
|
|
434 | (2) |
|
|
|
436 | (1) |
|
|
|
437 | (1) |
|
|
|
438 | (1) |
|
|
|
439 | (5) |
|
Relationships, Referential Integrity, and Client Code |
|
|
441 | (3) |
|
|
|
444 | (1) |
|
Chapter 16 Persistence Best Practices |
|
|
445 | (32) |
|
Comparing Entity Beans with Other Persistence Approaches |
|
|
446 | (4) |
|
|
|
446 | (1) |
|
|
|
446 | (1) |
|
Procedural versus Object-Oriented |
|
|
447 | (1) |
|
|
|
448 | (1) |
|
Enforcement of Schema Independence |
|
|
448 | (1) |
|
|
|
449 | (1) |
|
Rapid Application Development |
|
|
449 | (1) |
|
Choosing Between CMP and BMP |
|
|
450 | (3) |
|
Code Reduction and Rapid Application Development |
|
|
450 | (1) |
|
|
|
450 | (1) |
|
|
|
451 | (1) |
|
|
|
451 | (1) |
|
Application Server and Database Independence |
|
|
451 | (1) |
|
|
|
452 | (1) |
|
|
|
452 | (1) |
|
Choosing the Right Granularity for Entity Beans |
|
|
453 | (1) |
|
Persistence Tips and Tricks |
|
|
454 | (21) |
|
Beware the Object-Relational Impedance Mismatch |
|
|
454 | (1) |
|
Hard-Coded versus Soft-Coded SQL |
|
|
454 | (1) |
|
When to Use Stored Procedures |
|
|
455 | (2) |
|
Normalizing and Denormalizing |
|
|
457 | (2) |
|
Use Your EJB Object Model to Drive Your Data Model |
|
|
459 | (1) |
|
Follow a Good Data Design Process |
|
|
459 | (1) |
|
|
|
460 | (1) |
|
Understand the Impacts of Database Updates |
|
|
461 | (1) |
|
Versioning EJB Components |
|
|
461 | (2) |
|
Living with a Legacy Database Design |
|
|
463 | (11) |
|
Handling Large Result Sets |
|
|
474 | (1) |
|
|
|
475 | (2) |
|
Chapter 17 EJB Integration |
|
|
477 | (68) |
|
Why Does Integration Matter? |
|
|
477 | (2) |
|
|
|
478 | (1) |
|
|
|
479 | (1) |
|
J2EE Connector Architecture |
|
|
480 | (6) |
|
|
|
480 | (3) |
|
Resource Adapter Interaction with J2EE Components |
|
|
483 | (1) |
|
Resource Adapter Interaction with Application Server |
|
|
484 | (2) |
|
|
|
486 | (8) |
|
The javax.resource Package |
|
|
486 | (1) |
|
The javax.resource.cci Package |
|
|
487 | (3) |
|
The javax.resource.spi Package |
|
|
490 | (2) |
|
The javax.resource.spi.endpoint Package |
|
|
492 | (1) |
|
The javax.resource.spi.security Package |
|
|
493 | (1) |
|
The javax.resource.spi.work Package |
|
|
493 | (1) |
|
|
|
494 | (14) |
|
|
|
494 | (1) |
|
|
|
495 | (3) |
|
|
|
498 | (3) |
|
|
|
501 | (3) |
|
|
|
504 | (2) |
|
|
|
506 | (2) |
|
Connector Example: OutboundLoanRA |
|
|
508 | (33) |
|
|
|
508 | (1) |
|
|
|
509 | (1) |
|
|
|
510 | (1) |
|
|
|
511 | (24) |
|
|
|
535 | (3) |
|
|
|
538 | (1) |
|
|
|
539 | (2) |
|
|
|
541 | (1) |
|
Integration Best Practice: When to Use Which Technology |
|
|
541 | (2) |
|
When to Use JMS and JMS-Based MDB |
|
|
542 | (1) |
|
When to Use J2EE Connectors |
|
|
542 | (1) |
|
When to Use Java Web Services |
|
|
543 | (1) |
|
|
|
543 | (2) |
|
Chapter 18 EJB Performance Optimizations |
|
|
545 | (24) |
|
|
|
545 | (2) |
|
The Stateful Versus Stateless Debate from a Performance Point of View |
|
|
547 | (2) |
|
How to Guarantee a Response Time with Capacity Planning |
|
|
549 | (1) |
|
Use Session Facade for Better Performance |
|
|
550 | (2) |
|
Choosing Between Local Interfaces and Remote Interfaces |
|
|
552 | (1) |
|
Partitioning Your Resources |
|
|
553 | (1) |
|
Tuning Stateless Session Beans |
|
|
554 | (1) |
|
Tuning Stateful Session Beans |
|
|
555 | (1) |
|
|
|
556 | (7) |
|
Tuning Message-Driven Beans |
|
|
563 | (1) |
|
Tuning Java Virtual Machine |
|
|
563 | (2) |
|
Miscellaneous Tuning Tips |
|
|
565 | (2) |
|
Choosing the Right EJB Server |
|
|
567 | (1) |
|
|
|
568 | (1) |
|
|
|
569 | (24) |
|
Overview of Large-Scale Systems |
|
|
569 | (9) |
|
What Is a Large-Scale System? |
|
|
570 | (2) |
|
|
|
572 | (1) |
|
Partitioning Your Clusters |
|
|
573 | (5) |
|
Instrumenting Clustered EJBs |
|
|
578 | (11) |
|
How EJBs Can Be Clustered |
|
|
578 | (1) |
|
The Concept of Idempotence |
|
|
579 | (2) |
|
Stateless Session Bean Clustering |
|
|
581 | (2) |
|
Stateful Session Bean Clustering |
|
|
583 | (1) |
|
|
|
584 | (4) |
|
Message-Driven Bean Clustering |
|
|
588 | (1) |
|
Other EJB Clustering Issues |
|
|
589 | (2) |
|
|
|
589 | (1) |
|
|
|
590 | (1) |
|
|
|
591 | (2) |
|
Chapter 20 Starting Your EJB Project on the Right Foot |
|
|
593 | (16) |
|
Get the Business Requirements Down |
|
|
593 | (1) |
|
Decide Whether J2EE Is the Right Choice |
|
|
594 | (4) |
|
|
|
598 | (2) |
|
Design Your Complete Object Model |
|
|
600 | (1) |
|
Implement a Single Vertical Slice |
|
|
601 | (2) |
|
Choose an Application Server |
|
|
603 | (1) |
|
|
|
604 | (2) |
|
|
|
606 | (1) |
|
Invest in a Standard Build Process |
|
|
607 | (1) |
|
|
|
607 | (1) |
|
|
|
608 | (1) |
|
Chapter 21 Choosing an EJB Server |
|
|
609 | (14) |
|
|
|
610 | (1) |
|
|
|
610 | (1) |
|
|
|
610 | (1) |
|
|
|
611 | (1) |
|
Third-Party JDBC Driver Support |
|
|
611 | (1) |
|
|
|
611 | (1) |
|
|
|
611 | (1) |
|
Pluggable Persistence Providers |
|
|
611 | (1) |
|
|
|
612 | (1) |
|
|
|
612 | (1) |
|
|
|
612 | (1) |
|
|
|
613 | (1) |
|
|
|
613 | (1) |
|
|
|
614 | (1) |
|
|
|
615 | (1) |
|
Intelligent Load Balancing |
|
|
615 | (1) |
|
Stateless Transparent Fail-over |
|
|
615 | (1) |
|
|
|
616 | (1) |
|
Java Management Extension (JMX) |
|
|
616 | (1) |
|
|
|
616 | (1) |
|
|
|
617 | (1) |
|
|
|
617 | (1) |
|
|
|
617 | (1) |
|
|
|
617 | (1) |
|
|
|
618 | (1) |
|
|
|
618 | (1) |
|
Superior Messaging Architecture |
|
|
618 | (1) |
|
|
|
619 | (1) |
|
|
|
619 | (1) |
|
|
|
619 | (1) |
|
|
|
620 | (1) |
|
|
|
620 | (1) |
|
|
|
621 | (1) |
|
|
|
621 | (2) |
|
Chapter 22 EJB-J2EE Integration: Building a Complete Application |
|
|
623 | (30) |
|
|
|
623 | (1) |
|
A Preview of the Final Web Site |
|
|
624 | (6) |
|
Scoping the Technical Requirements |
|
|
630 | (13) |
|
|
|
631 | (6) |
|
|
|
637 | (6) |
|
|
|
643 | (8) |
|
|
|
651 | (2) |
| Appendix A RMI-IIOP and JNDI Tutorial |
|
653 | (30) |
| Appendix B CORBA Interoperability |
|
683 | (22) |
| Appendix C Deployment Descriptor Reference |
|
705 | (34) |
| Appendix D The EJB Query Language (EJB-QL) |
|
739 | (18) |
| Appendix E EJB Quick Reference Guide |
|
757 | (44) |
| Index |
|
801 | |