Enterprise JavaBeans, 4/e (Paperback)
暫譯: 企業 JavaBeans, 第4版 (平裝本)

Richard Monson-Haefel, Bill Burke, Sacha Labourey

買這商品的人也買了...

商品描述

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.

 

Table of Contents:

Preface

Part I. The Technical Manuscript

1. Introduction
     Server-Side Components
     Distributed Object Architectures
     Component Models
     Asynchronous Messaging
     Titan Cruises: An Imaginary Business
     What's Next?

2. Architectural Overview
     The Enterprise Bean Component
     Using Enterprise Beans
     The Bean-Container Contract
     Summary

3. Resource Management and the Primary Services
     Resource Management
     Primary Services
     What's Next?

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
     Locating Beans with JNDI
     The Remote Client API
     The Local Client API

6. CMP: Basic Persistence
     The Abstract Programming Model
     The Customer EJB
     Persistence Fields
     Dependent Value Classes
     Relationship Fields

7. CMP: Entity Relationships
     The Seven Relationship Types

8. CMP: EJB QL
     Declaring EJB QL
     The Query Methods
     EJB QL Examples
     Problems with EJB QL

9. Bean-Managed Persistence
     The Remote Interface
     The Remote Home Interface
     The Primary Key
     The ShipBean
     Obtaining a Resource Connection
     Exception Handling
     The ejbCreate( ) Method
     The ejbLoad( ) and ejbStore( ) Methods
     The ejbRemove( ) Method
     The ejbFind( ) Methods
     The Deployment Descriptor

10. The Entity-Container Contract
     The Primary Key
     The Callback Methods
     ejbHome( )
     EntityContext
     The Life Cycle of an Entity Bean

11. Session Beans
     The Stateless Session Bean
     The Life Cycle of a Stateless Session Bean
     The Stateful Session Bean
     The Life Cycle of a Stateful 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
     Titan's Maintenance Timer
     Timer Service API
     Transactions
     Entity Bean Timers
     Stateless Session Bean Timers
     Message-Driven Bean Timers
     Final Words

14. EJB 2.1: Web Service Standards
     Web Services Overview
     XML Schema and XML Namespaces
     SOAP 1.1
     WSDL 1.1
     UDDI 2.0
     From Standards to Implementation

15. EJB 2.1 and Web Services
     Accessing Web Services with JAX-RPC
     EJB Endpoints

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
     Servlets
     JavaServer Pages
     Web Components and EJB
     Filling in the Gaps
     Fitting the Pieces Together

18. XML Deployment Descriptors
     The ejb-jar File
     The Contents of a Deployment Descriptor
     The Document Header and Schema Declarations
     The Descriptor's Body
     Describing Enterprise Beans
     Describing Relationships
     Describing Bean Assembly

19. EJB Design in the Real World
     Pre-Design: Containers and Databases
     Design
     Should You Use EJBs?
     Wrapping Up

Part II. JBoss Workbook

Introduction

1. JBoss Installation and Configuration
     About JBoss
     Installing JBoss Application Server
     A Quick Look at JBoss Internals
     Exercise Code Setup and Configuration

2. Exercises for Chapter 4
     Exercise 4.1: A Simple Entity Bean
     Exercise 4.2: A Simple Session Bean

3. Exercises for Chapter 5
     Exercise 5.1: The Remote Component Interfaces
     Exercise 5.2: The EJBObject, Handle, and Primary Key
     Exercise 5.3: The Local Component Interfaces

4. Exercises for Chapter 6
     Exercise 6.1: Basic Persistence in CMP 2.0
     Exercise 6.2: Dependent Value Classes in CMP 2.0
     Exercise 6.3: A Simple Relationship in CMP 2.0

5. Exercises for Chapter 7
     Exercise 7.1: Entity Relationships in CMP 2.0, Part 1
     Exercise 7.2: Entity Relationships in CMP 2.0, Part 2
     Exercise 7.3: Cascade Deletes in CMP 2.0

6. Exercises for Chapter 8
     Exercise 8.1: Simple EJB QL Statements
     Exercise 8.2: Complex EJB QL Statements

