You are on page 1of 31

www.mojtabanow.

info

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.


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 Directory service


Java EE Application Server
Web client Web Container
Servlets EJB Container

Applet JSPs Session EJBs RDBMS

Entity EJBs CORBA


Client
application
Java app

Message queue
JAX- RMI JTA JDBC JMS JMX JAAS JNDI
WS

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


Written by
accessing heterogeneous Application
developer
databases JDBC API JDBC API

The specification that defines four


driver types for connecting to
databases JDBC driver Purchased or
DB API 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 Written by developer

JNDI API
Naming manager JNDI API
JNDI SPI
WLS LDAP File sys DNS
Other Purchased or obtained
driver driver driver driver

WLS LDAP File DNS


Other Service
server server system system

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


JNDI Tree
Root R
context

Initial context
IC
A binding
Context B
associates an
is bound to
object with a
the initial
logical name
context.
and a context.

O1
A B
Object O1
is bound to
the initial
context. C
O2 O3 O3 O4
Object O2 Object O3
is bound to is bound to both
context A. contexts A and B.

2 - 15 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 Written by developers


JCA EJB JDBC JMS
Java Transaction API JTA

Transaction monitor
implementation

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


Java Message Service (JMS)

Producer Producer
JMS is a Java API for
accessing message-oriented
middleware.
The interface supports:
Point-to-point domain JMS
Publish/subscribe server
(pub/sub) domain Destination
Guaranteed message
delivery
Transactional participation
Dynamically configurable
services
Application- or system-
Consumer Consumer Consumer
scoped resources
Interoperability with other messaging systems

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


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 Client
server components
container
JCA
client API
(CCI) Inbound/
System
Outbound
App server contracts Resource
EIS
implementation adapter 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
Oracle WebLogic Server
Web client
HTML/XML Web EJB container
WebService container
Client Session
EJBs
Applet
Entity
Client EJBs
application

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


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 WebLogic


Server
Web client Servlets
HTML/XML
JSPs

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


Proxy Server

The proxy server:


Forwards requests to
other machines Server
Can be used as a level of A
indirection and security
Can be used to load-
balance a system Proxy Server
Client
server B
A reverse proxy is a Web
page cache.
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 HTTP
WebLogic
Server
HTTPS plug-in HTTPS

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


Firewalls

Provide filtering, Firewall


authorization, and
authentication services
Help keep out hackers
Map port requests
Can act as proxy servers HTTP HTTP

Can decrease back-end


network activity

HTTPS HTTPS

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


Application Servers

Oracle WebLogic Server


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

JAX-WS

JDBC

JAAS

JNDI
JMS

JMX
RMI

JTA

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


Web Application Server Configuration

Firewall Firewall Web App servers


server
SvrA SvrV
Client
app SvrB SvrW
Extranet
WLS
or SvrC SvrX
Client Internet
plug-
app In SvrD SvrY

SvrE SvrZ
Client
app

DB
Inner
network
Your network

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


Application Server Configuration

Firewall Firewall App servers


SvrA SvrV
Client
app SvrB SvrW
Extranet
or SvrC SvrX
Client Internet
app SvrD SvrY

SvrE SvrZ
Client
app

Local DB
client
app
Your network

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


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.

You might also like