EJB 3 Developer Guide

Enterprise JavaBean 3 - a Practical Book and eBook Guide for developers and architects using the EJB Standard.

EJB 3 Developer Guide

Starting
Michael Sikora

Enterprise JavaBean 3 - a Practical Book and eBook Guide for developers and architects using the EJB Standard.
$10.00
$26.00
RRP $23.99
RRP $39.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

+ Collection
Free Sample

Book Details

ISBN 139781847195609
Paperback276 pages

About This Book

  • A rapid introduction to the features of EJB 3
  • EJB 3 features explored concisely with accompanying code examples
  • Easily enhance Java applications with new, improved Enterprise Java Beans

 

Who This Book Is For

This book is primarily aimed at professional developers who already have a working knowledge of Java. Enterprise architects and designers with a background in Java would also find this book of use. Previous experience of working with Java is essential and knowledge of relational databases is desirable.

As this book is an introduction to EJB 3, it is aimed at those who are new to EJB 3. As the new version of EJB is so radically different from the previous version (EJB 2.x), the book is suitable for and should be of interest to those who have had experience working with EJB 2.x. The text makes it clear where the differences between the versions of EJB lie, although they are not explored in detail.

Table of Contents

Chapter 1: Introduction to the EJB 3 Architecture
Introduction to the Java EE Architecture
The EJB 3 Architecture
Getting Started
Summary
Chapter 2: Session Beans
Introduction
Stateless Session Beans
Stateful Session Beans
Local Interfaces
Summary
Chapter 3: Entities
Introduction
EJB 3 Entities
Introducing the EntityManager
Packaging and Deploying Entities
Field-Based Annotations
Generating Primary Keys
Overriding Metadata Defaults
Summary
Chapter 4: Object/Relational Mapping
O/R Mapping Default Behavior
O/R Mapping Overriding Defaults
O/R Mapping Additional Annotations
O/R Inheritance Mapping
Summary
Chapter 5: The Java Persistence Query Language
Introduction
Simple Queries
Projection
Conditional Expressions
Aggregate Functions
Queries with Relationships
Joins
Collection Comparison Expressions
Constructor Expressions
SubQueries
Functions
Queries with Parameters
Named Queries
Handling Date and Time
Bulk Update and Delete
Native SQL
Summary
Chapter 6: Entity Manager
Application-managed Entity Manager
Entity Manager Merge
Entity Manager Methods
Cascade Operations
Extended Persistence Context
Entity LifeCycle Callback Methods
Summary
Chapter 7: Transactions
Introduction
Container-Managed Transaction Demarcation
Examples of Transaction Attributes
Controlling Container Managed Transactions
Concurrency and Database Locking
UserTransaction Interface
Summary
Chapter 8: Messaging
Introduction
Java Message Service (JMS) API
Queue Producer and Consumer Examples
Topic Producer and Consumer Examples
Motivation for Message-Driven Beans
A Simple Message-Driven Bean Example
MDB Activation Configuration Properties
MessageDrivenContext
MDB LifeCycle
MDB Example Revisited
Sending Message Confirmation to a Client
MDBs and Transactions
Summary
Chapter 9: EJB Timer Service
Introduction
Timer Service Examples
A Timer Interface Example
Timers and Transactions
Summary
Chapter 10: Interceptors
Interceptor Methods
Interceptor Classes
Default Interceptors
Interceptor Communication
Summary
Chapter 11: Implementing EJB 3 Web Services
Overview of Web Service Concepts
Creating a Java Application Web Service
Overriding JAX-WS Annotation Defaults
Deploying an EJB Session Bean as a Web Service
Summary
Chapter 12: EJB 3 Security
Java EE Container Security
Authentication
EJB Authorization
Java EE Web Container Security
Summary

What You Will Learn

This book will teach you the core elements of EJB 3 technology. You will:

  • Gain a rapid introduction to the EJB 3 essentials while learning about the underlying principles
  • Create Entities, Message-Driven Beans, Session Beans and their clients
  • Look at running an EJB client from an application client container
  • Learn how to package and deploy an EJB
  • Use JQPL (Java Persistence Query Language)
  • Explore the entity manager interface
  • Learn about object/relational mapping with EJB 3
  • Look at the Java Messaging API and message-driven beans
  • Look at transactions, interceptors, and EJB timer services
  • Understand how EJB 3 differs from the 2.x version
  • Implement EJB 3's security features

In Detail


Authors

Table of Contents

Chapter 1: Introduction to the EJB 3 Architecture
Introduction to the Java EE Architecture
The EJB 3 Architecture
Getting Started
Summary
Chapter 2: Session Beans
Introduction
Stateless Session Beans
Stateful Session Beans
Local Interfaces
Summary
Chapter 3: Entities
Introduction
EJB 3 Entities
Introducing the EntityManager
Packaging and Deploying Entities
Field-Based Annotations
Generating Primary Keys
Overriding Metadata Defaults
Summary
Chapter 4: Object/Relational Mapping
O/R Mapping Default Behavior
O/R Mapping Overriding Defaults
O/R Mapping Additional Annotations
O/R Inheritance Mapping
Summary
Chapter 5: The Java Persistence Query Language
Introduction
Simple Queries
Projection
Conditional Expressions
Aggregate Functions
Queries with Relationships
Joins
Collection Comparison Expressions
Constructor Expressions
SubQueries
Functions
Queries with Parameters
Named Queries
Handling Date and Time
Bulk Update and Delete
Native SQL
Summary
Chapter 6: Entity Manager
Application-managed Entity Manager
Entity Manager Merge
Entity Manager Methods
Cascade Operations
Extended Persistence Context
Entity LifeCycle Callback Methods
Summary
Chapter 7: Transactions
Introduction
Container-Managed Transaction Demarcation
Examples of Transaction Attributes
Controlling Container Managed Transactions
Concurrency and Database Locking
UserTransaction Interface
Summary
Chapter 8: Messaging
Introduction
Java Message Service (JMS) API
Queue Producer and Consumer Examples
Topic Producer and Consumer Examples
Motivation for Message-Driven Beans
A Simple Message-Driven Bean Example
MDB Activation Configuration Properties
MessageDrivenContext
MDB LifeCycle
MDB Example Revisited
Sending Message Confirmation to a Client
MDBs and Transactions
Summary
Chapter 9: EJB Timer Service
Introduction
Timer Service Examples
A Timer Interface Example
Timers and Transactions
Summary
Chapter 10: Interceptors
Interceptor Methods
Interceptor Classes
Default Interceptors
Interceptor Communication
Summary
Chapter 11: Implementing EJB 3 Web Services
Overview of Web Service Concepts
Creating a Java Application Web Service
Overriding JAX-WS Annotation Defaults
Deploying an EJB Session Bean as a Web Service
Summary
Chapter 12: EJB 3 Security
Java EE Container Security
Authentication
EJB Authorization
Java EE Web Container Security
Summary

Book Details

ISBN 139781847195609
Paperback276 pages
Read More