Download presentation
Presentation is loading. Please wait.
Published byBryan Lawson Modified over 9 years ago
1
Enterprise JavaBeans
2
Lesson 1: Introduction to Server-Side Component Software
3
Objectives Define client-server and multi-tier architecture Discuss the benefits and issues of distributed architectures Define software components Discuss server-side component architecture and architecture solutions Define J2EE technologies Define EJB technology
4
Client-Server and Multi-Tiered Architectures Scalability Extensibility Security Issues concerning distributed architectures - Complexity - Communication/bandwidth - Maintenance costs
5
Centralized Mainframe Architecture
6
Two-Tier Architecture
7
Three-Tier Architecture
8
Software Components Component architectures - Component development tools - Container - Maintenance deployment tools
9
Component Architecture Solutions .NET Enterprise Architecture CORBA J2EE
10
J2EE Technologies EJB RMI/RMI-IIOP JNDI JDBC JTA/JTS JMS JSP IDL JavaMail Connectors XML
11
Enterprise JavaBeans Differences between JavaBeans and Enterprise JavaBeans EJB development tasks - J2EE product provider - Bean developer - Application assembler - Deployer - System administrator - Tool provider
12
Summary Define client-server and multi-tier architecture Discuss the benefits and issues of distributed architectures Define software components Discuss server-side component architecture and architecture solutions Define J2EE technologies Define EJB technology
13
Lesson 2: Overview of the Enterprise JavaBeans Framework
14
Objectives Define an EJB server’s main components Discuss EJB and client interaction Identify EJB container services Describe home objects and EJB objects Compare session beans and entity beans Define a deployment descriptor Identify the EJB JAR file
15
EJB Architecture Primary components - EJB-compliant server - EJB-compliant container - Home object (bean factory) - EJB object (remote interface) - EJB
16
Example of EJB Architecture
17
Client Interaction with EJBs
18
EJB Container Services Distributed transaction management Persistence Security Component resource and life cycle management Remote accessibility Transparent location of components Identification of components
19
The EJB Home Object Location transparency
20
The EJB Object Stubs Skeletons
21
Types of Enterprise JavaBeans Session beans - Stateful - Stateless Entity beans
22
Deployment Descriptors An XML document that describes the properties of an EJB
23
The EJB-JAR File Contains the class files for a bean, its home and remote interfaces, and the deployment descriptors
24
Summary Define an EJB server’s main components Discuss EJB and client interaction Identify EJB container services Describe home objects and EJB objects Compare session beans and entity beans Define a deployment descriptor Identify the EJB JAR file
25
Lesson 3: Creating a Session Bean
26
Objectives Define the methods of the SessionBean interface Describe the EJBContext and the SessionContext interfaces Contrast stateful and stateless session beans Explain how to write business methods for a session bean Discuss the EJB life cycle
27
Objectives (cont’d) Create a session bean Define the EJBHome and EJBObjects interfaces and their methods Discuss the superclass for the home and remote interfaces Describe system and application exceptions Deploy and connect to a session bean
28
Creating the Enterprise Bean Class ejbCreate methods The SessionBean interface The EJBContext interface The SessionContext interface
29
Stateless and Stateful Session Beans Stateless session beans - Do not keep track of any information from one method call to the next Stateful session beans - Can change their state during a conversation with a client
30
Writing Business Methods for an EJB Each EJB must declare the business methods that define the work that the EJB is designed to perform
31
The Home Interface Extends EJBHome Provides mechanisms to create and remove EJB components
32
The EJB Object Extends the EJBObject interface
33
Exceptions in EJB System exceptions Application exceptions
34
Example: A Session Bean The Teller bean class The Teller remote interface The Teller home interface
35
The Library Application The Book entity bean The Patron entity bean The CheckOutRecord entity bean The CheckOut session bean The CheckIn session bean
36
LibraryDB Schema
37
Summary Define the methods of the SessionBean interface Describe the EJBContext and the SessionContext interfaces Contrast stateful and stateless session beans Explain how to write business methods for a session bean Discuss the EJB life cycle
38
Summary (cont’d) Create a session bean Define the EJBHome and EJBObjects interfaces and their methods Discuss the superclass for the home and remote interfaces Describe system and application exceptions Deploy and connect to a session bean
39
Lesson 4: EJB Deployment
40
Objectives Define a deployment descriptor Add environment data to a DD Describe how to reference resource factories in a DD Explain assembly information in a DD Use JNDI to access an EJB’s environment data Describe the process of EJB deployment
41
The Deployment Descriptor EJB requirements DD XML tags
42
Environment Data Environment property XML tags Accessing environment data
43
Using JNDI
44
Using Bean References EJB reference XML tags Using the EJB reference
45
Using Resource Factories
46
EJB Deployment in an EJB Server Deploying an application Creating stub and skeleton classes
47
Summary Define a deployment descriptor Add environment data to a DD Describe how to reference resource factories in a DD Explain assembly information in a DD Use JNDI to access an EJB’s environment data Describe the process of EJB deployment
48
Lesson 5: EJB Clients
49
Objectives Use JNDI to obtain a reference to the home object Instantiate an EJB instance using the home object Call an EJB’s business methods Remove an EJB Write an EJB client
50
Using JNDI JDNI is an API - Used to access naming and directory services - Provides an interface to the RMI registry JNDI InitialContext Locating the home object
51
Creating an EJB Instance Invocation of business methods
52
Summary Use JNDI to obtain a reference to the home object Instantiate an EJB instance using the home object Call an EJB’s business methods Remove an EJB Write an EJB client
53
Lesson 6: Entity EJBs
54
Objectives Discuss entity beans and their persistence management techniques Identify the methods of the EntityBean and EntityContext interfaces Define primary keys and describe their use Describe the mechanics of entity beans Use finder methods Write an entity bean and its interfaces
55
What Is an Entity Bean? Object serialization Object-relational mapping Bean-managed persistence Container-managed persistence Primary keys
56
Entity Bean Architecture Creating entity beans Invoking business methods on entity beans Swapping entity beans Invoking remove() on an entity bean
57
Life Cycle of an Entity Bean Instance
58
Bean-Managed Persistence BMP - SQL - JDBC
59
Entity Bean Methods ejbCreate() ejbPostCreate() ejbRemove() ejbLoad() ejbStore()
60
Using Finder Methods ejbFindByPrimaryKey() Multiple row finders
61
The Remote Interface and the Home Interface Remote interface - Provides the interface for the client - Exposes methods for manipulating the entity bean Home interface - Contains the create() and find…() methods for an entity bean
62
Summary Discuss entity beans and their persistence management techniques Identify the methods of the EntityBean and EntityContext interfaces Define primary keys and describe their use Describe the mechanics of entity beans Use finder methods Write an entity bean and its interfaces
63
Lesson 7: Container-Managed Persistence
64
Objectives Discuss entity beans and CMP Explain the benefits and disadvantages of using CMP Describe the primary key as it relates to CMP Define an ejbCreate() method that uses CMP Write the requisite methods for an entity bean to use CMP
65
Container-Managed Persistence Benefits of CMP - Less code needed - Optimization techniques - More portable - Fewer bugs Disadvantages of CMP - Less flexibility - Inaccessible code
66
The Primary Key Primary key class - Must be serializable - Must be of a legal value type in RMI-IIOP
67
EJB Methods and CMP ejbCreate() ejbRemove() ejbLoad() ejbStore() Other methods Finder methods
68
The DD and CMP Example: A CMP entity bean - The EmployeeEJB bean class - The home interface - The remote interface
69
Summary Discuss entity beans and CMP Explain the benefits and disadvantages of using CMP Describe the primary key as it relates to CMP Define an ejbCreate() method that uses CMP Write the requisite methods for an entity bean to use CMP
70
Lesson 8: Transactions
71
Objectives Define transactions and explain their use Distinguish transaction participants Define transaction properties Explain the EJB transactional model Describe distributed transactions Define transaction isolation levels Discuss EJB transaction attributes
72
What Are Transactions? Operations or series of operations that are treated as single units of work Transactional management
73
Participants in Transactions Transactional objects or applications Transaction managers Resources Resource managers
74
EJB Transactional Model Flat transactional model Nested transactional model
75
Flat Transactional Model
76
Nested Transactional Model
77
Distributed Transactions Two-phase commits Transparent transaction control - Transaction context
78
Isolation Levels Strict - Each concurrent transaction is isolated from all other transactions Nonstrict - Increased transactional performance - Possibility of corrupted data
79
Transactions in Enterprise JavaBeans Transaction demarcation Container-managed transactions - Attributes Defining CMT in the DD Setting CMT in Deploytool
80
Bean-Managed Transactions UserTransaction interface - Properties - Methods Setting BMT in the DD BMT and stateful session beans BMT and stateless session beans
81
Summary Define transactions and explain their use Distinguish transaction participants Define transaction properties Explain the EJB transactional model Describe distributed transactions Define transaction isolation levels Discuss EJB transaction attributes
82
Lesson 9: EJB Security
83
Objectives Define users in EJB security Discuss principals in EJB security Identify roles in EJB security Describe the DD’s role in EJB security Explain the EJB container’s role in EJB security
84
Defining Users, Principals and Roles Overview of EJB security - Authentication - Authorization Authorization in EJB code
85
Example: Users, Principals and Roles
86
Security and the DD The bean developer and the DD The application assembler and the DD The deployer and the DD
87
Summary Define users in EJB security Discuss principals in EJB security Identify roles in EJB security Describe the DD’s role in EJB security Explain the EJB container’s role in EJB security
88
Enterprise JavaBeans Introduction to Server-Side Component Software Overview of the Enterprise JavaBeans Framework Creating a Session Bean EJB Deployment EJB Clients
89
Enterprise JavaBeans Entity EJBs Container-Managed Persistence Transactions EJB Security
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.