7. Exercises for Chapter 9
     Exercise 9.1: A BMP Entity Bean

8. Exercises for Chapter 11
     Exercise 11.1: A Stateless Session Bean
     Exercise 11.2: A Stateful Session Bean

9. Exercises for Chapter 12
     Exercise 12.1: JMS as a Resource
     Exercise 12.2: The Message-Driven Bean

10. Exercises for Chapter 13
     Exercise 13.1: EJB Timer Service

11. Exercises for Chapter 15
     Exercise 15.1: Web Services and EJB 2.1

Appendix. Database Configuration

Index

商品描述(中文翻譯)

**描述:**

Enterprise JavaBeans (EJB) 規範的新 2.1 版本擴展了對網路服務和 Java 網路服務 API 的支援,擴大了其非同步消息支援,新增了用於部署描述符的 XML Schema,並引入了一個新的計時器服務,允許排程 EJB 任務。這本關於 EJB 的基本且獲獎的書籍《Enterprise JavaBeans》在這個全新的第四版中已完全修訂和更新,以提供開發者掌握 EJB 2.1 所需的真實世界細節。

之前版本的這本清晰且引人入勝的 EJB 介紹書籍曾被《Java Developer's Journal》的編輯和讀者評選為「最佳 Java 書籍」,被《JavaPro》編輯評選為「專家最佳 Java 書籍」,並被 Amazon.com 評選為頂尖計算機書籍之一。第四版不僅達到了前幾版的卓越聲譽,甚至超越了它們。

這本權威且全面的指南包含了使前幾版成為 EJB 開發者必備書籍的所有內容:作者對 EJB 複雜性的深刻理解,加上他簡潔易懂的風格;數百個清晰、實用的範例;對 EJB 關鍵概念的熟練涵蓋;以及用於說明所呈現概念的圖表。它還包括了讓你迅速了解 EJB 2.1 版本所帶來變化所需的一切,包括架構概述、資源管理和主要服務的信息、設計策略以及 XML 部署描述符。

在這一版中,我們新增了一本針對 JBoss 4.0 的 EJB 工作手冊。該工作手冊展示了如何在 JBoss 4.0 應用伺服器上部署所有範例。它解決了 EJB 的一個重要問題:在伺服器上部署軟體可能非常困難。JBoss 是一個開源專案,已成為最廣泛使用的 J2EE 應用伺服器。

優秀的技術作者可能會將事實呈現在你面前,但偉大的作者則提供了他們自身經驗和洞察的精華。Richard Monson-Haefel 提供了 Java 開發者所需了解的內容,以駕馭 EJB 的複雜性。Monson-Haefel 成為技術寫作大師的原因可以從他深思熟慮且邏輯清晰的思路進展,以及他提供的實用、精確、可用的範例中看出,這些範例足夠大以測試關鍵概念,但仍然足夠小以便於理解,並能詳細解釋你在其他情況下應用這些原則所需的細節。

如果你正在使用 EJB 或想要使用這本書,它將在你的書架上佔據一個受歡迎的位置。

**目錄:**

前言

第一部分 技術手稿

1. 介紹
- 伺服器端組件
- 分散式物件架構
- 組件模型
- 非同步消息
- Titan Cruises:一個虛構的商業
- 接下來是什麼?

2. 架構概述
- 企業 Bean 組件
- 使用企業 Bean
- Bean-Container 合約
- 總結

3. 資源管理與主要服務
- 資源管理
- 主要服務
- 接下來是什麼?

4. 開發你的第一個企業 Bean
- 選擇和設置 EJB 伺服器
- 開發實體 Bean
- 開發會話 Bean

5. 遠端和本地客戶端視圖
- 使用 JNDI 定位 Beans
- 遠端客戶端 API
- 本地客戶端 API

6. CMP:基本持久性
- 抽象編程模型
- 客戶 EJB
- 持久性欄位
- 依賴值類別
- 關係欄位

7. CMP:實體關係
- 七種關係類型

