Learn your way! Get started

Java EE, Part 4 of 8: EJB 3.0 in the Enterprise

with expert Susan Bryant


Course at a glance

Included in these subscriptions:

  • Dev & IT Pro Video
  • Dev & IT Pro Power Pack

Release date 11/12/2010
Level Advanced
Runtime 8h 57m
Closed captioning N/A
Transcript N/A
eBooks / courseware Included
Hands-on labs Included
Sample code Included
Exams Included


Enterprise Solutions

Need reporting, custom learning tracks, or SCORM? Learn More



Course description

This course takes you beyond the fundamentals of Enterprise Java Bean (EJB 3.0) programming using Eclipse. In this course, you will learn about building message-driven Beans, EJB Security, utilizing Web Services technologies like JAX-WS, and managing distributed transactions. You will also be exposed to Java Interceptors, EJB Timer service, Hibernate JPA caching, EJB design patterns, and deployment.

Prerequisites

This course is intended for intermediate to advanced Java programmers. System architects will find the advanced concepts especially beneficial in designing a framework. Students should have good Java programming knowledge and should be familiar with web application programming, including servlets and JSPs.

Learning Paths

This course will help you prepare for the following certifications and exams:
Java EE 5 Business Component Developer
Java EE 6 Enterprise JavaBeans Developer
Java EE 5 Web Component Developer
Java EE 6 Enterprise Architect
Java EE 6 Java Persistence API Developer
1Z0-898: Java EE 6 Java Persistence API Developer Certified Expert Exam
1Z0-866: Java Enterprise Architect Certified Master Essay Exam
1Z0-895: Java EE 6 Enterprise JavaBeans Developer Certified Expert Exam
1Z0-858: Java EE 5 Web Component Developer Certified Professional Exam
1Z0-860: Java EE 5 Business Component Developer Certified Professional Exam

This course is part of the following LearnNowOnline SuccessPaths™:
Java Development

Meet the expert

Susan Bryant is an experienced IT trainer and consultant with a broad array of skills. She has over 15 years experience in information systems with roles including systems consulting, project management, staff management, staff mentoring, and certified technical trainer. Susan has a strong technical knowledge of IBM WebSphere Application Server, WebSphere Portal Server, WebSphere Process Server, Lotus Domino, and web application development technologies including, Struts, JSF, EJBs and AJAX.

Course outline



Module 1

JPAQL (12:28)
  • Introduction (04:11)
  • JPAQL (01:55)
  • Interface (00:54)
  • Refactor (03:19)
  • Local Interface (01:39)
  • Summary (00:27)
Intro to Relationships (48:54)
  • Introduction (00:47)
  • Relationship Between Entities (02:11)
  • Anatomy of a Relationship (02:58)
  • Foreign Key (00:28)
  • Example Schema (00:26)
  • One-to-One Unidirectional (02:15)
  • Creating Entity Instances (00:40)
  • Traversing the Relationship (00:40)
  • The Cascade Behavior (02:02)
  • One-to-One Bidirectional (01:34)
  • Traversing the Relationship (01:19)
  • Demo: Intro to Relationships (32:55)
  • Summary (00:34)

Module 2

Complex Relationships (44:14)
  • Introduction (00:34)
  • One-to-Many and Many-to-One (01:46)
  • Many-to-One Unidirectional (00:56)
  • Creating Entity Instances (00:58)
  • Traversing the Relationship (00:21)
  • Modeling One-to-Many (01:34)
  • Creating Entity Instances (03:38)
  • Traversing the Relationship (00:29)
  • Many-to-Many (01:33)
  • Modeling Many-to-Many (01:56)
  • Creating Entity Instances (00:41)
  • Traversing Relationship (00:33)
  • Unidirectional One-to-Many (01:08)
  • Unidirectional One-to-Many (01:40)
  • Creating Entity Instances (00:43)
  • Traversing the Relationship (00:35)
  • Demo: Complex Relationships (24:31)
  • Summary (00:30)
