Beginning EJB3

所需积分/C币:9 2012-09-24 21:51:54 6.97MB PDF
收藏 收藏

EJB3的三本好书第一本,从glassfish的角度全面介绍EJB3 3本书分别是: 1. Beginning EJB3 Application Development From Novice to Professional联接 2. EJB3 in Action 2007联接 3. Mastering EJB3联接
6714FMcmp3qxd 8/31/06 7:06 PM Page ii Beginning EJBTM 3 Application Development: From Novice to Professional Copyright o 2006 by Raghu R Kodali and Jonathan Wetherbee with Peter Zadrozny All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher ISBN-13(pbk):978-1-59059-671-5 ISBN-10(pbk):1-59059-671-4 Printed and bound in the united states of america 987654321 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner,with no intention of infringement of the trademark JavaTM and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc, in the US and other countries. Apress, Inc is not affiliated with Sun Microsystems, Inc, and this book was writ ten without endorsement from Sun Microsystems, Inc Lead Editor: Steve Anglin Technical reviewer: Tom marrs Editorial Board: Steve Anglin, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Gennick Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Dominic Shakeshaft, Jim Sumser Senior Project Manager: Sofia Marchant Copy Edit Manager: Nicole LeClerc Copy Editor: Damon Larson Assistant Production Director: Kari Brooks-Copony Production Editor: Kelly Winquist Compositors: Dina Quan, Gina Rexrode Proofreader: Linda marousek Indexer: Julie grady Artist: April Milne Cover Designer: Kurt Krames Manufacturing Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, InC., 233 Spring Street, 6th Floor, NewYork,Ny10013.Phone1-800-springer,fax201-348-4505,,or visit For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, Ca94710.Phone510-549-5930,fax510-549-5939,,orvisit The information in this book is distributed on an"as is"basis, without warranty. Although every precau tion has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work Thesourcecodeforthisbookisavailabletoreadersathttp://www.apress.cominthesOurceCode/ Download section. You will need to answer questions pertaining to this book in order to successfully download the code 6714FMcmp3qxd 8/31/06 7:06 PM Page iii To my wife, Lakshmi, for her support and patience, and our two-year-old son, Yash, who is a big source of inspiration -Raghu r kodali To my wife, Laurel, and our young bear cubs, Nicholas, Patrick, and Jacob nathan wetherbee 6714FMcmp3qxd 8/31/06 7:06 PM Page iv 6714FMcmp3qxd 8/31/06 7:06 PM Page v Contents at a glance Foreword XIX About the authors ,,,,,,XX About the technical reviewer XXV Acknowledgments ::: XXVI CHAPTER 1 ntroduction to the ejb 3 architecture chaPter 2 ejb 3 Session beans CHAPTER 3 Entities and the java persistence apl .57 CHAPTER 4 Advanced persistence features CHAPTER 5 EJB 3 Message-Driven Beans 149 chaPteR 6 ejb 3 and web services 177 CHAPTER 7 Integrating Session Beans, Entities Message-Driven beans, and web Services 205 CHAPTER 8 Transaction Support in EJB 3 257 chaPteR 9 EJB 3 Performance and Testing CHAPter 10 Migrating EJB 2.X Applications to EJB 3 321 CHAPTER 11 EJB 3 Deployment 361 CHAPTER 12 EJB 3 Client Applications 385 APPENDIX Performance: eJb 2 VS ejb 3 .....445 INDEX .....465 6714FMcmp3qxd 8/31/06 7:06 PM Page vi 6714FMcmp3qxd 8/31/06 7:06 PM Page vii Contents Foreword XIX About the authors ,,,,,,XX about the technical reviewer XXV Acknowledgments :.:: XXVI CHAPTER 1 ntroduction to the ejb 3 architecture An Introduction to ejb What is ejb? The EjB Component Model 2233 The ejb framework Core Features of ejB Progression of the EjB Spec EJB 3 Simplified Development Model .6 Distributed Computing Model How This book Is organized 10 Chapter 1: Introduction to the EjB 3 Architecture Chapter 2: EJB 3 Session Beans Chapter 3: Entities and the Java Persistence APl Chapter 4: Advanced Persistence Features Chapter 5: eJb 3 Message-Driven Beans Chapter 6 EJB 3 and Web Services.............12 Chapter 7: Integrating Session Beans, Entities, Message-Driven Beans, and Web services 12 Chapter 8: Transaction Support in EJB 3 12 Chapter 9: Ejb 3 Performance and Testing ..12 Chapter 10: Migrating EJB 2. X Applications to eJB 3 12 Chapter 11: EJb 3 Deployment 12 Chapter 12: EJB 3 Client Applications 13 6714FMcmp3 qxd 8/31/06 7:06 PM Page viii CONTENTS Getting started 13 Prerequisites for Installing the glass Fish application Server 14 Installing the GlassFish Application Server...........15 Environment Variables Setup 17 Starting and Testing the GlassFish Installation 20 Conclusion 25 chaPTer 2 EJb 3 Session beans 27 Introduction 27 Introduction to session beans Types of Session Beans When do you use session beans? 28 Stateless Session beans 31 The bean class 31 The Business Interface 32 Business methods 35 Dependency Injection 36 Callback methods 37 Interceptors 38 Stateful session beans 40 The bean class 40 The Business Interface Business methods 43 Callback methods Interceptors 46 Exception Handling Client view for session beans 46 Packaging, Deploying, and Testing the Session Beans Prerequisites Compiling the Session Beans Packaging the Session Beans Deploying the Session Beans Compiling the client programs 54 Running the client Programs 54 Conclusion ..56 6714FMcmp 3 qxd 8/31/06 7:06 PM Page ix CONTENTS ChAPTER 3 Entities and the java persistence apl 57 An Entity Example 59 A Simple JavaBean: Customer. java A Simple Entity: Customer. java An Entity with Defaults Exposed: Customer. java Coding Requirements 64 Example: Annotating Instance Variables EXample: Annotating Property Accessors 67 Declaring the Primary Key 68 Simple primary Key Composite Primary Key 70 Summary of Entity EXamples 73 The persistence archive The persistence. xml File..................73 The entity Manager 74 Persistence Context Acquiring an EntityManager Instance Transaction Support The Entity Life cycle 77 The life cycle of a New entity Instance O/R Mapping ..79 The @Table Annotation (Revisited) 80 The @ Column Annotation(Revisited Complex mappings 82 Entity relationships 82 @One ToOne 82 @One ToMany and @Many Toone @Many ToMany Lazy vs Eager Field bindings Cascading Operations

试读 127P Beginning EJB3
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    Beginning EJB3 9积分/C币 立即下载
    Beginning EJB3第1页
    Beginning EJB3第2页
    Beginning EJB3第3页
    Beginning EJB3第4页
    Beginning EJB3第5页
    Beginning EJB3第6页
    Beginning EJB3第7页
    Beginning EJB3第8页
    Beginning EJB3第9页
    Beginning EJB3第10页
    Beginning EJB3第11页
    Beginning EJB3第12页
    Beginning EJB3第13页
    Beginning EJB3第14页
    Beginning EJB3第15页
    Beginning EJB3第16页
    Beginning EJB3第17页
    Beginning EJB3第18页
    Beginning EJB3第19页
    Beginning EJB3第20页

    试读结束, 可继续阅读

    9积分/C币 立即下载 >