Академический Документы
Профессиональный Документы
Культура Документы
Enterprise JavaBeans
z EJB Container / Application server
– Manages beans
– Provides middleware services
z Part of J2EE, standard from Sun
Jens Gustavsson z Implementation by independent tool vendors
– IBM, Oracle, BEA, Borland, …
– Open source: JBoss (www.jboss.org)
1
Clients Distributed Objects
Client
Java
application
EJB EJB
Network
HTML- Servlet
client or JSP EJB EJB
Database
Web server EJB Container Distributed
Remote object
interface
2
Distributed Objects Enterprise JavaBeans
Request EJB
Network Interceptor Network Bean
Remote Object
interface
Distributed
Skeleton Skeleton
Remote object
interface EJB Container
EJB EJB
Network Object Network Bean
Remote Object
interface
EJB
Skeleton Bean Skeleton Home
Remote
interface EJB Container
3
EJB Architecture Deployment
4
EJB Architecture So, what does the container do?
5
XDoclet Local interfaces
z Remote interface, home interface, local z When beans calls beans locally
interface, local home interface, primary key z Optimization
class, deployment descriptor, vendor specific z Calls by value/reference problem
files
z Specification in comments in Bean class
6
Façade design pattern for EJB
Demonstration
Session Entity
Bean Bean
Entity En entity bean
Bean
Session
Bean Entity
Bean
EJB Container
7
Point-to-Point Why Message-Driven Beans?
z Performance
z Reliability
z Support for multiple senders and receivers
z Easy integration to legacy systems
Queue
z Is it object-oriented?
– Separation of data and operations (entity beans
and session beans)
– No inheritance between beans
Topic
z Suitable for which tasks?
– One architecture. Anomalies if trying to do
anything else
z Component marketplace?
– Not today!
8
Resources
z Szyperski, chapter 14
z Sun EJB tutorial
http://java.sun.com/j2ee/learning/tutorial/index.html