Relationships and JPAQL (38:41)
  • Introduction (00:44)
  • Relationships in JPAQL (01:06)
  • Example: Relationship (01:01)
  • Fetching Optimizations (01:35)
  • Lazy vs. Eager Initialization (02:22)
  • Lazy Initialization (02:43)
  • Lazy Initialization Problems (02:04)
  • Fetch Join Query (01:39)
  • Demo: Relationships and JPAQL (24:57)
  • Summary (00:27)

Module 3

Entity and Inheritance (26:50)
  • Introduction (00:43)
  • Inheritance (01:33)
  • Inheritance Example (01:04)
  • Inheritance and Entities (01:31)
  • Inheritance Strategies (00:23)
  • Single Table Per Class (04:59)
  • Single Table Pros and Cons (01:23)
  • Demo: Entity and Inheritance (14:45)
  • Summary (00:25)
More Inheritance Strategies (19:27)
  • Introduction (00:29)
  • Table Per Concrete Class (01:30)
  • JBoss Warning (01:42)
  • Table Structure (00:20)
  • Pros and Cons (00:59)
  • Joined Subclasses (01:29)
  • Table Structure (00:49)
  • Pros and Cons (00:59)
  • Which Approach to Use (01:48)
  • Demo: Inheritance Strategies (08:46)
  • Summary (00:30)

Module 4

MDB Intro (22:07)
  • Introduction (00:37)
  • Trouble with RMI/IIOP (01:58)
  • Messaging to the Rescue (01:24)
  • Messaging Features (01:01)
  • Message Domains (00:38)
  • Publish/Subscribe (01:17)
  • Point-to-Point (01:20)
  • Java Message Service (01:12)
  • Overview (02:51)
  • JMS Interfaces (00:39)
  • Integrating JMS and EJB (01:13)
  • MDBs are Different (00:59)
  • MDBs Cannot Respond (00:55)
  • MDBs are Stateless (01:31)
  • Demo: MDBs (04:00)
  • Summary (00:24)
MDB API (44:58)
  • Introduction (00:30)
  • Message-Driven Bean Interfaces (01:35)
  • javax.jms.MessageListener (00:51)
  • javax.jms.Message (00:47)
  • Lifecycle (01:16)
  • Example: Message Drive Bean (02:52)
  • MDB - Client Example (01:42)
  • Transactions (01:05)
  • Security (00:43)
  • Load Balancing (01:17)
  • Clustering and Topics (01:19)
  • Clustering and Queues (01:05)
  • A Few Tips (01:35)
  • Building a Response (01:58)
  • Potential Problems (01:12)
  • A Simple Alternative (00:50)
  • Type Checking and Messages (00:59)
  • Testing Message-Driven Beans (00:47)
  • Demo: MDB API (22:01)
  • Summary (00:24)
MDB Advanced Topics (12:06)
  • Introduction (00:42)
  • Message-Oriented Middleware (02:02)
  • Durable Subscription (01:19)
  • javax.jms.Message (01:02)
  • Specialized Message Types (02:08)
  • Poison Messages (01:12)
  • Avoiding Poison Messages (02:59)
  • Summary (00:37)

Module 5

EJB Security (43:22)
  • Introduction (01:09)
  • Introduction (02:22)
  • How EJB Security Works (03:57)
  • Protecting Web Resources (01:39)
  • Setting Method Permission (02:05)
  • Defining Roles (01:04)
  • Defining Roles: Annotations (00:35)
  • Specify Methods Permission (02:38)
  • Disable Security Check (02:22)
  • Excludes List (01:10)
  • RunAs Security Identity (02:51)
  • RunAs: Configuration (01:15)
  • Programmatic EJB Security (02:52)
  • Security Role Reference (01:18)
  • Demo: EJB Security (14:56)
  • Summary (01:03)

Module 6

