Java Enterprise Edition (JavaEE)...

24
Java Enterprise Edition (JavaEE) Intro version 7 Revision: v2018-08-20 Built on: 2019-08-22 07:07 EST Copyright © 2019 jim stafford ([email protected]) This presentation introduces the JavaEE enterprise framework and its associated API standards.

Transcript of Java Enterprise Edition (JavaEE)...

Page 1: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Java Enterprise Edition (JavaEE) Intro

version 7

Revision: v2018-08-20Built on: 2019-08-22 07:07 EST

Copyright © 2019 jim stafford ([email protected])

This presentation introduces the JavaEE enterprise framework and its associated API standards.

Page 2: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)
Page 3: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

iii

Purpose ............................................................................................................................ v

1. Goals .................................................................................................................... v

2. Objectives ............................................................................................................. v

1. Java Technology Levels .............................................................................................. 1

1.1. Java Standard Edition(tm) (JavaSE or JSE) ......................................................... 1

1.2. Java Micro Edition(tm) (JavaME) ......................................................................... 1

1.3. Java Enterprise Edition(tm) (JavaEE, JEE, EE4J, or Jakarta EE) ........................... 1

2. Why Enterprise? .......................................................................................................... 3

3. JavaEE Architecture .................................................................................................... 5

3.1. Profiles ............................................................................................................... 5

3.1.1. Web Profile .............................................................................................. 6

3.1.2. Micro Profile (coming?) ............................................................................. 6

3.2. Application Components ...................................................................................... 6

3.2.1. Application Clients .................................................................................... 6

3.2.2. Applets .................................................................................................... 6

3.2.3. Servlets/JSPs/JSF .................................................................................... 6

3.2.4. Enterprise JavaBeans(tm) (EJB) ............................................................... 7

3.3. Containers .......................................................................................................... 7

3.3.1. Servers .................................................................................................... 7

3.4. Resource Adapters ............................................................................................. 7

3.5. Databases .......................................................................................................... 8

4. JavaEE Specifications ................................................................................................. 9

5. JavaEE Version Highlights ........................................................................................ 13

6. Summary .................................................................................................................... 15

A. Sources ...................................................................................................................... 17

Page 4: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

iv

Page 5: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

v

Purpose

1. Goals• Understand the purpose of enterprise applications

• Understand the role of a container

• Introduce the overall architecture for JavaEE

• Introduce the standards contained within the JavaEE framework

2. Objectives

At the completion of this topic, the student shall be able to:

• Identity characteristics of enterprise applications

• Identify the difference between a JavaEE API, JavaEE provider, and a JavaEE module

• Identify the different container types for JavaEE

• Identify the standards that make up a JavaEE

Page 6: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

vi

Page 7: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Chapter 1.

1

Java Technology Levels

1.1. Java Standard Edition(tm) (JavaSE or JSE)• Core Language

• Formerly called J2SE. Changed started with JavaSE 6

• Java APIs are what applications are written against.

• Standardized

• Java Runtime Edition (JRE) is what applications run with.

• Many providers

• Java Developer Kit (JDK) is what applications are built with

• Many providers

• JRE and JDK provider choices are independent

1.2. Java Micro Edition(tm) (JavaME)• Formerly called J2ME

• Targeted at smaller devices

• Small footprint

• Limited power

• Limited and sporadic bandwidth

1.3. Java Enterprise Edition(tm) (JavaEE, JEE, EE4J, or

Jakarta EE)• Formerly called J2EE. Change started with JavaEE 5

• Movement from Oracle to Eclipse Foundation after/at JavaEE 8

• Temporarily called EE4J (Eclipse Enterprise for Java) [https://projects.eclipse.org/projects/

ee4j]

