Mastering Enterprise JavaBeans

by Roman, Ed; Sriganesh, Rima Patel; Brose, Gerald
Edition: 3rd
Format: Paperback
Pub. Date: 2004-12-08
Publisher(s): Wiley
  • Free Shipping Icon

    This Item Qualifies for Free Shipping!*

    *Excludes marketplace orders.

List Price: $47.25

Rent Book

Select for Price
There was a problem. Please try again later.

New Book

We're Sorry
Sold Out

Used Book

We're Sorry
Sold Out

eBook

We're Sorry
Not Available

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

Includes more than 30 percent revised material and five new chapters, covering the new 2.1 features such as EJB Timer Service and JMS as well as the latest open source Java solutions The book was developed as part of TheServerSide.com online EJB community, ensuring a built-in audience Demonstrates how to build an EJB system, program with EJB, adopt best practices, and harness advanced EJB concepts and techniques, including transactions, persistence, clustering, integration, and performance optimization Offers practical guidance on when not to use EJB and how to use simpler, less costly open source technologies in place of or in conjunction with EJB

Author Biography

Ed Roman is an independent consultant, a leading authority on EJB, and the author of the first two bestselling editions of Mastering Enterprise JavaBeans (Wiley).

Rima Patel Sriganesh is a member of Technical Staff in the Technology Outreach group at Sun Microsystems, Inc., and is a coauthor of Developing Java Web Services (Wiley).

Gerald Brose is a Security Software Architect at Xtradyne Technologies. He is an expert in EJB and CORBA and the author of Java Programming with CORBA, Third Edition (Wiley).

Table of Contents

