Enterprise Java Bean Technology Briefing - PowerPoint PPT Presentation

1 / 40
About This Presentation
Title:

Enterprise Java Bean Technology Briefing

Description:

Java. Client. Browser. Client. Mobile. Client. Cart. CartHome. CartBean. JNDI. CartHome cartHome ... Enables non-Java clients to access EJB's. ... – PowerPoint PPT presentation

Number of Views:47
Avg rating:3.0/5.0
Slides: 41
Provided by: peterm115
Category:

less

Transcript and Presenter's Notes

Title: Enterprise Java Bean Technology Briefing


1
Enterprise Java Bean Technology Briefing Markus
Hebach
2
Agenda
  • The Need for a Server Side Component Model
  • EJB 1.0 Architecture Overview
  • Where does CORBA fit in?
  • The Inprise EJB Solution - Kodiak

3
The Need for a Server Side Component Model
4
Developing a Distributed Object
Business Logic
5
Business Logic Developer
P/E Ratio
Net Present Value

After Tax Operating Cash Flow
Holding Period Returns
CF (R - O)(1 - T) Dep(T) - NWC
6
System Developer
Distributed Transactions

Persistence
Authentication
Concurrency
Authorization
7
Productive Distributed Developer???
Distributed TXs
Security
Data Access
Business Logic
Legacy Integration
Authorization
8
EJB Acknowledges Roles
Bean Provider
Deployer
Sys Admin
Assembler
Logic Developer No Transaction Code No
Concurrency Code No Security Code No Distribution
of Beans
System Manager Keeps System Operational Typicall
y a good card player
Deployment to Operational Environment Defines
Security Roles Defines Transactions A Systems
Expert
Composes Applications Generally Understands
Logic Expert at Apps, Applets Servlets
etc.. Usually builds GUI
9
The EJB Development Flow
10
EJB Architecture Roles
Client App
EJB
EJB Server
Container
EJB
11
EJB Architecture Overview
12
Enterprise Java Beans
The Enterprise Java Beans Architecture is a
component architecture for the development and
deployment of object oriented distributed
enterprise-level applications.
- Sun Microsystems EJB 1.0 Specification March
1998
13
Responsibilities of the Container
  • Proper creation, initialization, and removal of
    beans
  • Ensuring that methods run in the proper
    transaction context
  • Visibility of the home object in a
    JNDI-accessible namespace
  • Swapping to and from secondary storage (for
    session beans)
  • Persistence management (for container managed
    entity beans)
  • Availability of a home object implementing
    creation and lookup services
  • Implementation of certain basic security services

14
Identifying an EJB
EJB Home
EJB Remote
Bean Instance
Deployment Descriptor
15
Bean Architecture
EJB Home
Bean Instance
Container
Remote Interface
16
EJB Home
The Home Interface contains the signatures of the
creation methods for the given bean. Each Create
method must have a corresponding ejbCreate method
in the bean. Remember - Only the container can
actually create the instances!
public interface myHome extends EJBHome
public myObject create() throws RemoteException
public myObject create(String str) throws
RemoteException
17
EJB Remote
In a similar fashion, the developer must create
a Remote Interface which describes the business
methods (signatures) of the bean that the
developer would like the client to have access to.
public interface Account extends
javax.ejb.EJBObject public void
deposit(double amount) throws RemoteException
public void withdraw(double amount)throws
RemoteException public double balance() throws
RemoteException
18
EJB Object
The methods in your bean will NEVER be invoked
directly from the client. The client calls the
beans methods indirectly through the EJBObject,
which acts as a proxy.
public interface javax.ejb.EJBObject extends
java.rmi.Remote public EJBHome getEJBHome()
throws RemoteException public Object
getPrimaryKey() throws RemoteException public
Handle getHandle() throws RemoteException
public void remove() throws RemoteException,
public boolean isIdentical(EJBObject other)
throws RemoteException
19
Bean Types
  • Session Beans (Required for EJB 1.0)
  • Entity Beans (Optional for EJB 1.0)

Types differentiated by Interface implemented
and by the type declaration in the deployment
descriptor.
20
Bean Types
  • Session Beans
  • Execute on behalf of single client
  • Can be transaction aware
  • Does not represent directly shared data in a
    database
  • Are relatively short lived
  • Are removed when the EJB server crashes

21
Bean Types
  • Entity Beans
  • Represents data in a database
  • Are transactional
  • Allows shared access by multiple users
  • Survives crash of EJB server

