Professional Documents
Culture Documents
Enterprise Java Beans
Enterprise Java Beans
CS-422
Application Servers
• In the late 1980s and though the mid 1990s a number of corporations
(Broadvision, Netscape…) marketed a class of server products to
enable the creation of highly scaleable applications.
– Used proprietary interfaces to OLTP (On-line Transaction Processing)
tools like BEA Tuxedo and IBM TXSeries
• APIs are are not standardized
• Applications developed on one application server were not portable to
another application server
– every application ended up being custom written
• once one vendor‘s application server was installed, you were stuck with it and
at the mercy of that vendor
• vendor’s did a good job of convincing you how easy it was to use their product
but were really trying to sell customization and consulting services
WORA
• Java’s “Write Once, Run Anywhere” philosophy allows Java
applications to be written once and then run anywhere there is a JVM
• Java 2 Enterprise Edition (J2EE) allows WORA to be applied to
application server technology and server-side components to provide
an application server that will allow application portability
• Java 2 APIs are platform independent and vendor neutral
– each API provides a common programming interface to a generic type of
infrastructure service
– Java 2 APIs have the goal of extending Microsoft’s ODBC philosophy a
step further to include all infrastructure services
J2EE Industry Acceptance
• To be successful J2EE must have wide industry acceptance
– APIs would be useless if infrastructure vendors don’t implement support
for the J2EE APIs
– Sun made alliances with many Industry leaders to insure the success of
J2EE
• Transaction Management
– IBM, Compaq/Tandem, BEA Systems
• Persistence Management
– Oracle, Sybase, Informix
• Directory Services
– HP, Netscape, IBM
J2EE APIs
• Enterprise Java Bean (EJB) API
• Java Naming and Directory Interface (JNDI)
• Remote Method Invocation/Internet Inter-ORB Protocol
• Java IDL
• Servlets and JSP
• Java Messaging Service (JMS)
• Java Transaction Service JTS)
• Java Transaction API (JTA)
• Java Database Connectivity (JDBC)
EJB API
• The EJB API defines a server component model
– provides portability across application servers
– implements automatic services on behalf of the application components
JNDI API
• Provides access to naming and directory services
– DNS, NDS, NIS+, LDAP, COS
• used to look up interfaces used to create EJBs, JDBC connections and
other things
RMI/IIOP
• Allows the creation of remote interfaces for distributed computing
– default protocol (JRMP, Java Remote Method Protocol) is proprietary,
based on Java’s serialization APIs
– RMI-IIOP a JDK 1.3 extension of RMI that allows the use of IIOP
(Internet Inter ORB Protocol) for RMI communication. J2EE Spec
requires this as the standard protocol for communications between the
different tiers of the J2EE architecture.
Java IDL
• Creates remote interfaces to support CORBA communications in the
Java platform
– includes IDL compiler and a lightweight ORB
• allows the integration of non-Java based components
Servlets and JSP
• Used for creation of thin client interfaces for the presentation of
information and collection of user inputs
• Support the dynamic HTML generation and session management for
browser based clients
JMS
• Used for asynchronous communication between distributed objects
• Supports asynchronous communications through various messaging
systems, such as reliable queueing and publish-and-subscribe services
•
JTA
• Provides a transaction demarcation API
• provides the infrastructure for transaction management
– open, committ, roll back
– if the transaction spans multiple beans deployed on the same server or on
widely dispersed servers, the server vendor is responsible for proper
implementation od transaction control
– transactions spanning multiple servers require the propigation of
transaction context between servers over IIOP
JTS API
• Defines a distributed transaction management service based on
CORBA’s Object Transaction Service
JDBC
• Provides uniform access to relational databases such as DB2, Oracle,
SQL Server and Sybase
• Provides provides interfaces to RDBMs both for data definition and
query/insert/update/delete
Application Client
Container
App.Client
Databases and
Other Resources
The EJB Container
• An EJB server must provide one or more EJB containers which
provide homes for the enterprise beans
• The EJB container manages the beans housed in it
– responsible of registering the bean
– providing a remote interface for it
– creating and destroying object instances
– checking security
– coordinate distributed trancactions
– can optionally manage persistent data within the object
• any number of EJB claees can be installed in a particular conrainer but
each class can only be assigned to a particular container
EJB Container
The EJB Object interface intercepts all method calls
and implements transactions, state management,
persistence,and security services for the bean based
on deployment descriptor settings
Deployment
EJB Object
Descriptor
(Client view)
Client
Enterprise Bean
EJB Home
(bean identifier)
Environment