• Has officially become Jakarta EE [https://jakarta.ee/]

• Targeted at enterprise deployments commonly deployed to data centers

• Persistence/Data Access

• Scaling

• Transactions

• Security

• Resource Management

• Availability

• Distributed

• Web-based

• Generally deployed in N-Tiers

• Interface

• Transacted Business Logic

• Persistence/Back-end Integration

• Contains

• APIs (standardized)

Page 8: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Chapter 1. Java Technology Levels

2

• Compatibility test suites

• Reference Implementation (Glassfish)

• Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Page 9: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Chapter 2.

3

Why Enterprise?

Figure 2.1. Needs and JavaEE/EJB Implementation Options

Page 10: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

4

Page 11: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Chapter 3.

5

JavaEE ArchitectureFigure 3.1. JavaEE Architecture1

3.1. Profiles• Subset of JavaEE APIs targeted at key use cases

• Share common underlying APIs for consistency

1JavaEE 7 Specification [http://jcp.org/en/jsr/detail?id=342]

Page 12: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Chapter 3. JavaEE Architecture

6

• Provide smaller gates of entry for providers

• Provide means to eliminate deprecated specs from concern

• Risk fragmenting community and introducing confusion -- not taken lightly

3.1.1. Web Profile• WAR deployments

• Only JavaEE profile to date

• Noted Exclusions

• Full EJB support, including remote interfaces and legacy 2.x capabilities

• JMS and Message-Driven Beans (MDBs)

• Web Service Standards

3.1.2. Micro Profile (coming?)• Not yet officially pay of Jakarta EE but part of Eclipse Foundation (Eclipse MicroProfile [https://

projects.eclipse.org/projects/technology.microprofile])

• Micro-Container-focused services [https://docs.google.com/presentation/d/1BYfVqnBIffh-

QDIrPyromwc9YSwIbsawGUECSsrSQB0/edit#slide=id.g3d2897e2e8_109_332]

• Config

• Metrics

• Fault Tolerance

• JAX-RS

• ...

3.2. Application Components• Different types

• Deployed to client (Applets)

• Deployed to data center (Servlets and EJBs)

• Undefined deployment (App Clients)

3.2.1. Application Clients• Java programs (e.g., GUI running on client)

• Have access to middle-tier

3.2.2. Applets• GUI components typically running in browser

• Access middle-tier indirectly thru Web container and HTTP

3.2.3. Servlets/JSPs/JSF• Generate content to browser from Web container

• Can be UI/HTML-based

• Can be service/XML/JSON (or other structured data forms)-based

• May contain EJBs providing transactional support

Page 13: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Enterprise JavaBeans(tm) (EJB)

7

3.2.4. Enterprise JavaBeans(tm) (EJB)• Contain business logic

• Manage transactions, resources, security, etc.

• May provide direct support for RMI and Web service clients

3.3. Containers• Provide runtime support for JavaEE application components

• Provide an interpose layer around/between each component

• Inject required components

• Application developers may think of the Application Server==Container

• Containers address specifics of the standards (e.g., deployment artifact structure)

Figure 3.2. POJOs, Components, and Container Interpose

3.3.1. Servers• Host the containers and their application clients

• No physical requirements (single server or multiple servers per container/conatiner type)

• May be a general-purpose transaction platform adapted to JavaEE by the containers

3.4. Resource Adapters• System-level software component

• Extends standard APIs into specific resources (e.g., JDBC)

• Framework provided for:

Page 14: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Chapter 3. JavaEE Architecture

8

• Connection/Resource Pooling

• Security Management

• Transaction Management

3.5. Databases• Pervasive player in most JavaEE application clients

• Not applicable for Applets

Page 15: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Chapter 4.

9

JavaEE Specifications

Table 4.1. JavaEE 8 Specifications a b

Enterprise

Application

Technologies

Version Web Profile Course Relevance

Enterprise JavaBeans

(EJB)

3.2 EJB-lite Primary

Java Persistence API

(JPA)

2.2 Y Y

Context and

Dependency Injection

(CDI)

2.0 Y Y

Dependency Injection

for Java (JSR-330)

1.0 Y Y

Common Annotations

for the Java Platform

1.3 Y Y

Java Transaction API

(JTA)

1.2 Y Y

Java Message

Service API (JMS)

2.0 Y

Bean Validation 2.0 Y Y

Interceptors 1.2 Y Y

Managed Beans 1.0 Y

JavaEE Connector

Architecture

1.7

JavaMail 1.6

Batch Applications for

the Java Platform

1.0

Concurrency Utilities

for Java EE

1.0

Web Service

Technologies

Version Web Profile Course Relevance

Java API for RESTful

Services (JAX-RS)

2.1 Y Y

Java Architecture for

XML Binding (JAXB)

2.2 Y

Page 16: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Chapter 4. JavaEE Specifications

10

Web Service

Technologies

Version Web Profile Course Relevance

JSON-B 1.0 Y

JSON-P 1.1 Y (maybe)

Java API for XML-

based Web Services

(JAX-WS)

2.2

Web Services

Metadata

2.1

Java API for XML-

based RPC (JAX-

RPC)

1.1

Java API for XML

Registries (JAXR)

1.0

Web Services for

JavaEE

1.4

Web Socket 1.1

Web Related

Technologies

Version Web Profile Course Relevance

Servlet 4.0 Y Minor

JavaServer Pages

(JSP)

2.3 Y Minor

JavaServer Faces

(JSF)

2.3 Y

Expression Language 3.0 Y

JSTL 1.2 Y

Management

Technologies

Version Web Profile Course Relevance

Java Authentication

Service Provider

Interface for

Containers (JASPIC)

1.1

Java Authorization

Service Provider

Contract for

Containers (JACC)

1.5

Java EE

Management

1.1

Java EE Deployment 1.2

Page 17: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

11

Management

Technologies

Version Web Profile Course Relevance

Debugging Support

for Other Languages

1.0 Y

aJavaEE 8 Specification [https://jcp.org/en/jsr/detail?id=366]bWikiPedia [http://en.wikipedia.org/wiki/Java_EE_version_history]

Page 18: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

12

Page 19: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Chapter 5.

13

JavaEE Version Highlights1

1.2

"CORBA Integration"; Dec 1999

• RMI over IIOP

1.3

"Local Interface EJBs"; Sep 2001

• Connector API

• EJB (2.x) local interfaces and new CMP model

1.4

"Web Service Enabled"; Nov 2003

• SOAP Web Services

• Deployment, Management, JAAS

5

"Ease of Development"; May 2006

• Annotations

• Better Defaults

• EJB and Servlet Dependency Injection

• JPA, StAX, JAX-WS

6

"More Ease of Development"; Dec 2009

• Profiles; making some components optional

• Flexible deployments; no EJB.jar or EAR requirement

• No interface EJBs

• Component and Dependency Injection

7

"Offloading Additional Common Infrastructure Tasks and More Ease of Development"; June

2013

• Additional Web standards; Web Sockets and JSON

• HTTP Client API within JAX-RS

• Batch API

• Concurrency Utilities

• More consistency between CDI and component models

• More inherent integrations with Validation API

• Simplified JMS API

• JPA Schema generation

1Wikipedia JavaEE Versions [http://en.wikipedia.org/wiki/Java_EE_version_history]

Page 20: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Chapter 5. JavaEE Version Hig...

14

8

"Focus on modern web applications";August 2017

• Expanding support of JSON with JSON-B

• HTTP/2 protocol

• JAX-RS server-sent events

• API for identity stores

• ...

Page 21: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

Chapter 6.

15

Summary• Made a technical case for JavaEE and EJB

• Described an envolution of EJB

• Showed where EJB fits within the JavaEE Specs

• Introduced 4-5 types of EJBs

• Introduced 3 EJB deployment types

Page 22: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

16

Page 23: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

17

Appendix A. Sources1. "JSR-000366 JavaTM Platform, Enterprise Edition 8 (Java EE 8) Specification (Final

Release)", Linda DeMichiel, Bill Shannon, https://jcp.org/aboutJava/communityprocess/final/

jsr366/index.html, 7/31/17 Oracle America, Inc.

2. "JavaEE Version History", Wikipedia, http://en.wikipedia.org/wiki/Java_EE_version_history,

September 3. 2012.

Page 24: Java Enterprise Edition (JavaEE) Introwebdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/pdf/javaee … · • Providers (e.g., Glassfish, JBoss/Wildfly, WebSphere, WebLogic, Payara)

18