22
Session Bean Types
Stateless Session The bean does not contain
conversational state between method invocations -
as a consequence any session bean instance can be
used for any client. Stateless beans are
designed to be pooled.
23
Session Bean Types
Stateful Session The bean contains
conversational state which is kept across method
invocations and transactions. Once a client has
obtained a specific session bean it must use this
instance for the life of the session.
24
Clients View of Session Bean
EJB Server
EJB Container
cart.addItem(66)
cart.addItem(22)
cart.purchase()
cart.remove()
Cart
CartBean
CartHome cartHome javax.rmi.Portable
RemoteObject.narrow( initialContext.lookup(...)
, CartHome.class)
CartHome
Cart cart cartHome.create()
JNDI
25
Entity Bean Types
Bean Managed Persistence The entity bean
implementation is responsible for implementing
persistence. The bean provider writes the code
to access the underlying database or application.
These calls are placed in the methods
ejbCreate(), ejbFind(), ejbRemove(), ejbLoad()
and ejbStore().
26
Entity Bean Types
Container Managed Persistence The container is
responsible for implementing the persistence.
Instead of the bean provider implementing the
database access code, the container is
responsible for generating the appropriate code
and its execution. The fields of the entity
bean, which are managed by the container are
specified in the deployment descriptor.
27
Session Bean Interacting with Entity Bean
EJB Server
EJB Container
order.findByPrimaryKey(orderNo)
Cart
CartBean
OrderHome
ejbLoad()
ejbStore()
Order
placeOrder()
OrderBean
orderComplete()
SQL
JNDI
DB
28
The Session Bean Interface
  • package javax.ejb
  • public interface SessionBean extends
    EnterpriseBean
  • void setSessionContext(SessionContext s)
    throws RemoteException
  • void ejbRemove() throws RemoteException
  • void ejbActivate() throws RemoteException
  • void ejbPassivate() throws RemoteException

29
The Entity Bean Interface
  • package javax.ejb
  • public interface EntityBean extends
    EnterpriseBean
  • void setEntityContext(EntityContext e) throws
    RemoteException
  • void unsetEntityContext() throws
    RemoteException
  • void ejbRemove() throws RemoteException
  • void ejbActivate() throws RemoteException
  • void ejbPassivate() throws RemoteException
  • void ejbLoad() throws RemoteException
  • void ejbStore() throws RemoteException

30
Holes in the EJB 1.0 Specification
  • No definition of Interoperability between
    containers.
  • Does not prescribe which RMI implementation
    should be used.
  • No definition for propagating Transaction
    Contexts
  • No recommendations for bridging security domains
  • No standard Container API

31
Where does CORBA fit in?
32
The role of CORBA in EJB
The Enterprise Java Beans Architecture will be
compatible with CORBA.
- EJB 1.0 Specification Section 2.1 Overall Goals
33
EJB 1.0 Section 4.4 Standard CORBA Mapping
To ensure interoperability for multi-vendor
environments, we define a standard mapping of the
Enterprise JavaBean clients view contract to
CORBA. The mapping to CORBA covers 1. Mapping
of the EJB Client interfaces to CORBA IDL 2.
Propagation of transaction context 3.
Propagation of security context
34
Results of the CORBA Mapping
  • On the wire interoperability between EJB Servers
    from multiple vendors.
  • Enables non-Java clients to access EJBs.
  • CORBA Object Services allow security and
    transactions to be handled in a distributed
    vendor independent manner.

35
Open implementation choices
  • RMI/IIOP
  • JNDI over COSNaming and/or LDAP
  • JTS/COSTransactions and IIOP
  • X.509 certificates/IIOP over SSL

36
The Inprise EJB Solution Kodiak
37
Inprise EJB Infrastructure
Language Independent Client
ATM Session Bean
RMI/ IIOP
JNDI Naming
Container
Acct Entity Bean
JTS 2 Phase Commit
Java DB
Database
38
Inprise EJB Server Operation Modes
  • Development Mode
  • All services will run together in a single
    process
  • JNDI/Lightweight Naming Service
  • Lightweight JTS Implementation
  • All Java Database for Container Managed
    Persistence
  • Operations Mode
  • Fully Distributed Service
  • JNDI/COSNaming
  • ITS/COSTransaction implementation

39
A Fully Distributed EJB Solution
Distributed Transactions Distributed Security
Domains Language Interoperability
40
EJB Server Competitors
  • BEA WebLogic Tengah
  • Bluestone Sapphire/Web
  • GemStone GemStone/J
  • IBM WebSphere Advanced Edition
  • Novera jBusiness
  • Oracle8i
  • Oracle Application Server
  • Persistence PowerTier
  • Progress Apptivity

41
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com