Вы находитесь на странице: 1из 34

Defining Java Enterprise Edition Terminology and Architecture

Copyright 2009, Oracle. All rights reserved.

Objectives
After completing this lesson, you should be able to: Explain the motivation behind distributed systems List the major components of the Java Platform Enterprise Edition 5 (Java EE) specification

2-2

Copyright 2009, Oracle. All rights reserved.

Distributed Systems
Distributed systems divide the work among several independent modules. The failure of a single module has less impact on the overall system, which makes the system more:
Available Scalable Maintainable

2-3

Copyright 2009, Oracle. All rights reserved.

2-4

Copyright 2009, Oracle. All rights reserved.

How Standards Help


Many advantages of distributed systems come from standards. Standards allow:
Modularization of complex hardware and software A larger portion of the project costs to go toward solving business software needs

2-5

Copyright 2009, Oracle. All rights reserved.

Java EE Standard
Java Platform Enterprise Edition 5 (Java EE) helps you to overcome distribution liabilities. Applications deployed with Java EE technologies are:
Standardized Adherent to specification guidelines Written in Java Deployable in any compliant application server

Java Community Process (JCP) is the oversight (custodial) process for moderating Javas future direction.
http://jcp.org/en/home/index http://jcp.org/en/introduction/faq

2-6

Copyright 2009, Oracle. All rights reserved.

Java EE Architecture
Oracle WebLogic Server Java EE Application Server
Web client Web Container Servlets Applet JSPs EJB Container Session EJBs Entity EJBs RDBMS
Directory service

Client application

CORBA
Java app Message queue

JAXWS

RMI

JTA JDBC JMS JMX JAAS JNDI

Web service

2-7

Copyright 2009, Oracle. All rights reserved.

Java Servlets
A servlet is a Java program that executes on the server, accepting client requests and generating dynamic responses. The most prevalent type of servlet is an HttpServlet that accepts HTTP requests and generates HTTP responses. Servlets:
Do not just generate HTML Can also be used to generate other MIME types, such as images

2-8

Copyright 2009, Oracle. All rights reserved.

