EJB Architecture
Java 2 Enterprise Edition
Major EJB Application Servers
EJB Server Services
EJB Standards
Enterprise Java Beans
Entity EJBs
Session EJBs
Message Driven EJBs
EJB Development Roles
EJB Components: Development
EJB Method Correspondence
EJB Components: Deployment
Deployment Descriptors
EJB Components: Use in Clients
EJB Lookup in Clients
EJB JAR Structure
Deployment on J2SDKEE
sun-j2ee-ri.xml
Server Scripts
Development Scripts
Review: EJB Architecture
Lab: EJB Architecture
EJB Clients
Overview: EJB Clients
EJB Use in Clients
The Remote Interface
javax.ejb.EJBObject
Example Remote Interface
The Home Interface
javax.ejb.EJBHome
Example Home Interface
Session vs. Entity EJBs
Create vs. Find (Entity EJBs)
Primary Key Class (Entity EJBs)
Example Entity Operations
Example Session Interfaces
Example Session Operations
Retrieving EJB Homes
Casting EJB/CORBA References
Casting Collections of EJB
Closing the JNDI Context
Remote JNDI Lookups
Common Exceptions in Client
Sample Client Code
Service Locator Pattern
Sample Client with Lookup Utility
Review: EJB Clients
Lab: EJB Clients
Entity Beans
Entity EJBs
Container vs. Bean Managed
EJB 2.0 CMP Fields
CMP to Table Mapping
javax.ejb.EntityBean
EntityAdapter Utility Class
Example EntityAdapter Class
Entity Components: Development
EJB Method Correspondence
Structure: CMP Entity EJB Class
Structure: Abstract CMP Methods
Structure: Home Methods
CMP Fields and Encapsulation
Structure: Business Methods
CMP Deployment Descriptor
EJB 1.1 CMP
CMP Finder Methods
Finder Query Definitions
Code Generation
EJBMaker Tool
Review: Entity Beans
Lab: Entity Beans
Session Beans
Session EJBs
Stateless vs. Stateful
javax.ejb.SessionBean
SessionAdapter Utility Class
Structure: Session EJB Class
Business and Create Methods
Session Deployment Descriptor
EJB Exception Handling Basics
EJB Transactions Basics
Stateful Session EJBs
Example Stateful Session EJB
Using Stateful Session EJB
Stateless vs. Stateful Lifecycle
Pass By Reference or Value
Example: Copy of Item Collection
Performance of Remote vs. Local
Alternatives to Stateful Session
Example: Alternative to Stateful
Review: Session Beans
Lab: Session Beans
EJB Lifecycle
Stateless Session EJB Lifecycle
Stateless Session EJB Pooling
Pooled EJB Invocations
Stateless Session EJB Techniques
Stateful Session EJB Lifecycle
Stateful Session EJB Transitions
Stateful Session EJB Techniques
Entity EJB Lifecycle
Entity Transition: DNE to Pooled
Entity Transition: create()
Entity Transition: find()
Entity Transition: remove()
Entity Passivation/Activation
Usefulness of ejbActivate/Passivate
Method Calls and ejbLoad/Store()
Why Load/Store is so Inefficient
Entity EJB Techniques
Entity Value Objects
Example Value Object
Example Value Getters/Setters
Review: EJB Lifecycle
Lab: EJB Lifecycle
Bean Managed Persistence
Container vs. Bean Managed
BMP Lifecycle Methods
JDBC and Data Sources
EntityAdapter Class
Manipulating the Primary Key
EJB Method Correspondence
Structure: BMP Entity EJB Class
BMP: Fields/Business Methods
BMP: ejbCreate()
BMP: ejbFindByPrimaryKey()
BMP: ejbFindAll()
BMP: ejbLoad()
BMP: ejbStore()
BMP: ejbRemove()
BMP: getConnection()
BMP: Utility Methods
BMP: SQL Strings
BMP Deployment Descriptor
Table & Datasource Configuration
Pros and Cons of CMP and BMP
Review: BMP 143
Lab: BMP 144
Deployment Descriptors
Configuration Information
ejb-jar.xml Structure
Common EJB Information
Entity and Session Specific Info
CMP Entity Information
Finder Query Definitions
Environmental Entries
EJB References
Security References
Resource References
Querying the EJB Environment
Environment Entries as Constants
Local Interfaces (EJB 2.0)
Example Local Interface
Example Local Home Interface
EJBLocalObject & EJBLocalHome
Retrieving Local EJB References
Example: Local EJB Use
EJBMaker Environmental Entries
EJBMaker and Local Interfaces
Review: Deployment Descriptors
Lab: Deployment Descriptors
Transactions and Security
Assembly Descriptor
Security Roles
EJB Security Identity (EJB 2.0)
Method Permissions
Permissions for Groups of Methods
User Authentication
Accessing Security Info in EJBs
Exclude Lists (EJB 2.0)
Transactions
EJB Transactions Basics
Container-Managed Transactions
Transaction Attributes
Calls to NotSupported / Required
Calls to Supported / RequiresNew
Calls to Mandatory / Never
Transactions and Exceptions
Using System Exceptions
Using Application Exceptions
Application Exceptions in Caller
Explicit Transaction Rollback
Alternate Logic for Exceptions
Bean-Managed Transactions
Review: Transactions and Security
Lab: Transactions and Security
EJB 2.0 CMP
EJB 2.0 Additions to CMP
Object-to-Relational Mapping
Container Managed Relations
Kinds of CMR
Reciprocal vs. One-Way CMR
Abstract CMR Fields
CMR Fields and Encapsulation
Using Multiplicity-One Fields
Using Multiplicity-Many Fields
CMR Collection Behavior
CMR Relationships in ejb-jar.xml
EJB Relationship Role Tag
Reciprocal Relationship Tags
Cascade Deletes
Limitations of CMR
EJB QL
Basic EJB QL Structure
Finder Method Parameters
Navigating CMR in EJB QL
SQL Operations & Select Methods
Limitations of EJB QL
Review: EJB 2.0 CMP
Lab: EJB 2.0 CMP
EJB Design Strategies
Service Locator Pattern
Session EJB and Transactions
Business Object or Data Gateway
Compromise on Proper Entity Use
Value/Data Transfer Objects
Listing Methods
BMP Listing Method
CMP Listing Method
Entity Helper Session EJB
Primary Key Generation
Modifying the Create Method
Business Delegates
Example Business Delegates
Using Business Delegates
Concurrency Problems
Stale Data in the Client
Concurrency Solutions
Review: EJB Design Strategies
Lab: EJB Design Strategies
XML
XML Dialects
Well-formed vs. Valid XML
XML Programs
Common XML Applications
XML Structure
XML Syntax Rules
XML Header
Processing Instructions and Entities
CDATA Sections
Document Type Definitions
DTD Structure
DTD Elements
Element Number and Choices
DTD Attribute Lists
Attribute Type and Requirements
ID vs. NMTOKEN, Enumerations
DTD Entities
DTD Declarations in XML
XML Namespaces
Namespace Declarations
Namespace Scope
Default Namespace
Review: XML
Lab: XML
Java XML APIs
Overview: Java XML APIs
Major Java Classes for DOM
DOM Object Hierarchy
Node Methods
Node Name and Values
Document and Element Methods
NodeList Methods
Retrieving Attribute & Tag Values
JAXP: Loading the Document
JAXP Error Handling
Document Retrieval Options
Parsing XML in a Java String
Validation and Parsing Control
Custom Error and Entity Handlers
HandlerBase Methods
Example: Custom Error Handler
DOM for Document Creation
XML to Object Conversion
Example: Loading XML Data
Review: Java XML APIs
Lab: Java XML APIs
JMS Architecture
Message Oriented Middleware
Advantages of MOM
MOM Products
Messaging Concepts
Message Destinations
Message Send/Reply
Point-to-Point Messaging
Publish/Subscribe Messaging
P2P vs. Pub/Sub
Pull vs. Push Messaging
Java Messaging Service
JMS Objects
JMS Object Usage
Pull vs. Push in JMS
P2P vs. Pub/Sub in JMS
JMS Message Structure
JMS Threading Model
JMS Transactions
Review: JMS Architecture
Lab: JMS Architecture
JMS Clients
P2P vs. Pub/Sub in JMS Clients
JMS Client Object Usage
Lookup For Administered Objects
JNDI Lookup for P2P
JNDI Lookup for Pub/Sub
Message Transmission for Pub/Sub
Message Transmission for P2P
Session and Producer Creation
Message Creation/Transmission
Message Body Types
Text, Object and Bytes Messages
Stream and Map Messages
Stream/Map Type Conversion
Headers and Properties
JMS Header Values
Specifying Message Destination
Delivery, Priority and Expiration
Other JMS Headers
JMS Properties
Sending Multiple Messages
Sending to Multiple Destinations
JMS Client Transactions
Review: JMS Clients
Lab: JMS Clients
Message Driven EJBs
Message Driven EJBs
javax.ejb.MessageDrivenBean
MessageAdapter Utility Class
Structure: Message Driven EJB
Example Message Handling
Message Deployment Descriptor
Message Assembly Descriptor
Message Driven EJB Transactions
Message Driven EJB Lifecycle
Message Driven EJB Pooling
Specifying EJB Destination
Durable Subscriptions
Message Filters
EJBs as JMS Clients
JMS Resource References
Example: Reply Messages
Handling Reply in Original Sender
Review: Message Driven EJBs
Lab: Message Driven EJBs