Upload
oraclegeek007
View
216
Download
0
Embed Size (px)
Citation preview
8/2/2019 Les 02 Term Arch
1/34
Copyright 2009, Oracle. All rights reserved.
Defining Java Enterprise Edition
Terminology and Architecture
8/2/2019 Les 02 Term Arch
2/34
Copyright 2009, Oracle. All rights reserved.2 - 2
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
8/2/2019 Les 02 Term Arch
3/34
Copyright 2009, Oracle. All rights reserved.2 - 3
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
8/2/2019 Les 02 Term Arch
4/34
Copyright 2009, Oracle. All rights reserved.2 - 4
8/2/2019 Les 02 Term Arch
5/34
Copyright 2009, Oracle. All rights reserved.2 - 5
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 solvingbusiness software needs
8/2/2019 Les 02 Term Arch
6/34
Copyright 2009, Oracle. All rights reserved.2 - 6
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
8/2/2019 Les 02 Term Arch
7/34
Copyright 2009, Oracle. All rights reserved.2 - 7
Java EE Architecture
Oracle WebLogic Server
Java EE Application Server
Web ContainerWeb client
RDBMS
Message queue
Directory service
CORBA
Java app
Web service
EJB Container
Applet JSPs
Servlets
Session EJBs
Entity EJBs
JAX-
WS
RMI JTA JDBC JMS JMX JAAS JNDI
Client
application
8/2/2019 Les 02 Term Arch
8/34
Copyright 2009, Oracle. All rights reserved.2 - 8
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
8/2/2019 Les 02 Term Arch
9/34
Copyright 2009, Oracle. All rights reserved.2 - 9
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("");out.println("Hello, World!");
out.println("");
}
}
8/2/2019 Les 02 Term Arch
10/34
Copyright 2009, Oracle. All rights reserved.2 - 10
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
8/2/2019 Les 02 Term Arch
11/34
Copyright 2009, Oracle. All rights reserved.2 - 11
realsimple.jsp
My title
A big heading
Blah blah blah blah blah.
8/2/2019 Les 02 Term Arch
12/34
Copyright 2009, Oracle. All rights reserved.2 - 12
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.
8/2/2019 Les 02 Term Arch
13/34
Copyright 2009, Oracle. All rights reserved.2 - 13
Java Database Connectivity (JDBC)
The standard Java interface for
accessing heterogeneous
databases
The specification that defines four
driver types for connecting todatabases
Purchased or
obtained
DB API
Purchased or
obtained
JDBC driver
JDBC APIJDBC API
Written by
developerApplication
Database
8/2/2019 Les 02 Term Arch
14/34
Copyright 2009, Oracle. All rights reserved.2 - 14
Java Naming and Directory Interface (JNDI)
Java API for accessing naming and directory services
Built as a layer over DNS, LDAP, and so on
WLS
server
WLS
driver
Naming manager
Service
Purchased or obtained
JNDI API
Written by developer
OtherDNS
system
File
system
LDAP
server
OtherDNS
driver
File sys
driver
LDAP
driver
JNDI SPI
JNDI API
Application code
8/2/2019 Les 02 Term Arch
15/34
Copyright 2009, Oracle. All rights reserved.2 - 15
JNDI Tree
Context B
is bound to
the initialcontext.
Object O3
is bound to both
contexts A and B.
A binding
associates an
object with a
logical name
and a context.
IC
A
C
Object O1
is bound to
the initial
context.
Object O2
is bound to
context A.
RRootcontext
Initial context
O2 O4O3 O3
BO1
8/2/2019 Les 02 Term Arch
16/34
Copyright 2009, Oracle. All rights reserved.2 - 16
8/2/2019 Les 02 Term Arch
17/34
Copyright 2009, Oracle. All rights reserved.2 - 17
If the following context exists:com.oracle.examples
Then you cannot bind:com.oracle.examples.ejb.SomeObject
Without first creating:com.oracle.examples.ejb
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 theJNDI name.
8/2/2019 Les 02 Term Arch
18/34
Copyright 2009, Oracle. All rights reserved.2 - 18
Java Transaction API (JTA)
JTA is a standard Java API for demarcating transactions within
a program.
EJB JDBC
JTA
Written by developers
Transaction monitor
implementation
Java Transaction API
JMSJCA
Application code
8/2/2019 Les 02 Term Arch
19/34
Copyright 2009, Oracle. All rights reserved.2 - 19
Java Message Service (JMS)
JMS is a Java API foraccessing message-oriented
middleware.
The interface supports:
Point-to-point domain
Publish/subscribe
(pub/sub) domain
Guaranteed message
delivery
Transactional participation
Dynamically configurable
services
Application- or system-
scoped resources
Interoperability with other messaging systems
Producer
Consumer
Producer
Consumer Consumer
JMS
server
Destination
8/2/2019 Les 02 Term Arch
20/34
Copyright 2009, Oracle. All rights reserved.2 - 20
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
8/2/2019 Les 02 Term Arch
21/34
Copyright 2009, Oracle. All rights reserved.2 - 21
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 thebuilding blocks of JMX.
MBeansManagement tool
Oracle WebLogic Server
MBeanMBean
MBeanMBean
8/2/2019 Les 02 Term Arch
22/34
Copyright 2009, Oracle. All rights reserved.2 - 22
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
Resource
adapter
App server
implementationEIS
System
contracts
JCA
client API(CCI) Inbound/
Outbound
EIS API
8/2/2019 Les 02 Term Arch
23/34
Copyright 2009, Oracle. All rights reserved.2 - 23
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
Oracle WebLogic Server
Web
container
Applet
Client
application
Web client
HTML/XMLEJB container
SessionEJBs
Entity
EJBs
WebService
Client
8/2/2019 Les 02 Term Arch
24/34
Copyright 2009, Oracle. All rights reserved.2 - 24
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)
WebLogic
ServerWeb container
Servlets
JSPs
Web clientHTML/XML
8/2/2019 Les 02 Term Arch
25/34
Copyright 2009, Oracle. All rights reserved.2 - 25
Proxy Server
The proxy server:
Forwards requests to
other machines
Can be used as a level of
indirection and security
Can be used to load-
balance a system
A reverse proxy is a Web
page cache.
Proxy
serverClient
Server
A
ServerC
Server
B
8/2/2019 Les 02 Term Arch
26/34
Copyright 2009, Oracle. All rights reserved.2 - 26
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
WebLogic
Server
plug-in
HTTP
HTTPS
HTTP
HTTPS
8/2/2019 Les 02 Term Arch
27/34
Copyright 2009, Oracle. All rights reserved.2 - 27
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
HTTPS
HTTP
HTTPS
8/2/2019 Les 02 Term Arch
28/34
Copyright 2009, Oracle. All rights reserved.2 - 28
Application Servers
Provide services that
support the execution
and availability of
deployed applications
Handle heavierprocessing chores than
Web servers
Oracle WebLogic ServerJava EE Application Server
Web container
Servlets
JSPs
EJB container
Session
EJBs
Entity
EJBs
JAAS
JNDI
JMX
JMS
JDBC
JTA
RMI
JAX-WS
8/2/2019 Les 02 Term Arch
29/34
Copyright 2009, Oracle. All rights reserved.2 - 29
Web Application Server Configuration
Your network
Inner
network
Client
app
Client
app
Firewall Firewall
Extranet
or
Internet
App servers
SvrC
SvrB
SvrA
SvrD
SvrE
SvrX
SvrW
SvrV
SvrY
SvrZ
Client
app
Web
server
WLSplug-
In
DB
8/2/2019 Les 02 Term Arch
30/34
Copyright 2009, Oracle. All rights reserved.2 - 30
Application Server Configuration
Your network
Client
app
Client
app
Firewall Firewall
Extranet
or
Internet
App servers
SvrC
SvrB
SvrA
SvrD
SvrE
SvrX
SvrW
SvrV
SvrY
SvrZ
Local
client
app
Client
app
DB
8/2/2019 Les 02 Term Arch
31/34
Copyright 2009, Oracle. All rights reserved.2 - 31
Quiz
Oracle WebLogic Server 10.3.1 is certified with JDK 1.6.
1. True
2. False
8/2/2019 Les 02 Term Arch
32/34
Copyright 2009, Oracle. All rights reserved.2 - 32
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
8/2/2019 Les 02 Term Arch
33/34
Copyright 2009, Oracle. All rights reserved.2 - 33
Practice 2Overview:
Defining Terminology and Architecture
There is no practice for this lesson.
8/2/2019 Les 02 Term Arch
34/34
Copyright 2009, Oracle. All rights reserved.2 - 34