SlideShare a Scribd company logo
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Java EE 8 - Work in Progress
David Delabassee
@delabassee
Oracle Corporation
JJUG CCC 2015 Fall
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
2
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Program Agenda
Quick recap of goals and themes of Java EE 8
What we have accomplished
How you can get involved
1
2
3
3
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Industry Trends
Cloud
4
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Java EE 8 – Driven by Community Feedback
http://glassfish.org/survey
5
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Java EE 8 Themes
• HTML5 / Web Tier Enhancements
• Ease of Development
• Infrastructure for running in the Cloud
6
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
HTML5 Support / Web Tier Enhancements
• JSON Binding
• JSON Processing enhancements
• Server-sent events
• Action-based MVC
• HTTP/2 support
7
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
JSON-B 1.0
• API to marshal/unmarshal Java objects to/from JSON
– Similar to JAXB runtime API in XML world
• Draw from best practices of existing JSON binding implementations
– MOXy, Jackson, GSON, Genson, Xstream, …
– Allow switch of JSON binding providers
• Default mapping of classes to JSON
– Annotations to customize the default mappings
– JsonbProperty, JsonbTransient, JsonbNillable, JsonbValue, …
Java API for JSON Binding
8
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
JSON-B 1.0
@Entity public class Person {
@Id String name;
String gender;
@ElementCollection Map<String,String> phones;
... // getters and setters
}
Person duke = new Person();
duke.setName("Duke");
duke.setGender("M");
phones = new HashMap<String,String>();
phones.put("home", "650-123-4567");
phones.put("mobile", "650-234-5678");
duke.setPhones(phones);
Jsonb jsonb = JsonbBuilder.create();
String person = jsonb.toJson(duke);
{
"name":"Duke",
"gender":"M",
"phones":{
"home":"650-123-4567",
"mobile":"650-234-5678"}
}
9
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
JSON-P 1.1
• Keep JSON-P spec up-to-date
• Track new standards
• Add editing operations to JsonObject and JsonArray
• Helper classes and methods to better utilize SE 8’s stream operations
Java API for JSON Processing
10
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
JSON-P 1.1
• JSON-Pointer – IETF RFC 6901
– String syntax for referencing a value
"/0/phones/mobile"
Tracking new standards
11
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
JSON-P 1.1
JsonArray contacts = ...;
JsonPointer p =
new JsonPointer("/0/phones/mobile");
JsonValue v = p.getValue(contacts);
[
{
"name":"Duke",
"gender":"M",
"phones":{
"home":"650-123-4567",
"mobile":"650-234-5678"}},
{
"name":"Jane",
"gender":"F",
"phones":{
"mobile":"707-555-9999"}}
]
12
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
JSON-P 1.1
JsonArray contacts = ...;
JsonPointer p =
new JsonPointer("/0/phones/mobile");
JsonArray newContacts =
p.replace(contacts, "650-555-1234");
[
{
"name":"Duke",
"gender":"M",
"phones":{
"home":"650-123-4567",
"mobile":"650-234-5678"}},
{
"name":"Jane",
"gender":"F",
"phones":{
"mobile":"707-555-9999"}}
]
13
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
JSON-P 1.1
JsonArray contacts = ...;
JsonPointer p =
new JsonPointer("/0/phones/mobile");
JsonArray newContacts =
p.replace(contacts, "650-555-1234");
[
{
"name":"Duke",
"gender":"M",
"phones":{
"home":"650-123-4567",
"mobile":"650-555-1234"}},
{
"name":"Jane",
"gender":"F",
"phones":{
"mobile":"707-555-9999"}}
]
14
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
JSON-P 1.1
• JSON-Patch – IETF RFC 6902
• Patch is a JSON document
– Array of objects / operations for modifying a JSON document
– add, replace, remove, move, copy, test
– Must have "op" field and "path" field
[
{"op":"replace", "path":"/0/phones/mobile", "value":"650-111-2222"},
{"op":"remove", "path":"/1"}
]
Tracking new standards
15
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
JSON-P 1.1
JSON Query using Streams API
JsonArray contacts = ...;
List<String> femaleNames = contacts.getValuesAs(JsonObject.class).stream()
.filter(x->"F".equals(x.getString("gender")))
.map(x->(x.getString("name"))
.collect(Collectors.toList());
JsonArray femaleNames = contacts.getValuesAs(JsonObject.class).stream()
.filter(x->"F".equals(x.getString("gender")))
.map(x->(x.getString("name"))
.collect(JsonCollectors.toJsonArray());
16
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Server-sent Events
• Part of HTML5 standardization
• Server-to-client streaming of text data
• Mime type is text/event-stream
• Long-lived HTTP connection
– Client establishes connection
– Server pushes update notifications to client
– Commonly used for one-way transmission for period updates or updates due to
events
17
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Server-sent Events
• JAX-RS a natural fit
– Streaming HTTP resources already supported
– Small extension
• Server API: new media type; EventOutput
• Client API: new handler for server side events
– Convenience of mixing with other HTTP operations; new media type
– Jersey (JAX-RS RI) already supports SSE
18
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Server-sent Events
@Path("tickers")
public class StockTicker {
@Get
@Produces("text/event-stream")
public EventOutput getQuotes() {
EventOutput eo = new EventOutput();
new StockThread(eo).start();
return eo;
}
}
JAX-RS resource class
19
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Server-sent Events
JAX-RS StockThread class
class StockThread extends Thread {
private EventOutput eo;
private AtomicBoolean ab =
new AtomicBoolean(true);
public StockThread(EventOutput eo) {
this.eo = eo;
}
public void terminate() {
ab.set(false);
}
@Override
public void run() {
while (ab.get()) {
try {
// ...
eo.send(new StockQuote("..."));
// ...
} catch (IOException e) {
// ...
}
}
}
}
20
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Server-sent Events
WebTarget target = client.target("http://example.com/tickers");
EventSource eventSource = new EventSource(target) {
@Override
public void onEvent(InboundEvent inboundEvent) {
StockQuote sq = inboundEvent.readData(StockQuote.class);
// ...
}
};
eventSource.open();
JAX-RS Client
21
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Model View Controller (MVC)
• Component-based MVC
– Controller provided by the framework
– JSF, Wicket, Tapestry…
• Action-based MVC
– Controllers defined by the application
– Struts 2, Spring MVC…
2 Styles
22
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
MVC 1.0
• Action-based model-view-controller architecture
• Glues together key Java EE technologies:
– Model
• CDI, Bean Validation, JPA
– View
• Facelets, JSP
– Controller
• JAX-RS resource methods
23
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
MVC 1.0
@Path("hello")
public class HelloController {
@Inject
private Greeting greeting;
@GET
@Controller
public String hello() {
greeting.setMessage("Hello Tokyo!");
return "hello.jsp";
}
}
Model Controller
@Named
@RequestScoped
public class Greeting {
private String message;
public String getMessage() {
return message;
}
public void setMessage(message) {
this.message = message;
}
}
24
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
MVC 1.0
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Hello</title>
</head>
<body>
<h1>${greeting.message}</h1>
</body>
</html>
View
25
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
HTTP/2
• HTTP 1.1 uses TCP poorly
– HTTP flows are short and bursty
– TCP was built for long-lived flows
• Workarounds
– Sprites
– Domain sharding
– Inlining
– File concatenation
Address the Limitations of HTTP 1.x
26
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
HTTP/2
HTTP/2 Goals
• Reduce latency
• Address the HOL blocking problem
• Support parallelism (without requiring multiple connections)
• Define interaction with HTTP 1.x
• Retain semantics of HTTP 1.1
Address the Limitations of HTTP 1.x
27
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
HTTP/2
• Binary Framing
• Request/Response multiplexing over single connection
– Fully bidirectional
– Multiple streams
• Server Push
• Header Compression
• Upgrade from HTTP 1.1
• Stream Prioritization
Features
28
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Servlet 4.0
• Binary Framing
• Request/Response multiplexing
– Servlet Request as HTTP/2 message
• Upgrade from HTTP 1.1
• Server Push
• Stream prioritization
HTTP/2 Features in Servlet API
29
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Ease of Development
• CDI alignment
• Security interceptors
• Simplified messaging with JMS message-driven beans
• JAX-RS injection alignment
• WebSocket scopes
• Pruning of EJB 2.x client view and IIOP interoperability
30
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Java EE Security 1.0
@IsAuthorized("hasRoles('Manager') && schedule.officeHrs")
void transferFunds()
@IsAuthorized("hasRoles('Manager') && hasAttribute('directReports', employee.id)")
double getSalary(long employeeId);
@IsAuthorized(ruleSourceName="java:app/payrollAuthRules", rule="report")
void displayReport();
Authorization via CDI Interceptors
31
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
JMS 2.1
• Continue the ease-of-use improvements started in JMS 2.0
• Improve the API for receiving messages asynchronously
– Improve JMS MDBs
– Provide alternative to JMS MDBs
New API to receive messages asynchronously
32
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
CDI 2.0
• Modularity
• Java SE support
• Asynchronous Events
• Event ordering
• …
33
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Modernize the Infrastructure
• Java EE Management 2.0
– REST-based APIs for Management and Deployment
• Java EE Security 1.0
– Authorization
– Password Aliasing
– User Management
– Role Mapping
– Authentication
– REST Authentication
For On-Premise and for in the Cloud
34
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Java EE 8 JSRs
• Java EE 8 Platform (JSR 366)
• CDI 2.0 (JSR 365)
• JSON Binding 1.0 (JSR 367)
• JMS 2.1 (JSR 368)
• Java Servlet 4.0 (JSR 369)
• JAX-RS 2.1 (JSR 370)
• MVC 1.0 (JSR 371)
• JSF 2.3 (JSR 372)
• Java EE Management 2.0 (JSR 373)
• JSON-P 1.1 (JSR 374)
• Java EE Security 1.0 (JSR 375)
35
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Expected MRs and small JSRs
• Connector Architecture
• WebSocket
• Interceptors
• JPA
• EJB
• JTA
• Bean Validation
• Batch
• JavaMail
• …
36
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Transparency
• Our Java EE 8 JSRs run in the open on java.net
– http://javaee-spec.java.net
– One project per JSR – jax-rs-spec, mvc-spec, servlet-spec,…
– https://java.net/projects/javaee-spec/pages/Specifications
• Publically viewable Expert Group mail archive
– Users observer lists gets all copies
• Publicly accessible download area
• Publicly accessible issue tracker / JIRA
• …
Commitment to JCP transparent processes
37
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
How to Get Involved
• Join an Expert Group project
– http://javaee-spec.java.net
– https://java.net/projects/javaee-spec/pages/Specifications
• Adopt a JSR
– http://glassfish.org/adoptajsr
• The Aquarium
– http://blogs.oracle.com/theaquarium
• Java EE 8 Reference Implementation
– http://glassfish.org
38
112815 java ee8_davidd

More Related Content

PDF
JAX RS 2.0 - OTN Bangalore 2013
Jagadish Prasath
 
PDF
PaaS enabling Java EE applications through service meta-data and policies - J...
Jagadish Prasath
 
PPTX
What's New in Java 8
javafxpert
 
PPTX
OData: A Standard API for Data Access
Pat Patterson
 
PPTX
JAX-RS 2.0 and OData
Anil Allewar
 
PPTX
Practical OData
Vagif Abilov
 
PPTX
Java EE for the Cloud
Dmitry Kornilov
 
PPT
Accessing the Linked Open Data Cloud via ODBC
Kingsley Uyi Idehen
 
JAX RS 2.0 - OTN Bangalore 2013
Jagadish Prasath
 
PaaS enabling Java EE applications through service meta-data and policies - J...
Jagadish Prasath
 
What's New in Java 8
javafxpert
 
OData: A Standard API for Data Access
Pat Patterson
 
JAX-RS 2.0 and OData
Anil Allewar
 
Practical OData
Vagif Abilov
 
Java EE for the Cloud
Dmitry Kornilov
 
Accessing the Linked Open Data Cloud via ODBC
Kingsley Uyi Idehen
 

What's hot (20)

PDF
JAX RS and CDI bike the reactive bridge
José Paumard
 
PPTX
Modern REST APIs for Enterprise Databases - OData
Nishanth Kadiyala
 
PDF
Apache Olingo - ApacheCon Denver 2014
Stephan Klevenz
 
PPTX
OData - The Universal REST API
Nishanth Kadiyala
 
PPTX
JSON-B for CZJUG
Dmitry Kornilov
 
PDF
Java EE 8 - What’s new on the Web front
David Delabassee
 
PDF
What’s new in JSR 367 Java API for JSON Binding
Dmitry Kornilov
 
PDF
Oracle NoSQL
Oracle Korea
 
PPTX
OData for iOS developers
Glen Gordon
 
PPTX
OData Introduction and Impact on API Design (Webcast)
Apigee | Google Cloud
 
PPTX
New PLSQL in Oracle Database 12c
Connor McDonald
 
PPT
HTML5 based PivotViewer for Visualizing LInked Data
Kingsley Uyi Idehen
 
ODP
Introduction to OData
Mindfire Solutions
 
PPTX
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
Pat Patterson
 
PPT
Exploiting Linked (Open) Data via Microsoft Access using ODBC File DSNs
Kingsley Uyi Idehen
 
PPTX
Odata
Monalisa Patel
 
PPTX
What's new in the Java API for JSON Binding
Dmitry Kornilov
 
PDF
A Look at OData
Woodruff Solutions LLC
 
PPT
Using SAP Crystal Reports as a Linked (Open) Data Front-End via ODBC
Kingsley Uyi Idehen
 
PPT
Exploiting Linked (Open) Data via Microsoft Access
Kingsley Uyi Idehen
 
JAX RS and CDI bike the reactive bridge
José Paumard
 
Modern REST APIs for Enterprise Databases - OData
Nishanth Kadiyala
 
Apache Olingo - ApacheCon Denver 2014
Stephan Klevenz
 
OData - The Universal REST API
Nishanth Kadiyala
 
JSON-B for CZJUG
Dmitry Kornilov
 
Java EE 8 - What’s new on the Web front
David Delabassee
 
What’s new in JSR 367 Java API for JSON Binding
Dmitry Kornilov
 
Oracle NoSQL
Oracle Korea
 
OData for iOS developers
Glen Gordon
 
OData Introduction and Impact on API Design (Webcast)
Apigee | Google Cloud
 
New PLSQL in Oracle Database 12c
Connor McDonald
 
HTML5 based PivotViewer for Visualizing LInked Data
Kingsley Uyi Idehen
 
Introduction to OData
Mindfire Solutions
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
Pat Patterson
 
Exploiting Linked (Open) Data via Microsoft Access using ODBC File DSNs
Kingsley Uyi Idehen
 
What's new in the Java API for JSON Binding
Dmitry Kornilov
 
A Look at OData
Woodruff Solutions LLC
 
Using SAP Crystal Reports as a Linked (Open) Data Front-End via ODBC
Kingsley Uyi Idehen
 
Exploiting Linked (Open) Data via Microsoft Access
Kingsley Uyi Idehen
 
Ad

Viewers also liked (18)

PDF
Brochure Arevalo
Pix Propiedades
 
PPTX
Hipogramatik Cerita Wayang dalam Puisi Indonesia Moderen
Hamia Sani
 
DOC
Past paper quest aspect fitness
nmcquade
 
PDF
Press freedom in_canada_program
MEDIAinTORONTO
 
PPT
Enquête satisfaction 2011_erma
Romain MURRY
 
PDF
New base energy news issue 952 dated 21 november 2016
Khaled Al Awadi
 
PPTX
Sistemas operativos
barbaraperbaz
 
PDF
JavaOne2015報告会 in Okinawa
Takashi Ito
 
PPTX
Civil War Battles
susanlawrence56
 
PPT
Presentacio emile guia2012
clamuraller
 
PDF
Innovation in the Mining Industry – How does it Compare?
NORCAT
 
PDF
Java Day Tokyo 2016 feedback at Kumamoto
Takashi Ito
 
PPTX
Unidad 6
Lucia Hernández
 
PPTX
Jibril abubakar, web play
Jibril Abubakar
 
PPTX
Vive la musique!
Игорь Анатольевич
 
PDF
NIVELES DE IMPUTACION
Wendy Dominguez Oliva
 
PPTX
Partie b présentation
pascalelarouche
 
PDF
KDDI Financial Results for the 1st Half of FY2015.3
KDDI
 
Brochure Arevalo
Pix Propiedades
 
Hipogramatik Cerita Wayang dalam Puisi Indonesia Moderen
Hamia Sani
 
Past paper quest aspect fitness
nmcquade
 
Press freedom in_canada_program
MEDIAinTORONTO
 
Enquête satisfaction 2011_erma
Romain MURRY
 
New base energy news issue 952 dated 21 november 2016
Khaled Al Awadi
 
Sistemas operativos
barbaraperbaz
 
JavaOne2015報告会 in Okinawa
Takashi Ito
 
Civil War Battles
susanlawrence56
 
Presentacio emile guia2012
clamuraller
 
Innovation in the Mining Industry – How does it Compare?
NORCAT
 
Java Day Tokyo 2016 feedback at Kumamoto
Takashi Ito
 
Jibril abubakar, web play
Jibril Abubakar
 
NIVELES DE IMPUTACION
Wendy Dominguez Oliva
 
Partie b présentation
pascalelarouche
 
KDDI Financial Results for the 1st Half of FY2015.3
KDDI
 
Ad

Similar to 112815 java ee8_davidd (20)

PDF
What's Coming in Java EE 8
PT.JUG
 
PDF
JAX-RS.next
Michal Gajdos
 
PDF
Java EE 8 Overview (Japanese)
Logico
 
PDF
JavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Java EE 8 - An instant snapshot
David Delabassee
 
PDF
Java EE 8 - An instant snapshot
David Delabassee
 
PDF
What's coming in Java EE 8
David Delabassee
 
PDF
What’s new in Java SE, EE, ME, Embedded world & new Strategy
Mohamed Taman
 
PDF
Java EE 8: On the Horizon
Josh Juneau
 
PDF
Java EE 7 overview
Masoud Kalali
 
PDF
Web Technologies in Java EE 7
Lukáš Fryč
 
PDF
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
David Delabassee
 
PPTX
Java EE 8
Ryan Cuprak
 
PDF
JavaOne 2014 Java EE 8 Booth Slides
Edward Burns
 
PDF
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
Arun Gupta
 
PDF
JAX-RS 2.0: RESTful Web Services
Arun Gupta
 
PDF
Presente e Futuro: Java EE.next()
Bruno Borges
 
PPT
Java EE7 in action
Ankara JUG
 
PDF
Java EE 7 in practise - OTN Hyderabad 2014
Jagadish Prasath
 
PDF
As novidades do Java EE 7: do HTML5 ao JMS 2.0
Bruno Borges
 
What's Coming in Java EE 8
PT.JUG
 
JAX-RS.next
Michal Gajdos
 
Java EE 8 Overview (Japanese)
Logico
 
JavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Java EE 8 - An instant snapshot
David Delabassee
 
Java EE 8 - An instant snapshot
David Delabassee
 
What's coming in Java EE 8
David Delabassee
 
What’s new in Java SE, EE, ME, Embedded world & new Strategy
Mohamed Taman
 
Java EE 8: On the Horizon
Josh Juneau
 
Java EE 7 overview
Masoud Kalali
 
Web Technologies in Java EE 7
Lukáš Fryč
 
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
David Delabassee
 
Java EE 8
Ryan Cuprak
 
JavaOne 2014 Java EE 8 Booth Slides
Edward Burns
 
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
Arun Gupta
 
JAX-RS 2.0: RESTful Web Services
Arun Gupta
 
Presente e Futuro: Java EE.next()
Bruno Borges
 
Java EE7 in action
Ankara JUG
 
Java EE 7 in practise - OTN Hyderabad 2014
Jagadish Prasath
 
As novidades do Java EE 7: do HTML5 ao JMS 2.0
Bruno Borges
 

More from Takashi Ito (7)

PDF
JDK:新しいリリースモデル解説 @ 富山 BuriKaigi 2019
Takashi Ito
 
PDF
今年はJava進化の年!今知っておくべき新しいJava
Takashi Ito
 
PDF
Java EE, What's Next? by Anil Gaur
Takashi Ito
 
PDF
20161119 java one-feedback_osaka
Takashi Ito
 
PDF
20161111 java one2016-feedback
Takashi Ito
 
PDF
JavaOne2015フィードバック @ 富山合同勉強会
Takashi Ito
 
PDF
20160123 java one2015_feedback @ Osaka
Takashi Ito
 
JDK:新しいリリースモデル解説 @ 富山 BuriKaigi 2019
Takashi Ito
 
今年はJava進化の年!今知っておくべき新しいJava
Takashi Ito
 
Java EE, What's Next? by Anil Gaur
Takashi Ito
 
20161119 java one-feedback_osaka
Takashi Ito
 
20161111 java one2016-feedback
Takashi Ito
 
JavaOne2015フィードバック @ 富山合同勉強会
Takashi Ito
 
20160123 java one2015_feedback @ Osaka
Takashi Ito
 

Recently uploaded (20)

PPTX
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
PDF
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Become an Agentblazer Champion Challenge Kickoff
Dele Amefo
 
PDF
Build Multi-agent using Agent Development Kit
FadyIbrahim23
 
PPTX
Smart Panchayat Raj e-Governance App.pptx
Rohitnikam33
 
PDF
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
PDF
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
PDF
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
PPTX
Why Use Open Source Reporting Tools for Business Intelligence.pptx
Varsha Nayak
 
PPTX
Presentation about variables and constant.pptx
kr2589474
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Become an Agentblazer Champion Challenge Kickoff
Dele Amefo
 
Build Multi-agent using Agent Development Kit
FadyIbrahim23
 
Smart Panchayat Raj e-Governance App.pptx
Rohitnikam33
 
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
Why Use Open Source Reporting Tools for Business Intelligence.pptx
Varsha Nayak
 
Presentation about variables and constant.pptx
kr2589474
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 

112815 java ee8_davidd

  • 1. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Java EE 8 - Work in Progress David Delabassee @delabassee Oracle Corporation JJUG CCC 2015 Fall
  • 2. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 2
  • 3. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Program Agenda Quick recap of goals and themes of Java EE 8 What we have accomplished How you can get involved 1 2 3 3
  • 4. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Industry Trends Cloud 4
  • 5. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Java EE 8 – Driven by Community Feedback http://glassfish.org/survey 5
  • 6. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Java EE 8 Themes • HTML5 / Web Tier Enhancements • Ease of Development • Infrastructure for running in the Cloud 6
  • 7. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. HTML5 Support / Web Tier Enhancements • JSON Binding • JSON Processing enhancements • Server-sent events • Action-based MVC • HTTP/2 support 7
  • 8. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JSON-B 1.0 • API to marshal/unmarshal Java objects to/from JSON – Similar to JAXB runtime API in XML world • Draw from best practices of existing JSON binding implementations – MOXy, Jackson, GSON, Genson, Xstream, … – Allow switch of JSON binding providers • Default mapping of classes to JSON – Annotations to customize the default mappings – JsonbProperty, JsonbTransient, JsonbNillable, JsonbValue, … Java API for JSON Binding 8
  • 9. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JSON-B 1.0 @Entity public class Person { @Id String name; String gender; @ElementCollection Map<String,String> phones; ... // getters and setters } Person duke = new Person(); duke.setName("Duke"); duke.setGender("M"); phones = new HashMap<String,String>(); phones.put("home", "650-123-4567"); phones.put("mobile", "650-234-5678"); duke.setPhones(phones); Jsonb jsonb = JsonbBuilder.create(); String person = jsonb.toJson(duke); { "name":"Duke", "gender":"M", "phones":{ "home":"650-123-4567", "mobile":"650-234-5678"} } 9
  • 10. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JSON-P 1.1 • Keep JSON-P spec up-to-date • Track new standards • Add editing operations to JsonObject and JsonArray • Helper classes and methods to better utilize SE 8’s stream operations Java API for JSON Processing 10
  • 11. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JSON-P 1.1 • JSON-Pointer – IETF RFC 6901 – String syntax for referencing a value "/0/phones/mobile" Tracking new standards 11
  • 12. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JSON-P 1.1 JsonArray contacts = ...; JsonPointer p = new JsonPointer("/0/phones/mobile"); JsonValue v = p.getValue(contacts); [ { "name":"Duke", "gender":"M", "phones":{ "home":"650-123-4567", "mobile":"650-234-5678"}}, { "name":"Jane", "gender":"F", "phones":{ "mobile":"707-555-9999"}} ] 12
  • 13. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JSON-P 1.1 JsonArray contacts = ...; JsonPointer p = new JsonPointer("/0/phones/mobile"); JsonArray newContacts = p.replace(contacts, "650-555-1234"); [ { "name":"Duke", "gender":"M", "phones":{ "home":"650-123-4567", "mobile":"650-234-5678"}}, { "name":"Jane", "gender":"F", "phones":{ "mobile":"707-555-9999"}} ] 13
  • 14. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JSON-P 1.1 JsonArray contacts = ...; JsonPointer p = new JsonPointer("/0/phones/mobile"); JsonArray newContacts = p.replace(contacts, "650-555-1234"); [ { "name":"Duke", "gender":"M", "phones":{ "home":"650-123-4567", "mobile":"650-555-1234"}}, { "name":"Jane", "gender":"F", "phones":{ "mobile":"707-555-9999"}} ] 14
  • 15. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JSON-P 1.1 • JSON-Patch – IETF RFC 6902 • Patch is a JSON document – Array of objects / operations for modifying a JSON document – add, replace, remove, move, copy, test – Must have "op" field and "path" field [ {"op":"replace", "path":"/0/phones/mobile", "value":"650-111-2222"}, {"op":"remove", "path":"/1"} ] Tracking new standards 15
  • 16. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JSON-P 1.1 JSON Query using Streams API JsonArray contacts = ...; List<String> femaleNames = contacts.getValuesAs(JsonObject.class).stream() .filter(x->"F".equals(x.getString("gender"))) .map(x->(x.getString("name")) .collect(Collectors.toList()); JsonArray femaleNames = contacts.getValuesAs(JsonObject.class).stream() .filter(x->"F".equals(x.getString("gender"))) .map(x->(x.getString("name")) .collect(JsonCollectors.toJsonArray()); 16
  • 17. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Server-sent Events • Part of HTML5 standardization • Server-to-client streaming of text data • Mime type is text/event-stream • Long-lived HTTP connection – Client establishes connection – Server pushes update notifications to client – Commonly used for one-way transmission for period updates or updates due to events 17
  • 18. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Server-sent Events • JAX-RS a natural fit – Streaming HTTP resources already supported – Small extension • Server API: new media type; EventOutput • Client API: new handler for server side events – Convenience of mixing with other HTTP operations; new media type – Jersey (JAX-RS RI) already supports SSE 18
  • 19. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Server-sent Events @Path("tickers") public class StockTicker { @Get @Produces("text/event-stream") public EventOutput getQuotes() { EventOutput eo = new EventOutput(); new StockThread(eo).start(); return eo; } } JAX-RS resource class 19
  • 20. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Server-sent Events JAX-RS StockThread class class StockThread extends Thread { private EventOutput eo; private AtomicBoolean ab = new AtomicBoolean(true); public StockThread(EventOutput eo) { this.eo = eo; } public void terminate() { ab.set(false); } @Override public void run() { while (ab.get()) { try { // ... eo.send(new StockQuote("...")); // ... } catch (IOException e) { // ... } } } } 20
  • 21. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Server-sent Events WebTarget target = client.target("http://example.com/tickers"); EventSource eventSource = new EventSource(target) { @Override public void onEvent(InboundEvent inboundEvent) { StockQuote sq = inboundEvent.readData(StockQuote.class); // ... } }; eventSource.open(); JAX-RS Client 21
  • 22. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Model View Controller (MVC) • Component-based MVC – Controller provided by the framework – JSF, Wicket, Tapestry… • Action-based MVC – Controllers defined by the application – Struts 2, Spring MVC… 2 Styles 22
  • 23. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. MVC 1.0 • Action-based model-view-controller architecture • Glues together key Java EE technologies: – Model • CDI, Bean Validation, JPA – View • Facelets, JSP – Controller • JAX-RS resource methods 23
  • 24. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. MVC 1.0 @Path("hello") public class HelloController { @Inject private Greeting greeting; @GET @Controller public String hello() { greeting.setMessage("Hello Tokyo!"); return "hello.jsp"; } } Model Controller @Named @RequestScoped public class Greeting { private String message; public String getMessage() { return message; } public void setMessage(message) { this.message = message; } } 24
  • 25. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. MVC 1.0 <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>Hello</title> </head> <body> <h1>${greeting.message}</h1> </body> </html> View 25
  • 26. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. HTTP/2 • HTTP 1.1 uses TCP poorly – HTTP flows are short and bursty – TCP was built for long-lived flows • Workarounds – Sprites – Domain sharding – Inlining – File concatenation Address the Limitations of HTTP 1.x 26
  • 27. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. HTTP/2 HTTP/2 Goals • Reduce latency • Address the HOL blocking problem • Support parallelism (without requiring multiple connections) • Define interaction with HTTP 1.x • Retain semantics of HTTP 1.1 Address the Limitations of HTTP 1.x 27
  • 28. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. HTTP/2 • Binary Framing • Request/Response multiplexing over single connection – Fully bidirectional – Multiple streams • Server Push • Header Compression • Upgrade from HTTP 1.1 • Stream Prioritization Features 28
  • 29. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Servlet 4.0 • Binary Framing • Request/Response multiplexing – Servlet Request as HTTP/2 message • Upgrade from HTTP 1.1 • Server Push • Stream prioritization HTTP/2 Features in Servlet API 29
  • 30. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Ease of Development • CDI alignment • Security interceptors • Simplified messaging with JMS message-driven beans • JAX-RS injection alignment • WebSocket scopes • Pruning of EJB 2.x client view and IIOP interoperability 30
  • 31. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Java EE Security 1.0 @IsAuthorized("hasRoles('Manager') && schedule.officeHrs") void transferFunds() @IsAuthorized("hasRoles('Manager') && hasAttribute('directReports', employee.id)") double getSalary(long employeeId); @IsAuthorized(ruleSourceName="java:app/payrollAuthRules", rule="report") void displayReport(); Authorization via CDI Interceptors 31
  • 32. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JMS 2.1 • Continue the ease-of-use improvements started in JMS 2.0 • Improve the API for receiving messages asynchronously – Improve JMS MDBs – Provide alternative to JMS MDBs New API to receive messages asynchronously 32
  • 33. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. CDI 2.0 • Modularity • Java SE support • Asynchronous Events • Event ordering • … 33
  • 34. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Modernize the Infrastructure • Java EE Management 2.0 – REST-based APIs for Management and Deployment • Java EE Security 1.0 – Authorization – Password Aliasing – User Management – Role Mapping – Authentication – REST Authentication For On-Premise and for in the Cloud 34
  • 35. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Java EE 8 JSRs • Java EE 8 Platform (JSR 366) • CDI 2.0 (JSR 365) • JSON Binding 1.0 (JSR 367) • JMS 2.1 (JSR 368) • Java Servlet 4.0 (JSR 369) • JAX-RS 2.1 (JSR 370) • MVC 1.0 (JSR 371) • JSF 2.3 (JSR 372) • Java EE Management 2.0 (JSR 373) • JSON-P 1.1 (JSR 374) • Java EE Security 1.0 (JSR 375) 35
  • 36. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Expected MRs and small JSRs • Connector Architecture • WebSocket • Interceptors • JPA • EJB • JTA • Bean Validation • Batch • JavaMail • … 36
  • 37. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Transparency • Our Java EE 8 JSRs run in the open on java.net – http://javaee-spec.java.net – One project per JSR – jax-rs-spec, mvc-spec, servlet-spec,… – https://java.net/projects/javaee-spec/pages/Specifications • Publically viewable Expert Group mail archive – Users observer lists gets all copies • Publicly accessible download area • Publicly accessible issue tracker / JIRA • … Commitment to JCP transparent processes 37
  • 38. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. How to Get Involved • Join an Expert Group project – http://javaee-spec.java.net – https://java.net/projects/javaee-spec/pages/Specifications • Adopt a JSR – http://glassfish.org/adoptajsr • The Aquarium – http://blogs.oracle.com/theaquarium • Java EE 8 Reference Implementation – http://glassfish.org 38