Acknowledgments xvi
Introduction xvii
Part One Overview 1(76)
Chapter 1 Overview
3(24)
The Motivation for Enterprise JavaBeans
4(3)
Component Architectures
7(2)
Service-Oriented Architectures
8(1)
Divide and Conquer to the Extreme with Reusable Services
9(2)
Introducing Enterprise JavaBeans
11(4)
Why Java?
12(1)
EJB as a Business Tier Component
13(2)
The EJB Ecosystem
15(6)
The Bean Provider
16(1)
The Application Assembler
16(1)
The EJB Deployer
17(1)
The System Administrator
17(1)
The Container and Server Provider
18(1)
The Tool Vendors
18(1)
Summary of Roles
19(2)
The Java 2 Platform, Enterprise Edition (J2EE)
21(5)
The J2EE Technologies
22(4)
Summary
26(1)
Chapter 2 EJB Fundamentals
27(26)
Enterprise Beans
27(3)
Types of Beans
28(2)
Distributed Objects: The Foundation for EJB
30(2)
Distributed Objects and Middleware
32(4)
Explicit Middleware
33(1)
Implicit Middleware
34(2)
What Constitutes an Enterprise Bean?
36(16)
The Enterprise Bean Class
36(1)
The EJB Object
37(5)
The Home Object
42(2)
The Local Interfaces
44(4)
Deployment Descriptors
48(1)
Vendor-Specific Files
49(1)
Ejb-jar File
49(1)
Summary of Terms
50(2)
Summary
52(1)
Chapter 3 Writing Your First Bean
53(24)
How to Develop an EJB Component
54(1)
The Remote Interface
55(1)
The Local Interface
56(1)
The Home Interface
57(2)
The Local Home Interface
59(2)
The Bean Class
61(3)
The Deployment Descriptor
64(1)
The Vendor-Specific Files
65(1)
The Ejb-jar File
65(1)
Deploying the Bean
66(1)
The Optional EJB Client JAR File
67(1)
Understanding How to Call Beans
68(4)
Looking up a Home Object
68(4)
Running the System
72(1)
The Server-Side Output
73(1)
The Client-Side Output
73(1)
Implementing Component Interfaces
73(2)
A Solution
74(1)
Summary
75(2)
Part Two The Triad of Beans 77(190)
Chapter 4 Introduction to Session Beans
79(24)
Session Bean Lifetime
79(1)
Session Bean Subtypes
80(3)
Stateful Session Beans
80(1)
Stateless Session Beans
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)
Summary
102(1)
Chapter 5 Writing Session Bean Web Services
103(16)
Web Services Concepts
103(7)
Web Services Standards
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)
Summary
117(2)
Chapter 6 Introduction to Entity Beans
119(22)
Persistence Concepts
119(3)
Object-Relational Mapping
120(2)
What Is an Entity Bean?
122(3)
About the Files That Make Up an Entity Bean
124(1)
Features of Entity Beans
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)
Entity Contexts
137(1)
getEJBLocalObject()/getEJBObject()
138(1)
getPrimaryKey()
138(1)
Summary
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)
Account.java
151(1)
AccountLocal.java
152(1)
AccountHome.java
153(2)
AccountLocalHome.java
155(1)
AccountPK.java
156(2)
AccountBean.java
158(12)
AccountException.java
170(1)
Client.java
171(2)
The Deployment Descriptor
173(2)
The Container-Specific Deployment Descriptor
175(1)
Setting up the Database
175(1)
Running the Client Program
175(2)
Server-Side Output
175(2)
Client-Side Output
177(1)
Putting It All Together: Walking through a BMP Entity Bean's Life Cycle
177(3)
Summary
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)
Product.java
197(1)
ProductLocal.java
198(1)
ProductHome.java
198(2)
ProductLocalHome.java
200(1)
ProductPK.java
201(2)
ProductBean.java
203(4)
The Deployment Descriptor
207(3)
The Container-Specific Deployment Descriptor
210(2)
Client.java
212(2)
Running the Client Program
214(1)
The Life Cycle of a CMP Entity Bean
214(2)
Summary
216(1)
Chapter 9 Introduction to Message-Driven Beans
217(38)
Motivation to Use Message-Driven Beans
217(2)
The Java Message Service
219(7)
Messaging Domains
220(2)
The JMS API
222(4)
Integrating JMS with EJB
226(5)
What Is a Message-Driven Bean?
227(4)
Developing Message-Driven Beans
231(10)
The Semantics
231(3)
A Simple Example
234(7)
Advanced Concepts
241(3)
JMS Message-Driven Bean Gotchas
244(10)
Message Ordering
245(1)
Missed ejbRemove() Calls
245(1)
Poison Messages
246(3)
How to Return Results Back to Message Producers
249(5)
The Future: Asynchronous Method Invocations
254(1)
Summary
254(1)
Chapter 10 Adding Functionality to Your Beans
255(12)
Calling Beans from Other Beans
255(4)
Default JNDI Lookups
256(1)
Understanding EJB References
257(2)
Resource Factories
259(3)
Environment Properties
262(1)
Understanding Handles
263(2)
Home Handles
264(1)
Summary
265(2)
Part Three Advanced Enterprise JavaBeans Concepts 267(386)
Chapter 11 EJB Best Practices
269(30)
When to Use EJB
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)
Testing EJB
279(3)
EJB Unit Testing
279(1)
Use Frameworks for EJB Unit Testing
280(2)
Implementing Client-Side Callback Functionality in EJB
282(2)
JMS
282(1)
Remote Method Invocation
283(1)
Web Service
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)
Debugging EJB
290(1)
Inheritance and Code Reuse in EJB
291(2)
Writing Singletons in EJB
293(1)
When to Use XML with EJB
293(1)
When to Use Messaging Versus RMI-IIOP
294(3)
Summary
297(2)
Chapter 12 Transactions
299(50)
Motivation for Transactions
300(3)
Atomic Operations
300(1)
Network or Machine Failure
301(1)
Multiple Users Sharing Data
302(1)
Benefits of Transactions
303(3)
The ACID Properties
304(2)
Transactional Models
306(4)
Flat Transactions
306(2)
Nested Transactions
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)
The Java Transaction API
325(3)
Declarative versus Programmatic Transactions Example
328(2)
Transactions from Client Code
330(1)
Transactional Isolation
331(9)
The Need for Concurrency Control
332(2)
The Dirty Read Problem
334(2)
The Unrepeatable Read Problem
336(1)
The Phantom Problem
336(1)
Transaction Isolation Summary
337(1)
Isolation and EJB
338(1)
Pessimistic and Optimistic Concurrency Control
339(1)
Distributed Transactions
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)
Summary
348(1)
Chapter 13 Security
349(42)
Introduction
350(3)
Violations, Vulnerabilities, and Risk
351(1)
Controls
351(2)
Web Application Security
353(4)
Authentication in Web Applications
354(1)
Authorization
355(1)
Confidentiality and Integrity
356(1)
Understanding EJB Security
357(21)
Authentication in EJB
357(11)
Authorization in EJB
368(9)
Security Propagation
377(1)
Secure Interoperability
378(3)
IIOP/SSL
379(1)
CSIv2
379(2)
Web Services Security
381(8)
End-to-End Security
382(1)
XML Digital Signature and XML Encryption
383(3)
SAML
386(1)
WS-Security
387(2)
Summary
389(2)
Chapter 14 EJB Timers
391(18)
Scheduling
391(1)
EJB and Scheduling
392(2)
The EJB Timer Service
394(5)
Timer Service API
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)
Running the Client
405(1)
Strengths and Limitations of EJB Timer Service
406(2)
Summary
408(1)
Chapter 15 BMP and CMP Relationships
409(36)
The CMP and BMP Difference
410(1)
Cardinality
411(17)
1:1 Relationships
412(4)
1:N Relationships
416(5)
M:N Relationships
421(7)
Directionality
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)
Lazy Loading
433(1)
Aggregation Versus Composition and Cascading Deletes
434(2)
Relationships and EJB-QL
436(1)
Recursive Relationships
437(1)
Circular Relationships
438(1)
Referential Integrity
439(5)
Relationships, Referential Integrity, and Client Code
441(3)
Summary
444(1)
Chapter 16 Persistence Best Practices
445(32)
Comparing Entity Beans with Other Persistence Approaches
446(4)
Control
446(1)
Data retrieval
446(1)
Procedural versus Object-Oriented
447(1)
Caching
448(1)
Enforcement of Schema Independence
448(1)
Migration
449(1)
Rapid Application Development
449(1)
Choosing Between CMP and BMP
450(3)
Code Reduction and Rapid Application Development
450(1)
Performance
450(1)
Bugs
451(1)
Control
451(1)
Application Server and Database Independence
451(1)
Relationships
452(1)
Learning Curve and Cost
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)
Use Surrogate Keys
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)
Summary
475(2)
Chapter 17 EJB Integration
477(68)
Why Does Integration Matter?
477(2)
Integration Styles
478(1)
EJB and Integration
479(1)
J2EE Connector Architecture
480(6)
Why J2EE Connectors?
480(3)
Resource Adapter Interaction with J2EE Components
483(1)
Resource Adapter Interaction with Application Server
484(2)
The J2EE Connector API
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)
System Contracts
494(14)
Lifecycle Management
494(1)
Connection Management
495(3)
Security Management
498(3)
Transaction Management
501(3)
Work Management
504(2)
Message In-flow
506(2)
Connector Example: OutboundLoanRA
508(33)
Example Architecture
508(1)
JavaLoanApp.java
509(1)
LoanApp.dll
510(1)
OutboundLoanRA
511(24)
LoanRatesEJB
535(3)
LoanRatesClient
538(1)
Running the Client
539(2)
Extending OutboundLoanRA
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)
Summary
543(2)
Chapter 18 EJB Performance Optimizations
545(24)
It Pays to Be Proactive!
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)
Tuning Entity Beans
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)
Summary
568(1)
Chapter 19 Clustering
569(24)
Overview of Large-Scale Systems
569(9)
What Is a Large-Scale System?
570(2)
Basic Terminology
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)
Entity Bean Clustering
584(4)
Message-Driven Bean Clustering
588(1)
Other EJB Clustering Issues
589(2)
First Contact
589(1)
Initial Access Logic
590(1)
Summary
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)
Staff Your Project
598(2)
Design Your Complete Object Model
600(1)
Implement a Single Vertical Slice
601(2)
Choose an Application Server
603(1)
Divide Your Team
604(2)
Invest in Tools
606(1)
Invest in a Standard Build Process
607(1)
Next Steps
607(1)
Summary
608(1)
Chapter 21 Choosing an EJB Server
609(14)
J2EE Standard Compliance
610(1)
Pluggable JRE
610(1)
Conversion Tools
610(1)
Complex Mappings
611(1)
Third-Party JDBC Driver Support
611(1)
Lazy Loading
611(1)
Deferred Database Writes
611(1)
Pluggable Persistence Providers
611(1)
In-Memory Data Cache
612(1)
Integrated Tier Support
612(1)
Scalability
612(1)
High Availability
613(1)
Security
613(1)
IDE Integration
614(1)
UML Editor Integration
615(1)
Intelligent Load Balancing
615(1)
Stateless Transparent Fail-over
615(1)
Clustering
616(1)
Java Management Extension (JMX)
616(1)
Administrative Support
616(1)
Hot Deployment
617(1)
Instance Pooling
617(1)
Automatic EJB Generation
617(1)
Clean Shutdown
617(1)
Real-Time Deployment
618(1)
Distributed Transactions
618(1)
Superior Messaging Architecture
618(1)
Provided EJB Components
619(1)
Web Services
619(1)
Workflow
619(1)
Open Source
620(1)
Specialized Services
620(1)
Nontechnical Criteria
621(1)
Summary
621(2)
Chapter 22 EJB-J2EE Integration: Building a Complete Application
623(30)
The Business Problem
623(1)
A Preview of the Final Web Site
624(6)
Scoping the Technical Requirements
630(13)
The Business Logic Tier
631(6)
The Presentation Tier
637(6)
Example Code
643(8)
Summary
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

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.