Upload
phanleson
View
748
Download
0
Embed Size (px)
DESCRIPTION
Citation preview
ACCP2005/EJB 2.0/Session 2/1 of 25
Architectural Overview of EJB
Session 2
ACCP 2005/EJB 2.0/Session 2/2 of 25
Session Objectives
Explain the stages in Business Development Recognize the parties involved in the deployment
of Enterprise JavaBeans Define Enterprise JavaBeans Explain the classification of Enterprise JavaBeans Discuss the two types of session beans and entity
beans Explain the responsibility of the EJB Server and
Container
ACCP 2005/EJB 2.0/Session 2/3 of 25
Review of Session 1
In session 1, we did the following: Discussed Component Architecture Described Distributed Object Architecture Discussed RMI Explained RMI-IIOP Discussed the Java Naming and Directory
Interface
ACCP 2005/EJB 2.0/Session 2/4 of 25
Stages in Developing Business Solutions
Grouping of resuable modulesby vendors
Running of these EJB components on multi-tier applications
Combining the components into a workflow
Deploying the whole system over multiple systems across the network
Application Servers are provided by middleware vendors. These servers are needed to run the components
ACCP 2005/EJB 2.0/Session 2/5 of 25
Parties Involved in EJB Deployment
Bean Provider
Parties in EJBDeployment
Container Provider The Deployer
Server ProviderApplication Assembler
System Administrator
Provides reusable components
Provides low-level execution environment
Supplies Application server logic
Puts together components and applications
Deploys prewritten components
Monitors functioning
EJBCont/
Server
ACCP 2005/EJB 2.0/Session 2/6 of 25
Logical EJB Architecture
Client
HomeInterface
Remote Interface
EJB
ServerHome Object
EJB Object
JDBCDatabase
ACCP 2005/EJB 2.0/Session 2/7 of 25
The EJB Container
THE SERVER
THE EJB CONTAINER
THE CLIENTOutside World
The container which resides insides the server acts as a BUFFER between the the beans and the outside world.
Connects clients to the Beans
Managing Life-cycle of a Bean
ACCP 2005/EJB 2.0/Session 2/8 of 25
The EJB Server
Server
Container 1 Container 2
Client
Process and Thread Management
Responsibilities
System Resource Management
Database Connection
ACCP 2005/EJB 2.0/Session 2/9 of 25
The Application Assembler and EJB Deployer
Assembled application
EJB Deployer
Operational Environments
Application
Assembler
Server Side
Client Side
ACCP 2005/EJB 2.0/Session 2/10 of 25
Services provided by the Container and Server
Container/Server
Transaction supportSupport for management
of multiple instances
Persistence supportSecurity Support
ACCP 2005/EJB 2.0/Session 2/11 of 25
Security Support
EJB The Access Control List
Functionality 1
Functionality 2
Functionality 3The ACL comprises the list of persons who are allowed to access particular sections of functionality.
ACCP 2005/EJB 2.0/Session 2/12 of 25
Persistent Support
Persistence can be defined as saving the state of an object to a constant storage.
The state of the object is maintained
in this constant storage
ACCP 2005/EJB 2.0/Session 2/13 of 25
Support for Management of Multiple Instances
InstancePassivation
Instance pooling
In order to perform timely servicing to the client the container performs a variety of tasks.
Server Tasks
Database connection pooling
ACCP 2005/EJB 2.0/Session 2/14 of 25
Enterprise Beans
The Enterprise Java Bean is a server-side component that is employed on a distributed multi-tier environment.
Enterprise Bean
Session Bean Entity Bean
Stateful Bean
Stateless Bean BMP CMP
Message Driven Beans
ACCP 2005/EJB 2.0/Session 2/15 of 25
Features of an EJB Container
Resource Managementand Life Cycle
Management of a Bean
Features
State Management
Transactions Security
Persistence
Remote Accessibility and location transparency
ACCP 2005/EJB 2.0/Session 2/16 of 25
Resource Management and Life Cycle of a bean Management of resources enhances the
scalability of a multi-tier architecture. The container provides resource-
management services for resources such as: Threads Socket Connections Database Connections
ACCP 2005/EJB 2.0/Session 2/17 of 25
State Management
Fills up
Applicationin a sitePage 1
Submits the form Applicationin a sitePage 2
User takes timeas he reads the contents in the page
Client
Container is used for another process while user takes time
to read
ACCP 2005/EJB 2.0/Session 2/18 of 25
Transactions
Operation2
Operation1
Operation3
Executed as one unit of work
Multiple usersuse the same data
ACCP 2005/EJB 2.0/Session 2/19 of 25
Transactions-Two phase commit protocol
Transaction Coordinator
Database 1
Database 3
Database 2
Prepare Phase
Prepare message
Commit Phase
Commit/Rollback Transaction Request
All databases issue commit request
Commit/Rollback Transaction Request
Records results of transaction
ACCP 2005/EJB 2.0/Session 2/20 of 25
Remote Accessibility
Bean Bean Bean
Deployed across multiple tiers
Bean Bean Bean
Networked after deployment
Not-Networked
ACCP 2005/EJB 2.0/Session 2/21 of 25
Location Transparency
Component
Component
Clients do not know where the components are, and whether these components are local or remote
ACCP 2005/EJB 2.0/Session 2/22 of 25
Specialized Containers
Integration to mainframe systems Stateful recovery Distributed transactions Database persistence services that are complex Integrated XML services Dynamic redeployment of components in a
system that is running
ACCP 2005/EJB 2.0/Session 2/23 of 25
Summary - 1
Four stages are followed while developing business solutions:
* Vendor grouping of product into modules * Running of the EJB component on multi-tier applications * Combining the component into a workflow, and integrating
the business logic * Deploying and distributing the system over multiple systems
across the network. Six parties involved while deploying Enterprise
JavaBeans: * The Bean provider * The Container provider * The Server provider * The Application Assembler * The Deployer * The System Administrator
ACCP 2005/EJB 2.0/Session 2/24 of 25
Summary - 2 Logical three-tier architecture of EJB:
The Client The EJB Server The Database
The EJB Container resides inside the EJB server. The container acts as a buffer between the bean and the outside world.
The main responsibilities of the container are: * Connecting clients to the beans
* Managing the life cycle of the bean The server provides the container with
network connectivity.
ACCP 2005/EJB 2.0/Session 2/25 of 25
Summary - 3
The server and the container provide following
services to the developer * Transaction support
* Security support
* Persistence support
* Support for management of multiple instances .
An Enterprise Java Bean can be classified into:
* Session Beans
* Entity Beans
* Message-Driven Beans