ebook img

Enterprise JavaBeans 2.1 PDF

474 Pages·2003·10.714 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Enterprise JavaBeans 2.1

Enterprise JavaBeans 2.1 STEFAN DENNINGER and INGO PETERS with ROB CASTANEDA translated by David Kramer APress Media, LLC Enterprise JavaBeans 2.1 Copyright ©2003 by Stefan Denninger and Ingo Peters with Rob Castaneda Originally published by Apress in 2003 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 978-1-59059-088-1 ISBN 978-1-4302-0771-9 (eBook) DOI 10.1007/978-1-4302-0771-9 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. Translator, Editor, Compositor: David Kramer Technical Reviewer: Mary Schladenhauffen Editorial Directors: Dan Appleman, Gary Cornell, Simon Hayes, Martin Streicher, Karen Watterson, John Zukowski Managing and Production Editor: Grace Wong Proofreader: Lori Bring Cover Designer: Kurt Krames Manufacturing Manager: Tom Debolski The information in this book is distributed on an "as is" basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author 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. Contents at a Glance About the Authors Ix Acknowledgments x Preface xl 1 Introduction 1 2 Fundamentals 7 3 The Architecture of Enterprise JavaBeans 21 4 Session Beans 63 5 Entity Beans 111 6 Message-Driven Beans 231 7 Transactions 277 8 Security 323 9 Practical Appllcations 339 10 Web Services and Scbedullng 431 References 457 Index 459 Contents About the Authors Ix Acknowledgments x Preface xi 1 Introduction 1 A Hypothetical Scenario . 1 First the Bad News . 1 TheTask ........ . 1 The Solution . . . . . . . 2 Multiple-User Capability 3 Scalability . . . . . . . . 3 Availability. . . . . . . . 3 Connection with the Outside World 4 Integration with Other Applications and Rapid Extensibility. . 4 Short Development Cycles ...... . 4 Configurability ............ . 5 Stepwise Migration and Data Storage . . 5 Summary .. 5 So Now What? . 6 2 Fundamentals 7 Enterprise . 7 Java . 11 Beans ... 13 3 The Architecture ofEnterpr1se JavaBeans 21 TheServer ....... . 22 The EJB Container . . . . 23 The Persistence Manager 30 Enterprise Beans .... 31 How Everything Works Together 44 The Client's Viewpoint ........ . 47 What an Enterprise Bean May Not Do . 50 EJB Assignment of Roles. 51 Points of View . . . . . . . . . . . . . . 56 Contents 4 Session Beans 63 Introduction . 63 Concepts ... 64 Programming 75 · . Examples 97 5 Entity Beans 111 .............. Introduction . 111 Concepts ................. 113 Container Managed Persistence 2.0/2.1 129 Relations Among Entity Beans (EJB 2.0/2.1) 150 EJB-QL (EIB 2.0/2.1) ............. 174 Example: Warehouse Management (EJB 2.0) 189 Container-Managed Persistence 1.1 203 · .... Bean-Managed Persistence . 210 · ...... . ..... Summary 228 6 Message-Driven Beans 231 Java Message Service UMS) 233 Concepts ... 260 Programming 263 An Example 268 Summary · . · ....... 273 7 Transactions 277 .......... Fundamentals . 277 Concepts .............. 280 Implicit Transaction Management 286 Explicit Transaction Management 305 Transactions in the Deployment Descriptor 319 8 Security 323 ..... Introduction . 323 .. . .... Programming 326 9 Practical Applications 339 ............ · .... Performance . . . . . . 339 Processes, Enterprise Objects, and Services 349 Aggregation of Enterprise Beans 355 ............ Inheritance 370 Enterprise JavaBeans and Events . 374 Internet Connection. . . . . . . . 385 Entity Beans and Details Objects 389 Quality Assurance . . . . . . . . . . . . . . . . . . . . . . . . . . . 406 vi Contents 10 Web Services and Schedullng 431 Introduction . . . . . . . . . . . . 431 Web Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 The Standardized World ofJ2EE .................... . 431 Solving the Integration Problem ............... . 435 Web Services ............................... . 437 Timers .... 446 Summary 455 References 457 Index 459 vii About the Authors Stefan Denninger Stefan Denninger completed his university education in February 1996 with a degree in business management. He has worked as a software engineer for Kromberg & Schubert in Abensberg, Germany, IXOS Software in Munich, Germany, and eCircle Solutions in Munich. He currently works for ConSol GmbH in Munich as a senior software consultant. Ingo Peters Ingo Peters currently works with the HypoVereinsbank, a group of European banks managing Internet portals and applications. As a project manager, he has guided many different applications and Internet portals using Enterprise JavaBeans to success. He started programming with Enterprise JavaBeans in 1998. Rob Castaneda Rob Castaneda is Principal Architect at CustomWare Asia Pacific, where he provides architecture consulting and training in EJB/J2EE/XML-based applications and integration servers to clients throughout Asia and America. Rob's multinational background, combined with his strong real-world business experience, enables him to see through the specifications to create realistic solutions to major business problems. He has also contributed to and technically edited various leading EJB and J2EE books. Acknowledgments Working on this book has been a great pleasure for all of the authors. Long discussions about local interfaces and dependent objects have resulted in several chapters being rewritten and then rewritten again, and changes in the specification have led to many interesting discussions and insights. Without the active support of colleagues and friends, work on this book would not have been nearly so interesting, nor so productive. Stefan Denninger and Ingo Peters would like particularly to thank Stefan Schulze and Alexander Greisle, whose constructive and highly competent feedback have significantly improved the quality of this book. They would also like to thank the readers of the first German edition, whose support and feedback made the second edition possible. Finally, they wish to thank their editor, Martin Asbach, of Ad dison-Wesley, for his great care and friendly collaboration in bringing this book into the world, to the staff of Apress for making the English translation possible, and for their amiable and uncomplicated collaboration. Rob Castaneda would like to thank John Zukowski, Grace Wong, and the team at Apress, as well as colleagues at CustomWare Asia Pacific, including Ian Daniel, Nathan Lee, and Scott Babbage, as well as his wife, Aimee Castaneda. Without the support of the these individuals, this work would not have been achievable. Preface ENTERPRISE IAVABEANS (BIB) IS THE standard component architecture for the creation of distributed business applications in the programming language Java. EJB offers all mechanisms necessary for the creation of applications for enterprise-wide deployment and for the control of critical business processes. Application developers can profit from distribution of processes, transaction security, pooling of network connections, synchronous and asynchronous notification, multithreading, object persistence, and platform independence. With EJB, programming remains relatively simple. In March 1998 the first specification of Enterprise JavaBeans was published by Sun Microsystems. In relatively short order there followed in December 1999 the consolidated version 1.1. In the meantime, the component architecture has accounted for considerable change in the market for application servers, so that today, the large majority of application servers support EJB. EJB has also established itself in the growing market for finished application components. Today, there exists a large market for everything from specialized solutions to specific problems to complete application frameworks. In August 2001 version 2.0 was released. The new version offers considerable extensions and improvements, which are considered in this book, now in its second edition. The first edition has been greatly revised in order to take account of the following developments: • The new message-driven beans (EJB 2.0) offer completely new ways to achieve asynchronous communication and parallel processing of business logic. This is made possible by the integration of the Java Message Service (JMS) into tht EJB architecture. • Local interfaces (EJB 2.0) enable optimization of process-internal communication among Enterprise Beans and between local clients and Enterprise Beans. • The persistence manager has been introduced (EJB 2.0). With relationships between entity beans it is now possible to model complex data structures. The associated query language EJB QL makes it possible to work efficiently with these structures. • A new chapter (Chapter 8) deals with security issues of EJB. • The chapter on practical applications (Chapter 9) has been greatly expanded. • All the examples have been reworked, with emphasis on ease of execution.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.