Audience
This class is aimed at developers already familiar with Java Server-side programming looking to gain detailed knowledge of Enterprise JavaBeans (EJB3.0) development.
Prerequisites
Attendees should understand the basics of Java Enterprise programming.
Duration
3 days. Hands on.
This course is available on site only. Please call for details.
Course Objectives
The course looks at the various different types of beans and how they are utilised as well as how they work internally. This provides a good understanding of why EJB's are now being used over existing technologies. Security, Transaction Control, Passivation, Resource Pooling and Distributed Objects are also discussed.
On completing the course attendees will understand how to:
- Develop EJBs using a choice of IDEs.
- Develop Stateless and Stateful Session Beans.
- Develop Entity Beans with Bean Managed Persistence.
- Develop Entity Beans with CMP.
- Develop Relationships and EJB QL for CMP beans.
- Control Bean Security, Transaction Management and Passivation.
- Deploy and test EJBs and related components using an Application Server.
- Use a servlet session to store and re-access EJBs During the frequent practical sessions delegates will practice coding all types of EJBs as well as complete server side applications.
Course Content
Enterprise JavaBeans
Enterprise JavaBeans (EJBs) Overview.
Benefits of using EJBs.
JavaBean and Enterprise JavaBean Differences.
Multi Tier Applications.
Distributed Object Access, CORBA overview, RMI overview, RMI over IIOP.
EJB Environment and EJB Types.
Transaction Control, Session Beans, Entity Beans, Message-Driven Beans.
Session / Entity / Message-Driven Differences.
EJB in more detail.
EJB Anatomy, Containers, EJB Architecture, EJB Application Components.
Client Access.
Client View of an EJB, Java Naming and Directory Interface.
EJB Development Phases.
EJB Development Roles.
Session Beans
Overview.
Stateless Session Beans, Stateful Session Beans, Stateless or Stateful?
EJB Composition.
Life Cycles.
The Stateful Session Bean Life Cycle.
The Stateless Session Bean Life Cycle.
Session Bean Components.
Session Bean Methods, Developing the Session Bean.
Stateless Session Beans.
The Home Interface, The Remote Interface, Coding the EJB Object.
Stateful Session Beans.
The Home Interface, The Remote Interface, Stateful EJB Object.
Helper Classes.
Accessing Environment Entries.
Client Access
General Client Access.
Model / View / Controller Design.
EJB Environment, The EJB Client, Java Naming and Directory Interface.
Accessing Objects Remotely - RMI.
Invoking the Enterprise Java Bean.
Session Tracking Overview.
Using HTML and Servlets, Session Tracking API.
Session Creation and Lookup, Session Lifecycle.
Servlet EJB Access.
Saving and Restoring EJBs in a Servlet Session.
Comparing Stateful EJBs.
Passing a Session Bean's Object Reference.
Sessions Bean Deployment (RAD)
J2EE Perspective.
EJB Editor, EJB Extension Editor.
Creating EJBS.
Enterprise Applications, EJB Projects, Adding EJBs to the project.
Testing EJBS.
Generating Deployed Code, Generating a Server and Server Configuration.
Setting EJB server properties.
Testing the EJB using the test client.
Running a Test Client Application.
Testing in RAD.
EJB Local Interfaces and References
Setting up Local interfaces using RAD.
References and Local interfaces.
Defining References in RAD.
Using the local client API.
BMP Entity Beans
Overview.
Shared Access and Transaction Management.
The Entity Bean Life Cycle.
Entity Bean Components.
Coding a Bean Managed Persistence Bean.
Entity Bean Syntax, Related Methods.
Entity Bean Primary Keys, The Entity Bean Object.
The setEntityContext and unsetEntityContext Methods.
The ejbCreate and ejbPostCreate Methods.
The ejbFind Methods.
The ejbRemove Method.
The ejbLoad Method and ejbStore Methods.
The ejbActivate and ejbPassivate Methods.
Other Business Methods.
Entity Beans Client access.
Invoking the Entity Bean.
Comparing Entity Beans.
Passing an Entity Bean's Object Reference.
CMP Entity Beans
Why Use Container Managed Persistence?
Local Home and Local Interfaces.
Coding a Container Managed Persistence Bean.
Container Managed Persistence Bean Methods.
The Deployment Descriptor and CMP beans.
Mapping the Entity Bean to the Database.
The Top-Down Approach using RAD.
The Bottom-Up Approach using RAD.
The Meet-in-the-middle Approach using RAD.
CMP Relationships
A One-To-One CMR example.
A Many-To-One CMR example.
Setting up relationships using RAD.
CMP EJB Query Language
Using EJB QL in findBy...() methods.
Using EJB QL in ejbSelect...() methods.
Selecting on collection based CMR fields.
Entity Bean Deployment
Creating Entity EJBS.
Enterprise Applications, EJB Projects, Adding EJBs to the project.
Testing Entity EJBS.
Generating Deployed Code, Generating a Server and Server Configuration.
Setting EJB server properties.
Testing the EJB using the test client.
Running a Test Client Application.
Testing in RAD.
Database Access
The Data Perspective.
Database Connections.
Server Configuration.
DataSources, Java Naming and Directory Interface - JNDI.
Connection Pooling using DataSources.
Registering DataSources - The Persistent Name Server.
Coding Database Access.
Getting Database Connections via a DataSource.
Getting Database Connections using EJB Properties.
Using DataSources within Applications.
When to Connect.
Isolation Levels.
Setting Isolation Levels using RAD.
Transaction Control
Transactions.
Transaction Processing.
Container-Managed Transactions.
Transaction Attribute Values.
Transaction Attributes and Scope.
Setting Transaction Attributes using RAD.
Transaction Control.
Rolling Back a Container-Managed Transaction.
Bean-Managed Transactions.
Session Beans - Returning Without Committing.
Controlling the Transaction from a Servlet.
Transaction Guidelines for Applications.
Message Driven Beans
What is a Message Driven Bean?
Message Processing, When to use Message Driven Beans.
The Life Cycle of a Message Driven Bean.
Access to Message Driven Beans.
The Message Driven Bean Client.
The Message Driven Bean Class.
Coding Message Driven Beans.
Message Driven Bean Methods.
Exception Handling
Java Exceptions.
Unchecked and Checked Exceptions.
EJB Exceptions.
Application Exceptions.
System Exceptions.
Security
Security Overview.
Security Concepts.
Container Managed Security, Security Roles.
Security Setting in RAD.
Design Patterns
JavaBean Wrappers (or Access Beans).
Using a JavaBean Wrapper, Anatomy of a JavaBean Wrapper.
The MVC Architecture.
The Controller - Servlet.
The View - HTML Form Pages.
The View - JavaServer Pages.
Creating Access Beans using RAD.
WebSphere (if applicable)
WebSphere Application Server.
J2EE Application Components.
Enterprise Applications.
Enterprise Application Hierarchy, EAR Files.
Exporting EAR Files from WSAD, Web Projects.
Installing an Application in WebSphere.
RAD (if applicable).
RAD Application Server.
J2EE Application Components.
Enterprise Applications.
Enterprise Application Hierarchy, EAR Files.
Exporting EAR Files from RAD, Web Projects.
Installing an Application in RAD.
EJB Specifications
EJB 1.0.
EJB 1.1.
EJB 2.0.
EJB 3.0.