Download

32
1 Java 2 Enterprise Edition (J2EE) Presented By: Mohamed Mansour mansour@cc

description

 

Transcript of Download

Page 1: Download

1

Java 2 Enterprise Edition(J2EE)

Presented By: Mohamed Mansour

mansour@cc

Page 2: Download

2

Notes

• WebSphere lab– Friday (4/21) 1:05-1:55 PM– Room 153 CCB– www.cc.gatech.edu/~mansour/6210.html

Page 3: Download

3

Outline

• Introduction & Motivation

• Enterprise Applications

• J2EE Architecture

• Server Side Components

• Q&A

Page 4: Download

4

Enterprise Applications

• Inter-company integration

• Intra-company integration

• Legacy applications

Page 5: Download

5

Enterprise ApplicationsEnd-User View

eBay.com

hotmail.com

my.SAP.com

Page 6: Download

6

Enterprise ApplicationsIntra-Enterprise

Page 7: Download

7

Enterprise ApplicationsInter-Enterprise

Page 8: Download

8

Challenges

• Interoperability

• Interface Complexity

• System Evolution

• Scalability

• Reliability

• Cost

Page 9: Download

9

Current Solutions

• Hide complexity in standard application server architectures– .NET, J2EE, other…

• Technology independent interfaces– XML and Web Services

Page 10: Download

10

J2EE Architecture

Page 11: Download

11

Web Container

Servlet Object

HTTP Request

HTTP Response

J2EE Web Container

Page 12: Download

12

Web Container

• Process HTTP requests (POST/GET)• Route to appropriate servlet object• Route HTML reply back to browser• Servlets

– Java classes– Server side

• JSP– Embedded script inside HTML files– Service Side

Page 13: Download

13

Web Container Services

• Session Management

• Thread Pools

• Object Life Cycle

Page 14: Download

14

Three-Tier Arch.

Business LayerPresentation

Layer

Page 15: Download

15

EJB Container Services

• Persistence

• Transactions

• Caching

• Clustering

• Security

Page 16: Download

16

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)

Page 17: Download

17

Priceline.com

Message queue

Worldspan - Airline Reservations

Expedia.com

Delta.com

clearinghouse

Airlines

Page 18: Download

18

Request Dispatcher

Large Scale Deployment

Page 19: Download

19

EJBObject

Interface

RMI-IIOP

JVM 1 JVM 2

Calling Methods on EJBs

ClientServer

Page 20: Download

20

EJB

JVM 1 JVM 2

Calling Methods on EJBs

ClientServer

JNDI

Home“ejbs/ejb/MyEjbHome”

1. Lookup the home interface

Page 21: Download

21

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”

Page 22: Download

22

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

Page 23: Download

23

Code SampleInitialContext ic = new InitialContext();

MyBeanHome home = (MyBeanHome) ic.lookup("java:comp/env/ejb/MyBeanHome")

MyBean b = (MyBean) home.create();

b.foobar();

Page 24: Download

24

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

Page 25: Download

25

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

Page 26: Download

26

Using Remote Interfaces

Entity Bean

Entity Bean

Entity Bean

Entity BeanClient

RMI-IIOP

EJB Container

Page 27: Download

27

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)

Page 28: Download

28

Using Local Interfaces

SessionBean

Entity Bean

Entity Bean

Entity Bean

Entity BeanClientRMI-IIOP

EJB Container

Page 29: Download

29

Q&A

Page 30: Download

30

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

Page 31: Download

31

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?

Page 32: Download

32

J2EE ServerJ2EE Server

App B

App C

App D

App A

App AApp C

App B

Request Dispatcher

Multi-Application Hosting