SimplestServlet.java
Creates HTML
package mypackage; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class SimplestServlet extends HttpServlet { public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<HTML><BODY>"); out.println("<H1>Hello, World!</H1>"); out.println("</BODY></HTML>"); } }
2-9 Copyright 2009, Oracle. All rights reserved.

JavaServer Pages (JSPs)


Are HTML documents that are interwoven with Java Provide a dynamic response that is based on the clients request Provide for the separation of responsibilities between the Web presentation and the dynamic content Are portable (write once, run anywhere) Compile and run as servlets May include JavaServer Faces tags

2 - 10

Copyright 2009, Oracle. All rights reserved.

realsimple.jsp
Creates HTML
<!-- this is a comment --> <HTML> <HEAD> <TITLE>My title</TITLE> </HEAD> <BODY> <H1>A big heading</H1> <P>Blah blah blah blah blah.</P> <% for (int i=0; i<3; i++) { %> <H3>Say it again, Sam.</H3> <% } %> </BODY> </HTML>

2 - 11

Copyright 2009, Oracle. All rights reserved.

Enterprise JavaBeans (EJBs)


Are distributed components written in the Java programming language Provide distributable and deployable business services (logic) to clients Have well-defined interfaces Are reusable across application servers Execute within a container that provides management and control services
Oracle WebLogic Server 10.3.1 supports the EJB 3.0 specification.

2 - 12

Copyright 2009, Oracle. All rights reserved.

Java Database Connectivity (JDBC)


The standard Java interface for accessing heterogeneous databases The specification that defines four driver types for connecting to databases

Application JDBC API

Written by developer JDBC API

JDBC driver DB API

Purchased or obtained

Purchased or obtained

Database

2 - 13

Copyright 2009, Oracle. All rights reserved.

Java Naming and Directory Interface (JNDI)


Java API for accessing naming and directory services Built as a layer over DNS, LDAP, and so on
Application code JNDI API Naming manager JNDI SPI WLS driver LDAP driver File sys driver DNS driver Other
Purchased or obtained JNDI API Written by developer

WLS server

LDAP server

File system

DNS system

Other

Service

2 - 14

Copyright 2009, Oracle. All rights reserved.

JNDI Tree
Root context

A binding associates an object with a logical name and a context.

IC

Initial context
Context B is bound to the initial context.

O1
Object O1 is bound to the initial context.

O2
Object O2 is bound to context A.

O3 O3

O4

Object O3 is bound to both contexts A and B.

2 - 15

Copyright 2009, Oracle. All rights reserved.

2 - 16

Copyright 2009, Oracle. All rights reserved.

JNDI Contexts and Subcontexts


Subcontexts are referenced through dot delimiters (.). Subcontexts must be created before objects are placed into them. Typically, when objects are bound to a JNDI tree, subcontexts are automatically created based on the JNDI name.

If the following context exists: com.oracle.examples Then you cannot bind: com.oracle.examples.ejb.SomeObject Without first creating: com.oracle.examples.ejb

2 - 17

Copyright 2009, Oracle. All rights reserved.

Java Transaction API (JTA)


JTA is a standard Java API for demarcating transactions within a program.

Application code JCA EJB JDBC JMS

Written by developers

Java Transaction API Transaction monitor implementation

JTA

2 - 18

Copyright 2009, Oracle. All rights reserved.

Java Message Service (JMS)


JMS is a Java API for accessing message-oriented middleware. The interface supports:
Producer Producer

JMS Point-to-point domain server Publish/subscribe Destination (pub/sub) domain Guaranteed message delivery Transactional participation Dynamically configurable services Application- or systemConsumer Consumer scoped resources Interoperability with other messaging systems
2 - 19 Copyright 2009, Oracle. All rights reserved.

Consumer

Java Authentication and Authorization (JAAS)


Java Authentication and Authorization Service (JAAS) is a Java-based security management framework. JAAS supports:
Single sign-on A Pluggable Authentication Module (PAM)

JAAS enables flexible control over authorization whether it is based on:


Users Groups Roles

2 - 20

Copyright 2009, Oracle. All rights reserved.

Java Management Extensions (JMX)


Java Management Extensions (JMX):
Defines a standard infrastructure to manage a device from Java programs Decouples the managed device from the management tools

The specification describes MBeans, which are the building blocks of JMX.

Oracle WebLogic Server Management tool


MBean MBean MBean MBeans

MBean

2 - 21

Copyright 2009, Oracle. All rights reserved.

Java EE Connector Architecture (JCA)


Connects Enterprise Information Systems (EIS) with resource adapters Resource adapters can be deployed in a Resource Adapter Archive (RAR)

Application server container

Client components
JCA client API (CCI) System contracts

App server implementation

Resource adapter

Inbound/ Outbound

EIS
EIS API

2 - 22

Copyright 2009, Oracle. All rights reserved.

Client Application
The client application interacts with WLS through JRMP/T3, IIOP, and jCOM. The types of clients include:
Stand-alone Java applications Applets within a browser
Web client HTML/XML WebService Client Applet Client application
2 - 23 Copyright 2009, Oracle. All rights reserved.

Oracle WebLogic Server Web container EJB container Session EJBs Entity EJBs

Web Client
A Web client interacts with Oracle WebLogic Server via HTTP using servlets or JSPs. The types of Web clients include:
Browser WebService (SOAP over HTTP)

Web container Web client HTML/XML Servlets JSPs

WebLogic Server

2 - 24

Copyright 2009, Oracle. All rights reserved.

Proxy Server
The proxy server:
Forwards requests to other machines Can be used as a level of indirection and security Can be used to loadbalance a system Client
Server A

A reverse proxy is a Web page cache.

Proxy server

Server B

Server C

2 - 25

Copyright 2009, Oracle. All rights reserved.

Web Server
Web servers: Provide Web content Communicate via HTTP, FTP, and so forth Can handle CGI requests Proxy some requests to application servers
Web server
HTTP HTTPS WebLogic Server plug-in HTTP HTTPS

2 - 26

Copyright 2009, Oracle. All rights reserved.

Firewalls
Provide filtering, authorization, and authentication services Help keep out hackers Map port requests Can act as proxy servers Can decrease back-end network activity
Firewall

HTTP

HTTP

HTTPS

HTTPS

2 - 27

Copyright 2009, Oracle. All rights reserved.

Application Servers
Provide services that support the execution and availability of deployed applications Handle heavier processing chores than Web servers
Oracle WebLogic Server Java EE Application Server Web container Servlets JSPs EJB container Session EJBs Entity EJBs

JAX-WS

JDBC

JAAS

JNDI

JMS

JMX

RMI

JTA

2 - 28

Copyright 2009, Oracle. All rights reserved.

Web Application Server Configuration


Firewall Client app Client app
Extranet or Internet

Firewall

Web server

App servers
SvrA SvrB SvrV SvrW SvrX SvrY SvrZ

WLS plugIn

SvrC SvrD SvrE

Client app DB Your network


2 - 29 Copyright 2009, Oracle. All rights reserved.

Inner network

Application Server Configuration


Firewall Client app Client app
Extranet or Internet

Firewall

App servers
SvrA SvrB SvrC SvrD SvrE SvrV SvrW SvrX SvrY SvrZ

Client app Local client app Your network


2 - 30 Copyright 2009, Oracle. All rights reserved.

DB

Quiz
Oracle WebLogic Server 10.3.1 is certified with JDK 1.6. 1. True 2. False

2 - 31

Copyright 2009, Oracle. All rights reserved.

Summary
In this lesson, you should have learned how to: Explain the motivation behind distributed systems List the major components of the Java EE specification

2 - 32

Copyright 2009, Oracle. All rights reserved.

Practice 2 Overview: Defining Terminology and Architecture


There is no practice for this lesson.

2 - 33

Copyright 2009, Oracle. All rights reserved.

2 - 34

Copyright 2009, Oracle. All rights reserved.

Вам также может понравиться