8. CMP:EJB QL
- 聲明 EJB QL
- 查詢方法
- EJB QL 範例
- EJB QL 的問題

9. Bean 管理的持久性
- 遠端介面
- 遠端家介面
- 主鍵
- ShipBean
- 獲取資源連接
- 異常處理
- ejbCreate( ) 方法
- ejbLoad( ) 和 ejbStore( ) 方法
- ejbRemove( ) 方法
- ejbFind( ) 方法
- 部署描述符

10. 實體-容器合約
- 主鍵
- 回調方法
- ejbHome( )
- EntityContext
- 實體 Bean 的生命週期

11. 會話 Beans
- 無狀態會話 Bean
- 無狀態會話 Bean 的生命週期
- 有狀態會話 Bean
- 有狀態會話 Bean 的生命週期

12. 消息驅動 Beans
- JMS 和消息驅動 Beans
- 基於 JMS 的消息驅動 Beans
- 消息驅動 Bean 的生命週期
- 基於連接器的消息驅動 Beans
- EJB 2.1:消息鏈接

13. 計時器服務
- Titan 的維護計時器
- 計時器服務 API
- 交易
- 實體 Bean 計時器
- 無狀態會話 Bean 計時器
- 消息驅動 Bean 計時器
- 最後的話

14. EJB 2.1:網路服務標準
- 網路服務概述
- XML Schema 和 XML 名稱空間
- SOAP 1.1
- WSDL 1.1
- UDDI 2.0
- 從標準到實作

15. EJB 2.1 和網路服務
- 使用 JAX-RPC 訪問網路服務
- EJB 端點

16. 交易
- ACID 交易
- 聲明式交易管理
- 隔離和資料庫鎖定
- 非交易 Beans
- 明確的交易管理
- 異常和交易
- 交易有狀態會話 Beans

17. J2EE
- Servlets
- JavaServer Pages
- 網頁組件和 EJB
- 填補空白
- 將各部分組合在一起

18. XML 部署描述符
- ejb-jar 檔案
- 部署描述符的內容
- 文件標頭和 Schema 聲明
- 描述符的主體
- 描述企業 Beans
- 描述關係
- 描述 Bean 組合

19. 現實世界中的 EJB 設計
- 預設計:容器和資料庫
- 設計
- 你應該使用 EJB 嗎?
- 總結

第二部分 JBoss 工作手冊

介紹

1. JBoss 安裝與配置
- 關於 JBoss
- 安裝 JBoss 應用伺服器
- JBoss 內部結構簡介
- 練習代碼設置與配置

2. 第 4 章的練習
- 練習 4.1:一個簡單的實體 Bean
- 練習 4.2:一個簡單的會話 Bean

3. 第 5 章的練習
- 練習 5.1:遠端組件介面
- 練習 5.2:EJBObject、Handle 和主鍵
- 練習 5.3:本地組件介面

4. 第 6 章的練習
- 練習 6.1:CMP 2.0 中的基本持久性
- 練習 6.2:CMP 2.0 中的依賴值類別
- 練習 6.3:CMP 2.0 中的一個簡單關係

5. 第 7 章的練習
- 練習 7.1:CMP 2.0 中的實體關係,第 1 部分
- 練習 7.2:CMP 2.0 中的實體關係,第 2 部分
- 練習 7.3:CMP 2.0 中的級聯刪除

6. 第 8 章的練習
- 練習 8.1:簡單的 EJB QL 語句
- 練習 8.2:複雜的 EJB QL 語句

7. 第 9 章的練習
- 練習 9.1:一個 BMP 實體 Bean

8. 第 11 章的練習
- 練習 11.1:一個無狀態會話 Bean
- 練習 11.2:一個有狀態會話 Bean

9. 第 12 章的練習
- 練習 12.1:JMS 作為資源
- 練習 12.2:消息驅動 Bean

10. 第 13 章的練習
- 練習 13.1:EJB 計時器服務

11. 第 15 章的練習
- 練習 15.1:網路服務和 EJB 2.1

附錄 資料庫配置

索引