Upload
aamir97
View
594
Download
3
Tags:
Embed Size (px)
Citation preview
1
Java 2 Enterprise Edition(J2EE)
Presented By: Mohamed Mansour
2
Notes
• WebSphere lab– Thursday (3/17) 3:00-5:00 PM– Room 153 CCB– www.cc.gatech.edu/~mansour/6210.html
• Extra credit project– Due Friday, April 1, at midnight– Contact mansour@cc for details
3
Outline
• Introduction & Motivation
• Enterprise Applications
• J2EE Architecture
• Server Side Components
• Q&A
4
Enterprise Applications
• Inter-company integration
• Intra-company integration
• Legacy applications
5
Enterprise ApplicationsEnd-User View
eBay.com
hotmail.com
my.SAP.com
6
Enterprise ApplicationsIntra-Enterprise
7
Enterprise ApplicationsInter-Enterprise
8
Challenges
• Interoperability
• Interface Complexity
• System Evolution
• Scalability
• Reliability
• Cost
9
Current Solutions
• Hide complexity in standard application server architectures– .NET, J2EE, other…
• Technology independent interfaces– XML and Web Services
10
J2EE Architecture
11
Request Dispatcher
Large Scale Deployment
12
Multi-Application Hosting
J2EE Server
App B
App C
App D
App A
App A
• Multiple applications on same server
• Statistical multiplexing over different request types
• Can we provide performance isolation guarantees between different applications?
13
J2EE ServerJ2EE Server
App B
App C
App D
App A
App AApp C
App B
Request Dispatcher
Multi-Application Hosting
14
EJB Container Services
• Persistence
• Transactions
• Caching
• Clustering
• Security
15
EJB Types
• Entity Beans– Persistent objects with primary keys– Container Managed Persistence (CMP)– Bean Managed Persistence (BMP)
• Session Beans– Stateless– Stateful
• Message Driven Beans (MDB)
16
EJBObject
Interface
RMI-IIOP
JVM 1 JVM 2
Calling Methods on EJBs
ClientServer
17
EJB
JVM 1 JVM 2
Calling Methods on EJBs
ClientServer
JNDI
Home“ejbs/ejb/MyEjbHome”
1. Lookup the home interface
18
EJB
JVM 1 JVM 2
Calling Methods on EJBs contd
ClientServer
JNDI
2. Use Home interface to obtain object interfacefrom server
Home
Home“ejbs/ejb/MyEjbHome”
19
EJB
JVM 1 JVM 2
Calling Methods on EJBs contd
ClientServer
JNDI
3. Use object interface to invoke server methods
Home
Home“ejbs/ejb/MyEjbHome”
Object Interface
20
Code SampleInitialContext ic = new InitialContext();
MyBeanHome home = (MyBeanHome) ic.lookup("java:comp/env/ejb/MyBeanHome")
MyBean b = (MyBean) home.create();
b.foobar();
21
EJB
Home
Object Interface
Local View
HomeObject
Interface
Remote View
Direct calls
RMI-IIOP
JVM 1
JVM 2Local Interfaces in J2EE 2.0
Server
Client
22
EJB ref name: “myEjbRef”JNDI name: “ejbs/ejb/MyEjbHome”EJB
JVM 1 JVM 2
EJB References
ClientServer
JNDI
Home“ejbs/ejb/MyEjbHome”
ic.lookup(“myEjbRef”)
XML configuration file
23
Using Remote Interfaces
Entity Bean
Entity Bean
Entity Bean
Entity BeanClient
RMI-IIOP
EJB Container
24
Using Remote Interfaces
• Network overhead for each call
• Separate transaction for each call– Entity beans have inconsistent state– Recovery must be performed at client side– Extra database statements (even for simple
set methods)
25
Using Local Interfaces
SessionBean
Entity Bean
Entity Bean
Entity Bean
Entity BeanClientRMI-IIOP
EJB Container
26
Q&A
27
References
• http://java.sun.com/products/ejb/
• http://java.sun.com/products/jdk/rmi/
• http://wwws.sun.com/software/jini/
• http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
• http://www.w3.org/2002/ws/
• http://www.onjava.com/pub/a/onjava/2004/11/03/localremote.html