You are previewing Enterprise JavaBeans, Fourth Edition.
O'Reilly logo
Enterprise JavaBeans, Fourth Edition

Book 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

  1. Enterprise JavaBeans, 4th Edition
    1. Preface
      1. Author’s Note
      2. What Is Enterprise JavaBeans?
      3. Who Should Read This Book?
      4. Organization
        1. Part I: The Technical Manuscript
        2. Part II: The JBoss Workbook
      5. Software and Versions
      6. Conventions
      7. Comments and Questions
      8. Acknowledgments
    2. I. Lay of the Land
      1. 1. Introduction
        1. Server-Side Components
          1. Enterprise JavaBeans Defined
        2. Distributed Object Architectures
        3. Component Models
          1. Competing Component Models: Microsoft’s .NET Framework
          2. Benefits of a Standard Server-Side Component Model
        4. Asynchronous Messaging
          1. Java Message Service
          2. Message-Driven Beans and J2eeCA 1.5
          3. Web Services
        5. Titan Cruises: An Imaginary Business
        6. What’s Next?
      2. 2. Architectural Overview
        1. The Enterprise Bean Component
          1. Classes and Interfaces
            1. Naming conventions
            2. The remote interface
            3. The remote home interface
            4. The bean class
            5. The primary key
            6. What about session beans?
            7. What about message-driven beans?
          2. Deployment Descriptors and JAR Files
            1. EJB 2.1: Deployment descriptor
            2. EJB 2.0: Deployment descriptor
            3. EJB 2.1 and 2.0: Elements of the XML deployment descriptor
          3. EJB Objects and EJB Home
            1. The EJB object
            2. The EJB home
            3. Deploying a bean
        2. Using Enterprise Beans
          1. Getting Information from an Entity Bean
          2. Modeling Taskflow with Session Beans
            1. Stateless and stateful session beans
          3. Message-Driven Beans
        3. The Bean-Container Contract
        4. Summary
      3. 3. Resource Management and the Primary Services
        1. Resource Management
          1. Instance Pooling
            1. The entity bean life cycle
            2. Instance swapping
            3. Message-driven beans and instance pooling
          2. The Activation Mechanism
          3. J2EE Connector Architecture
            1. J2EE Connectors 1.0 for EJB 2.0 and 2.1
            2. J2EE Connectors 1.5 for EJB 2.1
        2. Primary Services
          1. Concurrency
            1. Concurrency with session and entity beans
            2. Reentrance
            3. Concurrency with message-driven beans
          2. Transactions
          3. Persistence
            1. Object-to-relational persistence
            2. Object database persistence
            3. Legacy persistence
            4. Container-managed versus bean-managed persistence
          4. Distributed Objects
          5. Asynchronous Enterprise Messaging
          6. EJB 2.1 : Timer Service
          7. Naming
          8. Security
            1. Role-driven access control
            2. Unchecked methods
            3. The runAs security identity
          9. Primary Services and Interoperability
            1. IIOP
            2. SOAP and WSDL
        3. What’s Next?
      4. 4. Developing Your First Enterprise Beans
        1. Choosing and Setting Up an EJB Server
          1. Setting Up Your Java IDE
        2. Developing an Entity Bean
          1. Cabin: The Remote Interface
          2. CabinHome: The Remote Home Interface
          3. CabinBean: The Bean Class
            1. Container-managed fields
            2. The callback methods
          4. The Deployment Descriptor
            1. EJB 2.1: The Cabin EJB’s deployment descriptor
            2. EJB 2.0: The Cabin EJB’s deployment descriptor
            3. EJB 2.1 and 2.0: Defining the XML elements
          5. cabin.jar: The JAR File
          6. Creating a CABIN Table in the Database
          7. Deploying the Cabin EJB
          8. Creating a Client Application
            1. Creating a new Cabin EJB
        3. Developing a Session Bean
          1. TravelAgentRemote: The Remote Interface
          2. TravelAgentHomeRemote: The Remote Home Interface
          3. TravelAgentBean: The Bean Class
          4. The TravelAgent EJB’s Deployment Descriptor
            1. EJB 2.1: Deployment descriptor
            2. EJB 2.0: Deployment descriptor
            3. EJB 2.0 and 1.1: Defining the XML elements
          5. Deploying the TravelAgent EJB
          6. Creating a Client Application
      5. 5. The Remote and Local Client View
        1. Locating Beans with JNDI
        2. The Remote Client API
          1. Java RMI-IIOP
            1. Java RMI return types, parameters, and exceptions
            2. Return types and parameters
            3. Java RMI-IIOP type restrictions
            4. Explicit narrowing using PortableRemoteObject
          2. The Remote Home Interface
            1. Removing beans
            2. Bean metadata
            3. The HomeHandle
            4. Creating and finding beans
            5. Home methods
          3. The Remote Interface
          4. EJBObject, Handle, and Primary Key
            1. Getting the EJBHome
            2. Primary key
            3. Comparing beans for identity
            4. Removing beans
            5. The enterprise bean Handle
            6. HomeHandle
            7. Inside the Handle
        3. The Local Client API
          1. The Local Interface
          2. The Local Home Interface
          3. Deployment Descriptor
          4. Using the Local Client API
          5. When to Use Local Component Interfaces
          6. Are Local Component Interfaces Necessary?
      6. 6. CMP: Basic Persistence
        1. The Abstract Programming Model
          1. Abstract Persistence Schema
          2. Container Tools and Persistence
        2. The Customer EJB
          1. The Customer Table
          2. The CustomerBean
          3. The Remote Interface
          4. The Remote Home Interface
          5. The XML Deployment Descriptor
          6. The EJB JAR File
          7. Deployment
          8. The Client Application
        3. Persistence Fields
        4. Dependent Value Classes
        5. Relationship Fields
      7. 7. CMP: Entity Relationships
        1. The Seven Relationship Types
          1. Abstract Persistence Schema
          2. Database Modeling
          3. One-to-One, Unidirectional Relationship
            1. Relational database schema
            2. Abstract programming model
            3. Abstract persistence schema
          4. One-to-One, Bidirectional Relationship
            1. Relational database schema
            2. Abstract programming model
            3. Abstract persistence schema
          5. One-to-Many, Unidirectional Relationship
            1. Relational database schema
            2. Abstract programming model
            3. Abstract persistence schema
          6. The Cruise, Ship, and Reservation EJBs
          7. Many-to-One, Unidirectional Relationship
            1. Relational database schema
            2. Abstract programming model
            3. Abstract persistence schema
          8. One-to-Many, Bidirectional Relationship
            1. Relational database schema
            2. Abstract programming model
            3. Abstract persistence schema
          9. Many-to-Many, Bidirectional Relationship
            1. Relational database schema
            2. Abstract programming model
            3. Abstract persistence schema
          10. Many-to-Many, Unidirectional Relationship
            1. Relational database schema
            2. Abstract programming model
            3. Abstract persistence schema
          11. Co-Location and the Deployment Descriptor
          12. Cascade Delete and Remove
      8. 8. CMP: EJB QL
        1. Declaring EJB QL
        2. The Query Methods
          1. Find Methods
          2. Select Methods
        3. EJB QL Examples
          1. Simple Queries
          2. Simple Queries with Paths
          3. The IN Operator
          4. Using DISTINCT
          5. The WHERE Clause and Literals
          6. The WHERE Clause and Input Parameters
          7. The WHERE Clause and Operator Precedence
          8. The WHERE Clause and CDATA Sections
          9. The WHERE Clause and Arithmetic Operators
          10. The WHERE Clause and Logical Operators
          11. The WHERE Clause and Comparison Symbols
          12. The WHERE Clause and Equality Semantics
          13. The WHERE Clause and BETWEEN
          14. The WHERE Clause and IN
          15. The WHERE Clause and IS NULL
          16. The WHERE Clause and IS EMPTY
          17. The WHERE Clause and MEMBER OF
          18. The WHERE Clause and LIKE
          19. Functional Expressions
            1. Functional expressions in the WHERE clause
            2. EJB 2.1: Aggregate functions in the SELECT clause
              1. COUNT (identifier or path expression)
              2. MAX( path expression), MIN( path expression)
              3. AVG( numeric ), SUM( numeric)
              4. DISTINCT, nulls, and empty arguments
          20. EJB 2.1: The ORDER BY Clause
        4. Problems with EJB QL
          1. The OBJECT( ) Operator
          2. Lack of Support for Date
          3. Limited Functions
          4. Multiple SELECT Expressions
          5. GROUP BY and HAVING
          6. Subqueries
          7. Dynamic Queries
      9. 9. Bean-Managed Persistence
        1. The Remote Interface
          1. Set and Get Methods
        2. The Remote Home Interface
        3. The Primary Key
        4. The ShipBean
        5. Obtaining a Resource Connection
        6. Exception Handling
        7. The ejbCreate( ) Method
        8. The ejbLoad( ) and ejbStore( ) Methods
        9. The ejbRemove( ) Method
        10. The ejbFind( ) Methods
        11. The Deployment Descriptor
      10. 10. The Entity-Container Contract
        1. The Primary Key
          1. Single-Field Primary Keys
          2. Compound Primary Keys
          3. Undefined Primary Keys in CMP
        2. The Callback Methods
          1. setEntityContext( ) and unsetEntityContext( )
          2. ejbCreate( )
          3. ejbCreate( ) and ejbPostCreate( ) Sequence of Events
          4. Using ejbLoad( ) and ejbStore( ) in Container-Managed Persistence
          5. Using ejbLoad( ) and ejbStore( ) in Bean-Managed Persistence
          6. ejbPassivate( ) and ejbActivate( )
          7. ejbRemove( )
        3. ejbHome( )
        4. EntityContext
          1. EJBContext
          2. JNDI ENC
        5. The Life Cycle of an Entity Bean
          1. Does Not Exist
          2. The Pooled State
          3. The Ready State
            1. Transitioning from the Pooled state to the Ready state via creation
            2. Transitioning from the Pooled state to the Ready state via a query method
            3. Transitioning from the Pooled state to the Ready state via activation
            4. Transitioning from the Ready state to the Pooled state via passivation
            5. Transitioning from the Ready state to the Pooled state via removal
          4. Life in the Ready State
          5. End of the Life Cycle
      11. 11. Session Beans
        1. The Stateless Session Bean
          1. The ProcessPayment EJB
            1. The database table (PAYMENT)
            2. The remote interface (ProcessPaymentRemote)
            3. Dependent objects (CreditCardDO and CheckDO classes)
            4. An application exception (PaymentException)
            5. The home interface (ProcessPaymentHomeRemote)
            6. The bean class (ProcessPaymentBean)
            7. Accessing environment properties (JNDI ENC)
            8. The ProcessPayment EJB’s deployment descriptor
            9. Local component interfaces
        2. The Life Cycle of a Stateless Session Bean
          1. Does Not Exist
          2. The Method-Ready Pool
            1. Transitioning to the Method-Ready Pool
            2. Life in the Method-Ready Pool
            3. Transitioning out of the Method-Ready Pool: The death of a stateless bean instance
        3. The Stateful Session Bean
          1. Getting Set Up for the TravelAgent EJB
          2. The TravelAgent EJB
            1. The remote interface (TravelAgent)
            2. Dependent object (TicketDO)
            3. The home interface (TravelAgentHomeRemote)
            4. Taking a peek at the client view
            5. TravelAgentBean: The bean class
            6. JNDI ENC and EJB references
            7. Remote EJB references in the JNDI ENC
            8. Local EJB references in the JNDI ENC
            9. The bookPassage( ) method
            10. Why use a Reservation entity bean?
            11. Listing behavior (listAvailableCabins( ))
            12. The TravelAgent deployment descriptor
        4. The Life Cycle of a Stateful Session Bean
          1. Does Not Exist State
          2. Method-Ready State
            1. Transitioning to the Method-Ready state
            2. Life in the Method-Ready state
            3. Transitioning out of the Method-Ready state
          3. Passivated State
            1. System exceptions
      12. 12. Message-Driven Beans
        1. JMS and Message-Driven Beans
          1. JMS as a Resource
            1. Reimplementing the TravelAgent EJB with JMS
            2. TopicConnectionFactory and Topic
            3. TopicConnection and TopicSession
            4. TopicPublisher
            5. Message types
            6. XML deployment descriptor
          2. EJB 2.1: Declaring a JMS Resource
          3. EJB 2.0: Declaring a JMS Resource
          4. JMS Application Client
          5. JMS Is Asynchronous
          6. JMS Messaging Models
            1. Publish-and-subscribe
              1. Point-to-point
            2. Which messaging model should you use?
          7. EJB 2.1: The Unified JMS API
          8. Entity and Session Beans Should Not Receive Messages
          9. Learning More About JMS
        2. JMS-Based Message-Driven Beans
          1. The ReservationProcessor EJB
          2. The ReservationProcessorBean Class
            1. MessageDrivenBean interface
            2. MessageDrivenContext
            3. MessageListener interface
            4. Taskflow and integration for B2B (onMessage( ) )
            5. Sending messages from a message-driven bean
          3. XML Deployment Descriptor
            1. EJB 2.1: Deployment descriptor for MDBs
            2. EJB 2.0: Deployment descriptor for MDBs
            3. Message selector
            4. Acknowledge mode
            5. EJB 2.1: <messaging-type>
            6. EJB 2.1: <message-destination-type>
            7. EJB 2.0: <message-driven-destination>
            8. Subscription durability
          4. The ReservationProcessor Clients
            1. The reservation message producer
            2. The ticket message consumer
        3. The Life Cycle of a Message-Driven Bean
          1. Does Not Exist
          2. The Method-Ready Pool
          3. Transitioning to the Method-Ready Pool
          4. Life in the Method-Ready Pool
          5. Transitioning Out of the Method-Ready Pool: The Death of an MDB Instance
        4. Connector-Based Message-Driven Beans
        5. EJB 2.1: Message Linking
      13. 13. Timer Service
        1. Titan’s Maintenance Timer
        2. Timer Service API
          1. The TimerService Interface
            1. Exceptions
          2. The Timer
            1. Cancelling timers
            2. Identifying timers
            3. Retrieving other information from timers
            4. The TimerHandle object
            5. Exceptions
        3. Transactions
        4. Entity Bean Timers
        5. Stateless Session Bean Timers
          1. Using a Stateless Session Timer
        6. Message-Driven Bean Timers
          1. Problems with the Timer Service
            1. A very little bit about cron
            2. Improving the Timer Service
            3. Message-driven bean timers: Standard configuration properties
            4. Other problems with Timer API
        7. Final Words
      14. 14. EJB 2.1: Web Service Standards
        1. Web Services Overview
        2. XML Schema and XML Namespaces
          1. XML Schema
          2. XML Namespaces
        3. SOAP 1.1
          1. SOAP Messaging Modes
          2. Exchanging SOAP Messages with HTTP
          3. Now You See It, Now You Don’t
        4. WSDL 1.1
          1. The <definitions> Element
          2. The <portType> and <message> Elements
          3. The <types> Element
          4. The <binding> and <service> elements
        5. UDDI 2.0
        6. From Standards to Implementation
      15. 15. EJB 2.1 and Web Services
        1. Accessing Web Services with JAX-RPC
          1. Generating JAX-RPC Stubs from WSDL
          2. Using JAX-RPC Generated Stubs
          3. The <service-ref> Deployment Element
          4. The JAX-RPC Mapping File
        2. EJB Endpoints
          1. The WSDL Document
          2. The Endpoint Interface
          3. No Home Interface
          4. The Stateless Bean Class
          5. The Deployment Files
            1. ejb-jar.xml file
            2. WSDL file
            3. JAX-RPC mapping file
            4. webservices.xml file
      16. 16. Transactions
        1. ACID Transactions
          1. Is the TravelAgent EJB Atomic?
          2. Is the TravelAgent EJB Consistent?
          3. Is the TravelAgent EJB Isolated?
          4. Is the TravelAgent EJB Durable?
        2. Declarative Transaction Management
          1. Transaction Scope
          2. Transaction Attributes
            1. Setting a transaction attribute
            2. Transaction attributes defined
            3. Container-managed persistence and transaction attributes
            4. Message-driven beans and transaction attributes
            5. EJB endpoints and transaction attributes
          3. Transaction Propagation
          4. Collection-Based Relationships and Transactions
        3. Isolation and Database Locking
          1. Dirty, Repeatable, and Phantom Reads
            1. Dirty reads
            2. Repeatable reads
            3. Phantom reads
          2. Database Locks
          3. Transaction Isolation Levels
          4. Balancing Performance Against Consistency
            1. Controlling isolation levels
        4. Nontransactional Beans
        5. Explicit Transaction Management
          1. Transaction Propagation in Bean-Managed Transactions
            1. Message-driven beans and bean-managed transactions
          2. Heuristic Decisions
          3. UserTransaction
          4. Status
          5. EJBContext Rollback Methods
        6. Exceptions and Transactions
          1. System Exceptions Versus Application Exceptions
            1. System exceptions
            2. Application exceptions
        7. Transactional Stateful Session Beans
          1. The Transactional Method-Ready State
            1. Transitioning into the Transactional Method-Ready state
            2. Life in the Transactional Method-Ready state
      17. 17. J2EE
        1. Servlets
        2. JavaServer Pages
        3. Web Components and EJB
        4. Filling in the Gaps
          1. J2EE Application Client Components
          2. Guaranteed Services
        5. Fitting the Pieces Together
      18. 18. XML Deployment Descriptors
        1. The ejb-jar File
        2. The Contents of a Deployment Descriptor
        3. The Document Headerand Schema Declarations
        4. The Descriptor’s Body
        5. Describing Enterprise Beans
          1. Session and Entity Beans
          2. Message-Driven Beans
            1. EJB 2.1 elements
            2. EJB 2.0 elements
          3. Specifying Primary Keys
            1. Deferring primary key definition
          4. Environment Entries
          5. References to Other Beans
            1. Remote references
            2. Local references
          6. References to External Resources
            1. Additional administered objects
            2. Shareable resources
          7. The <service-ref> Deployment Element (EJB 2.1)
          8. Security Roles
          9. Declaring EJB QL Elements
        6. Describing Relationships
        7. Describing Bean Assembly
          1. Specifying a Bean’s Transaction Attributes
          2. Specifying Security Roles and Method Permissions
            1. Assigning roles to methods
            2. Unchecked methods
            3. The runAs security identity
            4. Exclude list
          3. Identifying Specific Methods
            1. Wildcard declarations
            2. Named method declarations
            3. Specific method declarations
            4. Remote/home/local differentiation
      19. 19. EJB Design in the Real World
        1. Pre-Design: Containers and Databases
          1. Container Capabilities
          2. Database Capabilities
        2. Design
          1. Business Entity Identification
          2. Technical Architecture
          3. EJB Identification
            1. Identifying entity beans
            2. Identifying session beans
            3. Identifying message-driven beans
          4. EJB Details
            1. Stateless versus stateful session beans
            2. Container-managed versus bean-managed persistence
            3. Local versus remote interfaces
          5. Fleshing Out the Design
            1. Minimize transaction scope
            2. Don’t confuse EJB types
          6. Special Circumstances
            1. Returning entity data from EJBs
            2. Sequential processing with EJBs
          7. Exceptions
            1. Identifying application exceptions
            2. Design the exception hierarchy
            3. Wrap subsystem exceptions
          8. Base and Utility Classes
            1. Base classes
            2. Utility classes
        3. Should You Use EJBs?
          1. When to Use EJBs
          2. When Not to Use EJBs
          3. Alternatives to EJB
            1. JDBC
            2. Java Data Objects
            3. Others
        4. Wrapping Up
    3. II. JBoss Workbook
      1. 20. Introduction
        1. Contents of the JBoss Workbook
          1. Online Resources
          2. Acknowledgments
      2. 21. JBoss Installation and Configuration
        1. About JBoss
        2. Installing JBoss Application Server
          1. Discovering the JBoss Directory Structure
          2. JBoss Configuration Files
          3. Deployment in JBoss
        3. A Quick Look at JBoss Internals
          1. Microkernel Architecture
          2. Hot Deployment
          3. Net Boot
          4. Detached Invokers
        4. Exercise Code Setup and Configuration
          1. Exercises Directory Structure
          2. Environment Setup
      3. 22. Exercises for Chapter 4
        1. Exercise 4.1: A Simple Entity Bean
          1. Start Up JBoss
          2. Initialize the Database
          3. Build and Deploy the Example Programs
          4. Deconstructing build.xml
          5. Examine the JBoss-Specific Files
            1. jboss.xml
          6. Examine and Run the Client Applications
            1. Client_1.java
          7. Managing Entity Beans
        2. Exercise 4.2: A Simple Session Bean
          1. Start Up JBoss
          2. Initialize the Database
          3. Build and Deploy the Example Programs
          4. Examine the JBoss-Specific Files
            1. jboss.xml
            2. ejb-jar.xml
            3. jboss.xml
          5. Examine and Run the Client Application
            1. Client_3.java
            2. TravelAgentBean.java
      4. 23. Exercises for Chapter 5
        1. Exercise 5.1: The Remote Component Interfaces
          1. Start Up JBoss
          2. Initialize the Database
          3. Build and Deploy the Example Programs
          4. Examine the JBoss-Specific Files
          5. Examine and Run the Client Applications
        2. Exercise 5.2: The EJBObject, Handle, and Primary Key
          1. Start Up JBoss
          2. Initialize the Database
          3. Build and Deploy the Example Programs
          4. Examine the JBoss-Specific Files
          5. Examine and Run the Client Applications
        3. Exercise 5.3: The Local Component Interfaces
          1. Start Up JBoss
          2. Initialize the Database
          3. Build and Deploy the Example Programs
          4. Examine the JBoss-Specific Files
            1. ejb-jar.xml
            2. jboss.xml
          5. Examine and Run the Client Applications
      5. 24. Exercises for Chapter 6
        1. Exercise 6.1: Basic Persistence in CMP 2.0
          1. Start Up JBoss
          2. Initialize the Database
          3. Build and Deploy the Example Programs
          4. Examine the JBoss-Specific Files
            1. jbosscmp-jdbc.xml
            2. The <defaults> section
            3. The <enterprise-beans> section
          5. Examine and Run the Client Applications
        2. Exercise 6.2: Dependent Value Classes in CMP 2.0
          1. Start Up JBoss
          2. Initialize the Database
          3. Build and Deploy the Example Programs
          4. Examine the JBoss-Specific Files
          5. Examine and Run the Client Applications
        3. Exercise 6.3: A Simple Relationship in CMP 2.0
          1. Build and Deploy the Example Programs
          2. Examine the JBoss-Specific Files
            1. jbosscmp-jdbc.xml
          3. Examine and Run the Client Applications
            1. AddressBean.java
      6. 25. Exercises for Chapter 7
        1. Exercise 7.1: Entity Relationships in CMP 2.0, Part 1
          1. Start Up JBoss
          2. Initialize the Database
          3. Build and Deploy the Example Programs
          4. Examine the JBoss-Specific Files
          5. Examine and Run the Client Applications
            1. Client_71a
            2. Client_71b
            3. Client_71c
        2. Exercise 7.2:Entity Relationships in CMP 2.0, Part 2
          1. Start Up JBoss
          2. Initialize the Database
          3. Build and Deploy the Example Programs
          4. Examine the JBoss-Specific Files
          5. Examine and Run the Client Applications
            1. Client_72a
            2. Client_72b
            3. Client_72c
            4. Client_72d
            5. Client_72e
            6. Client_72f
        3. Exercise 7.3: Cascade Deletes in CMP 2.0
          1. Build and Deploy the Example Programs
          2. Examine the JBoss-Specific Files
          3. Examine and Run the Client Applications
      7. 26. Exercises for Chapter 8
        1. Exercise 8.1: Simple EJB QL Statements
          1. Start Up JBoss
          2. Build and Deploy the Example Programs
          3. Examine the JBoss-Specific Files
          4. Initialize the Database
          5. Examine and Run the Client Applications
            1. Client_81a
            2. Client_81b
            3. Client_81c
        2. Exercise 8.2: Complex EJB QL Statements
          1. Start Up JBoss
          2. Build and Deploy the Example Programs
          3. Examine the JBoss-Specific Files
          4. Initialize the Database
          5. Examine and Run the Client Applications
            1. Client_82a
            2. Client_82b
            3. Client_82c
            4. Client_82d
            5. Client_82e
            6. Client_82f
            7. Client_82g
            8. Client_82h
            9. Client_82i
            10. Client_82j
            11. Client_82k
            12. Client_82m
            13. Client_82n
          6. JBoss Dynamic QL
            1. Advanced JBoss QL
      8. 27. Exercises for Chapter 9
        1. Exercise 9.1: A BMP Entity Bean
          1. Start Up JBoss
          2. Initialize the Database
          3. Examine the EJB Standard Files
            1. ejb-jar.xml (part I)
            2. ejb-jar.xml (part II)
          4. Examine the JBoss-Specific Files
            1. jboss.xml
            2. ShipBean.java
            3. ejb-jar.xml
            4. jboss.xml
          5. Build and Deploy the Example Programs
          6. Examine the Client Application
            1. Client_91.java
          7. Run the Client Application
            1. Creating the database table
            2. Testing the BMP bean
            3. Analyzing the effects of transactions and commit options
            4. jboss.xml
            5. Possible optimizations
            6. Dropping the database table
      9. 28. Exercises for Chapter 11
        1. Exercise 11.1: A Stateless Session Bean
          1. Examine the EJB
            1. ProcessPaymentRemote.java
            2. CheckDO.java
            3. ProcessPaymentBean.java
          2. Examine the EJB Standard Deployment Descriptor
            1. ejb-jar.xml
            2. ProcessPaymentBean.java
            3. ProcessPaymentBean.java
          3. Examine the JBoss Deployment Descriptors
            1. jboss.xml
          4. Start Up JBoss
          5. Build and Deploy the Example Programs
          6. Initialize the Database
          7. Examine the Client Applications
            1. Client_111a
            2. Client_111b
        2. Exercise 11.2: A Stateful Session Bean
          1. Examine the EJB
          2. Examine the EJB Standard Deployment Descriptor
            1. ejb-jar.xml
          3. Examine the JBoss Deployment Descriptor
            1. jboss.xml
            2. jbosscmp-jdbc.xml
          4. Start Up JBoss
          5. Build and Deploy the Example Programs
          6. Initialize the Database
          7. Examine the Client Applications
            1. Client_112a
            2. Client_112b
            3. Client_112c
      10. 29. Exercises for Chapter 12
        1. Exercise 12.1: JMS as a Resource
          1. Start Up JBoss
          2. Initialize the Database
          3. Create a New JMS Topic
            1. Adding a JMS Topic through a configuration file
            2. jbossmq-titantopic-service.xml
            3. Adding a JMS Topic through the JMX HTTP connector
          4. Examine the EJB Standard Files
            1. ejb-jar.xml
          5. Examine the JBoss-Specific Files
            1. jboss.xml
          6. Build and Deploy the Example Programs
          7. Examine the Client Applications
            1. JmsClient_1.java
          8. Run the Client Applications
        2. Exercise 12.2: The Message-Driven Bean
          1. Start Up JBoss
          2. Initialize the Database
          3. Create a New JMS Queue
            1. Adding a JMS queue through a configuration file
            2. jbossmq-titanqueues-service.xml
            3. Adding a JMS queue through the JMX HTTP connector
          4. Examine the EJB Standard Files
            1. ejb-jar.xml
          5. Examine the JBoss-Specific Files
            1. jboss.xml
          6. Build and Deploy the Example Programs
          7. Examine the Client Applications
            1. JmsClient_ReservationProducer.java
            2. JmsClient_TicketConsumer.java
          8. Run the Client Applications
      11. 30. Exercises for Chapter 13
        1. Exercise 13.1: EJB Timer Service
          1. Clean the Database
          2. Build and Deploy Example Programs
          3. Examine the Service Code
            1. ShipBean.java
            2. ShipMaintenanceBean.java
          4. Examine the Client Code
          5. Run the Example
      12. 31. Exercises for Chapter 15
        1. Exercise 15.1: Web Services and EJB 2.1
          1. Initialize Your Environment
          2. Clean the Database
          3. Build and Deploy Example Programs
            1. build.xml
          4. Examine the Server Model
            1. TravelAgentEndpoint.java
            2. ejb-jar.xml
            3. travelagent_mapping.xml
            4. webservices.xml
          5. Examine the Client Model
            1. TravelAgentClientBean.java
            2. ejb-jar.xml
            3. travelagent.wsdl
          6. Run the Client Application
      13. A. Database Configuration
        1. Set Up the Database
          1. Basic Setup
          2. titandb-ds.xml
        2. Examine the JBoss-Specific Files
          1. jbosscmp-jdbc.xml
        3. Start Up JBoss
        4. Build and Deploy the Example Programs
        5. Examine and Run the Client Applications
    4. Index
    5. Colophon