Applying Enterprise JavaBeans, 2/e

Vlada Matena, Sanjeev Krishnan, Linda DeMichiel, Beth Stearns

  • 出版商: Addison Wesley
  • 出版日期: 2003-05-27
  • 售價: $1,810
  • 貴賓價: 9.5$1,720
  • 語言: 英文
  • 頁數: 496
  • 裝訂: Paperback
  • ISBN: 0201914662
  • ISBN-13: 9780201914665
  • 相關分類: Java 程式語言
  • 已絕版

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

商品描述

 

Written by the architects of the Enterprise JavaBean (EJB) specification, Applying Enterprise JavaBeans™, Second Edition is an advanced programming guide and reference source which has been updated and expanded to reflect updates in the EJB 2.1 specification. This book is an invaluable resource for IT personnel building in-house applications and for the independent software vendors (ISVs) building applications for sale to enterprise.

The authors use example applications to clearly illustrate many of the typical problems encountered in enterprise application development, and to help developers learn to use the newest features of the EJB. Applying Enterprise JavaBeans™, Second Edition also explores the use of EJB architecture in the construction and accessing of Web services, thus integrating applications across enterprises with interoperable, standards-based protocols and service description formats.

In-depth coverage includes such EJB topics as:

  • Support for Web services and security management
  • Message-driven beans and integration with Java Messaging Service (JMS)
  • Session beans--including a discussion of the differences between stateful and stateless session beans
  • Entity beans--including life cycle, persistence management, and container management
  • Transaction management
  • EJB Query Language

    Applying Enterprise JavaBeans™, Second Edition discusses when and how each EJB feature should be used in applications and concludes with a comprehensive API reference for developers. This book is an essential addition to every Java programmer's bookshelf.

  • Table of Contents

    Foreword.
    Preface.

    Conventions Used in This Book.
    Graphics.
    Note about the Example Applications.
    Contents of the Book.
    Acknowledgments.


    1. Advantages of the Enterprise JavaBeans(tm) Architecture.

    From a Two-Tier to a J2EE Architecture.
    Two-Tier Application Architecture.
    Traditional Three-Tier Application Architecture.
    Early Web-Based Application Architecture.
    J2EE Application Architecture.

    Advantages of the Enterprise JavaBeans Architecture.
    Benefits to the Application Developer.
    Benefits to Customers.

    Conclusion.


    2. Enterprise JavaBeans Architecture Overview.

    What Are Enterprise JavaBeans Applications?
    Client View of Enterprise Beans.

    Business Entities and Processes, and Enterprise Bean Types.
    Business Entities.
    Business Processes.
    Implementation of Business Rules.
    Enterprise Bean Types.
    Session Beans and Entity Beans.
    Choosing Entity Beans or Session Beans.
    Using Java Classes Instead of Entity Beans.
    Message-Driven Beans.

    Structure of Enterprise Beans.
    Local and Remote Client Views.
    Enterprise Bean Home Interfaces.
    Enterprise Bean Component Interface.
    Enterprise Bean Class.
    Deployment Descriptor.

    Container Tools and Services.
    Container Artifacts.
    Container Runtime Services.

    Conclusion.


    3. Enterprise JavaBeans Roles.

    EJB Roles.
    Bean Developer.
    Application Assembler.
    Deployer.
    System Administrator.
    EJB Container Provider.
    EJB Server Provider.

    Tools.
    Conclusion.


    4. Working with Session Beans.

    When to Use Session Beans.
    Using Session Beans in Web Applications.
    Using Session Beans in Three-Tier Applications.

    Understanding the State of a Session Object.
    Stateful versus Stateless Session Beans.
    Understanding Conversational State.

    Overview of the Example Application.
    User View of the Application.
    Main Parts of the Application.
    The Benefits Enrollment Business Process.

    EnrollmentEJB Stateful Session Bean in Detail.
    EnrollmentEJB Session Bean Parts.
    EnrollmentBean Session Bean Class Details.
    Client Developer's Perspective.

    PayrollEJB Stateless Session Bean.
    PayrollEJB Stateless Session Bean Parts.
    Client Developer's Perspective.

    Database Schemas.
    EmployeeDatabase Schema.
    BenefitsDatabase Schema.
    PayrollDatabase Schema.

    Container-Provided Benefits.
    Conclusion.


    5. Session Bean in Its Container.

    Container Artifacts.
    How the Container Manages Session Beans at Runtime.
    EJB Home Interface Lookup.
    Session Object Creation.
    Business Method Invocation.
    Session Bean Passivation and Activation.
    Session Object Removal.
    Session Bean Timeout.

    Conclusion.


    6. Enterprise Application Integration Using Message-Driven Beans and Connectors.

    JMS and Communication Modes.
    Synchronous and Asynchronous Communication.
    JMS Overview.

    Message-Driven Bean Concepts.
    Implementing a Message-Driven Bean.
    Message-Driven Beans and Transactions.
    Message-Driven Bean Usage.

    Using a Message-Driven Bean in the Benefits Application.
    PayrollMDB Message-Driven Bean.
    PayrollEJB Local Interfaces.

    Using JMS and Connectors for Communication.
    Using JMS to Communicate With Messaging Systems.
    Using Connectors to Communicate With EISs.

    Conclusion.


    7. Understanding Entity Beans.

    Client View of an Entity Bean.
    Home Interface.
    Component Interface.
    Primary Key and Object Identity.
    Entity Object Life Cycle.
    Entity Bean Handle.

    Bean Developer View of an Entity Bean.
    Container-Managed Persistence.
    EJB QL Query Language.
    Bean-Managed Persistence.
    Entity Bean Class Methods.
    Entity Bean Instance Life Cycle.
    Using the ejbLoad and ejbStore Methods.
    Designing the Entity Bean Component Interface.
    Concurrent Invocation of an Entity Object.
    Using Entity Beans with Preexisting Data.

    Conclusion.


    8. Entity Bean Application Example.

    Application Overview.
    Problem Description.
    Main Parts of the Application.
    Distributed Deployment.

    Parts Developed by Wombat.
    Overview of the Wombat Parts.
    EnrollmentEJB Session Bean.
    EmployeeEJB Entity Bean.
    SelectionEJB Entity Bean.
    PlanEJB Entity Bean.
    DoctorEJB Entity Bean.
    EnrollmentWeb Web Application.
    BenefitsAdminWeb Web Application.
    BenefitsDatabase.
    Packaging of Parts.

    Parts developed at Star Enterprise.
    EmployeeDatabase and Deployment of EmployeeEJB.
    EmployeeBeanBMP Entity Bean Class.
    Payroll System.

    Conclusion.


    9. Using Enterprise JavaBeans in Web Services.

    Introduction to Web Services.
    Web Services Technologies.
    J2EE and Web Services.

    Developing a Web Service Using Stateless Session Beans.
    Developing a New Web Service.
    Exposing A Stateless Session Bean as a Web Service.

    Stateless Session Bean Web Service Example.
    InsurancePlanAdminEJB Stateless Session Bean.
    Developing and Packaging the Web Service.

    Accessing a Web Service from an Enterprise Bean.
    Accessing a Web Service Example.
    Providence Web Service.
    ProvidencePlanEJB Entity Bean.
    ProvidenceDoctorEJB Entity Bean.
    Packaging.

    Document-Oriented Web Services.
    Conclusion.


    10. Understanding Transactions.

    Declarative Transaction Demarcation.
    Transaction Attributes.
    Transaction Attribute Values.
    Transaction Attributes for Message Driven Beans.
    Transaction Attributes for Sample Application.

    Programmatic Transaction Demarcation.
    Transaction Demarcated by a Client.
    Transaction Demarcation by a Session Bean.
    Pitfalls of Using Programmatic Transaction Demarcation.

    Conclusion.


    11. Managing Security.

    Responsibilities of the System Administrator.
    Administering Users and Security Principals.
    Managing Principal Mapping.

    Responsibilities of the Container Provider.
    Authentication and Authorization Tasks.
    Managing Multiple Applications and Domains.

    Application Provider's View of Security.
    Client Authentication.
    Authorization.
    Declarative Security Mechanism.
    Security Roles.
    Method Permissions.
    Using Run-As Principal.
    Programmatic Security API.
    Example Security Application.

    Deployer's Responsibility.
    Deploying Wombat's Enterprise Beans.
    Deploying Star Enterprise's Beans.

    Conclusion.


    Appendix A API Reference.

    EJBObject Interface Methods.
    EJBLocalObject Interface Methods.
    EJBHome Interface Methods.
    EJBLocalHome Interface.
    EnterpriseBean Interface.
    EJBContext Interface Methods.
    EJBMetaData Interface Methods.
    EntityBean Interface Methods.
    EntityContext Interface Methods.
    Handle Interface Methods.
    HomeHandle Interface Methods.
    SessionBean Interface Methods.
    SessionContext Interface Methods.
    SessionSynchronization Interface Methods.
    Exception Classes.
    CreateException Class.
    DuplicateKeyException Class.
    EJBException Class.
    FinderException Class.
    NoSuchEntityException Class.
    ObjectNotFoundException Class.
    RemoveException Class.


    Appendix B Code Samples.

    Session Bean Helper Classes.
    EnrollmentBean Source Code.
    PayrollEJB Session Bean Class.
    Entity Application EnrollmentBean Implementation.
    SelectionBean Implementation.
    PlanBean Implementation Class.
    EmployeeBeanBMP Class.
    PayrollBean Implementation Class Using Connectors.
    CCI Interface Classes.
    InsurancePlanAdminBean.
    ProvidencePlanBean.
    ProvidenceDoctorBean class.
    Command Beans.