Web Services and EJBs (53:04)
  • Introduction (00:47)
  • Web Services (01:19)
  • Operation and Implementation (01:19)
  • WSDL (02:26)
  • Typical Development Workflow (02:08)
  • Advantages of Web Services (01:43)
  • Web Service Clients (01:23)
  • JAX-WS Overview (02:22)
  • JAX-WS Framework (03:09)
  • Java to XML Data Conversion (01:03)
  • Main Goals of JAX-WS (01:53)
  • JAX-WS Server (01:11)
  • WSDL Overview (01:37)
  • WSDL Document Tags (02:50)
  • Web Services and EJB (01:07)
  • Web Service EJBs (01:14)
  • Annotate the Session Bean (00:52)
  • Annotate the Methods (00:46)
  • Service Endpoint Interface (01:33)
  • Package and Deploy (00:56)
  • Demo: Web Services and EJBs (20:39)
  • Summary (00:38)

Module 7

Timer Service (30:23)
  • Introduction (00:50)
  • Container Managed Timer Service (02:44)
  • EJB Timer Service (01:05)
  • Timer Service and EJB (00:33)
  • Timer Service API (00:48)
  • The TimerService Interface (01:21)
  • Obtaining the Timer Service (01:00)
  • Creating a Timer (01:55)
  • Getting All Timers (00:33)
  • Timeout Callback Method (01:12)
  • Timer Interface (01:16)
  • Example: TimerTestBean (01:06)
  • Timer and Transaction (01:11)
  • Limitations of EJB Timers (01:15)
  • Demo: Timer Service (12:35)
  • Summary (00:51)

Module 8

Transactions (54:35)
  • Introduction (00:34)
  • Need for Transactions (02:30)
  • Transactions (01:18)
  • ACID Properties (01:42)
  • Transaction Components (00:39)
  • Distributed Transactions (01:09)
  • Two Phase Commit (01:25)
  • Java Transaction API (00:40)
  • Object Transaction (01:19)
  • EJB Transaction Basics (01:04)
  • Transaction Propagation (00:56)
  • Transaction Outcome (01:19)
  • Container Managed Transaction (01:38)
  • Container MT Settings (03:30)
  • Interacting with Container MTs (01:38)
  • Example: Container MT (00:46)
  • Transaction Attributes Support (01:06)
  • Bean Managed Transaction (04:45)
  • Client Managed Transaction (02:09)
  • Transaction Isolation (01:20)
  • Isolation Level (01:22)
  • Demo: Transactions (20:55)
  • Summary (00:39)

Module 9

Interceptors (34:27)
  • Introduction (00:41)
  • Introduction (02:05)
  • Interceptors (01:50)
  • Internal Interceptor (02:43)
  • Example: Internal Interceptor (01:27)
  • External Interceptors (01:29)
  • Example: Default Interceptor (01:19)
  • Another Example (00:40)
  • Class-Level Interceptor (01:19)
  • Pre & Post Processing (01:24)
  • Excluding Interceptors (01:22)
  • Interceptors on Lifecycle Call (00:53)
  • Blocking Calls (00:57)
  • Demo: Interceptors (15:23)
  • Summary (00:51)

Module 10

EJB3 Design Patterns (23:15)
  • Introduction (01:15)
  • Introduction (03:45)
  • Message Facade Pattern (03:07)
  • Message Facade Using JMS (02:21)
  • Message Facade Using Timer (02:21)
  • Notes About Message Facade (02:54)
  • The Command Pattern (03:04)
  • Implementing Command Pattern (02:20)
  • Example Command Pattern (01:33)
  • Summary (00:30)
Design Patterns and EJB Data (28:41)
  • Introduction (00:41)
  • Session Facade Pattern (02:51)
  • JPA and Session Facade Pattern (02:58)
  • Facade Example (00:47)
  • Data Transfer Object Pattern (02:54)
  • JPA Entity as DTO (02:45)
  • Problem with JPA Entity as DTO (03:43)
  • Version Number Pattern (02:15)
  • JPA and Version Number Pattern (01:09)
  • Primary Key Generation (01:40)
  • JPA and Primary Key Generation (01:37)
  • Fast Lane Pattern (01:23)
  • JPA and Fast Lane Pattern (02:55)
  • Summary (00:56)