Академический Документы
Профессиональный Документы
Культура Документы
Session Beans
➙ Stateful session bean
➙ Stateless session bean
Entity Beans
➙ With container-managed persistence
➙ With bean-managed persistence
Message-Driven Beans
EJB Container
Client Corba
Application
JDBC
JMS
RMI
Mail
Java
JTA
Session Bean
Mail
Entity Bean
Mohammed Habeeb Vulla,Lecturer in dept computers
Roles in EJB
Development
EJB provider - a person who develops
EJB Components
EJB Deployer - a person responsible for
deploying EJB’s in EJB server
Application Server/ EJB Container Vendor
- one who provides application server on
which the application is deployed
EJB Application
Deployer
Provider Assembler
App Server/
EJB Container
Provider
System
Administrator
EJB Container/Application
Server
Enterprise JavaBean
Client
RMI Container
Client Network RMI
Stub generated EJB
Stub class
Interposition class
Mohammed Habeeb Vulla,Lecturer in dept computers
Interposition : from EJB
Container to EJBs
The container will examine the security credentials of
the caller of the method
It will start or join with any required transactions
It will make any necessary calls to persistence functions
It will trigger various callbacks to allow the EJB
Component to acquire resources
Only after all this is done will the actual business
method be called
Once it is called, the container will do some more work
with transactions, persistence, callbacks and returns
data or exception to the remote client
Package orderMgmt;
import java.util.properties;
import java.naming.Context; // for name-to-object findings
import java.naming.InitialContext;// context for naming operations
public class Client {
try {
Properties prop = new Properties();
// server dependent properties for InitialContext
prop.put(Context.INITIAL_CONTEXT_FACTORY,
“org.jnp.interfaces.NamingContextFactory”);
prop.put(Context.PROVIDER_URL, “localhost:1099”);
Context ctx = new InitialContext(prop);
Object objref = ctx.lookup(“OrderManagement”);
META -INF\
ejb-jar.xml
orderMgmt\
OrderManagement.class
OrderManagementHome.class
OrderManagementBean.class
Model
4
2
view1.jsp
3 Main.jsp
view2.jsp
view3.jsp Controller
Views 5
Browser 1
Client
Mohammed Habeeb Vulla,Lecturer in dept computers
Design of the EJB Tier
Create a Product
Place an Order
Cancel an Order
Select an Order for Manufacture
Build a Product
Ship an Order
List Overdue Orders
Place Order
Customer
Cancel Order
Operator
Select Order
Manager
Build Product
Crew
Ship an Order
M’ment Overdue Orders
Mohammed Habeeb Vulla,Lecturer in dept computers
Stereotype icons in UML
Interface Object :
Entity Object :
Control Object :
Customer
Web App
Manage-
Web App
-ment
Mohammed Habeeb Vulla,Lecturer in dept computers
View of interaction of
interface
and control objects
VB Create
App
Web
App Place
Swing
App Cancel
Web
App Select
Palm Build
App Product
Web Ship List
App order Overdue
Mohammed Habeeb Vulla,Lecturer in dept computers
View of interaction between
control objects and entity
objects
Create
Product Product Routing
Place Order
Order
Cancel
Order Shipment
Select for Account
Manufacture
Build
Product Supplier
Ship Shipping
Order Company
List
Overdue Customer
Mohammed Habeeb Vulla,Lecturer in dept computers
Summary
EJBs are intended for transactional systems
EJBs are portable, reusable server-side
components that execute in a container
Assist developer productivity, extend application
capability, and improve system stability
Are accessible from many different types of clients
There are three types of beans : stateful session,
stateless session, and entity