SlideShare a Scribd company logo
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Java EE for the Cloud
Dmitry Kornilov
JSONB/P Specification Lead
Oracle
@m0mus
October 20, 2016
Copyright © 2016, 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 © 2016, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Road to Java EE 8
Proposed Shift in Focus
Java EE 8 Revised Proposal
Java EE 9 Proposal
Q & A
1
2
3
4
3
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Road to Java EE 8
4
J2EE 1.2
J2EE 1.3
J2EE 1.4
Java EE 5
Java EE 6
Java EE 7
1999 2001 2003 2006 2009 2013
Servlet, JSP,
EJB, JMS, JTA,
RMI-IIOP
EJB 2.0, JSTL,
JAAS, JCA
EJB 2.1,
WebServices,
JAXP, JSF, JMX,
Deployment
EJB 3.0, JPA,
JAX-WS, JAXB,
SAAJ, StAX
JAX-RS,
Servlet 3.0,
EJB 3.1, JPA
2.0, CDI, BV
JAX-RS 2.0,
WebSocket,
JSON-P,
Concurrency,
JMS 2.0
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 5
Java EE 8 Community Survey
https://java.net/downloads/javaee-spec/JavaEE8_Community_Survey_Results.pdf
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 6
Java EE 7
Connector JAXBJSP Debugging
Managed BeansJSPConcurrency EE Interceptors JAX-WS WebSocket
Bean Validation JASPIC ServletJMS JTADeployment
Batch JACCDependency
Injection JAXR JSTL Management
CDI EJB JAX-RPC Web ServicesJSF Java Persistence
JSON-PCommon
Annotations EL JAX-RS Web Services
MetadataJavaMail
CDI
JSON-P
MVC
Bean Validation
JSF
JAX-RS
JSP
Servlet
Java EE 8 (Original Proposal, 2014)
JSON-B Security
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
“The world has changed. I see it in the
water. I feel it in the Earth. I smell it in
the air...”
– J.R.R. Tolkien
7
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Java EE - Available On Premise and in the Cloud
10/20/2016
Confidential – Oracle
8
Cloud
On Premise
WebSphere
WebLogic
Red Hat JBoss
8Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
Choice of
Implementations
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Java EE APIs - Backbone of Leading Open Source Projects
9
Java EE
Containers
Microservices Web
Containers
Web
Frameworks
PaaSREST
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 10
Java EE +
Cloud• More demanding business requirements
• Move to the Cloud for agility & flexibility
• Shift from physical infrastructure to virtual
• Microservices vs. monolithic applications
• Runtime packaged with applications
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Cloud Development
Heterogeneous Clients
• Mobile, REST, HTML5
Stateless Services
• Managed and scaled
independently
Data Sources
• Relational, non-relational
User profile
service
Order
service
Partner
service
Catalog
service
Notification
service
Import
service
HTTP/2 REST JSON XHR
Event JAX-RS/JSON Notifications JAX-WS
RDBMS NoSQL DB TSDBData Streams
Time SeriesEventsKey ValueJDBC
11
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
It's Confusing!
12
Too many choices...
Which components?
Overall architecture?
Standards?
Vendor commitment?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Proposed Enhancements to Java EE
• New AppDev style for Cloud and Microservices
• Build on proven technologies
• Comprehensive
– Programming Model, Packaging, Portability
• Standards-based
– This is a proposal only
– Will work with the community and follow the JCP process
13
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Designed for Agility and Scalability with Security
• Programming Model
– Reactive programming
– Unified event model
• Eventual Consistency
– Automatically event out changes to observed data structures
– Data sources with manageable consistency
• NoSQL
– Persistence and query interface for Key Value and Document DB
• Security
– Support of OAuth2, OpenID Connect
– Secret management
14
App
App
App
App
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Location Transparency and Resiliency
• Configuration
– Externalized configuration
– Multiple configuration sources
• State
– API for external state
• Resiliency
– Circuit breakers
– Health check API
15
Reliability, Monitoring
Container Management
Scheduling & Elastic Scaling
Key Value
Database
Logging
Configuration
State
Security
Notification
User profile
service
Order
service
Catalog
service
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Packaging and Simplicity
• Packaging
– Package applications, runtimes into containers
– Standalone immutable executable binary
– Multi-artifact archives
– Leveraging Java 9 module system
• Serverless
– Ephemeral instantiation
• Multitenancy
– Increased density
– Tenant-aware
16
App
Server
Order
service
App
Server
Catalog
service
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Recent Java EE 7 compatibility updates: Congratulations!Technical Focus Areas
17
 Extend for reactive
programming
 Unified event model
 Event messaging API
 JAX-RS, HTTP/2, Lambda,
JSON-B, ...
Programming Model
 API to store externalized
state
 Automatically event out
changes to observed data
structures
 Extension to support
client-side circuit breakers
 Resilient commands
 Standardize on client-side
format for reporting
health
 New spec – interfaces,
packaging format,
manifest
 Ephemeral instantiation
 Secret management
 OAuth
 OpenID
 Package applications,
runtimes into services
 Standalone immutable
executable binary
 Multi-artifact archives
 Increased density
 Tenant-aware routing and
deployment
 Externalize configuration
 Unified API for accessing
configuration
 Persistence and query
interface for key value and
document DB
Key Value/Doc Store Configuration Resiliency
Packaging
Eventual Consistency
Serverless
Multitenancy
State
Security
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 18
Engage Java EE Community
• Feedback through Survey
• Launch Java EE Next JSRs
2016
Java EE 8
• Specs, RI, TCK complete
• Initial microservices support
• Define Java EE 9
• Early access implementation
of Java EE 9
Java EE 9
• Specs, RI, TCK complete
• Modular Java EE runtime
• Enhanced microservices
support
Java EE Roadmap
2017
2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
We Are Hiring
• Senior Java Developer
– Work on JAX-RS, HTTP/2 and Servlet projects
– Participate in specifications development
– Working on Reference Implementations and TCKs
– Participate in community reviews, forums, mailing lists
– Strong experience in Java and Java EE (5+ years)
– Full description
• Contacts
– dmitry.kornilov@oracle.com
19
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
We Need Your Feedback
20
Take the Java Community Survey
http://glassfish.org/survey
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Java EE 8 Revised Proposal
21
 JSON <-> object mapping
JSON-B 1.0 (JSR 367)
No Change
Proposed to Drop
Proposed to Add
 JSON Pointer
 JSON Patch
 Java 8 Lambda support
JSON-P 1.1 (JSR 374)
 Reactive enhancements
 Server-sent events
 Non-blocking I/O
 Client-side circuit breakers
JAX-RS 2.1 (JSR 370)
 HTTP/2 support
Servlet 4.0 (JSR 369)
 Small-scale new features
 Community-driven improvements
JSF 2.3 (JSR 372)
 Action-based MVC framework
MVC 1.0 (JSR 371)
 Bootstrap API for Java SE
 Asynchronous events
 Observer ordering
CDI 2.0 (JSR 365)
 Collection constraints
 Date/Time support
 Community-requested features
Bean Validation 2.0 (JSR 380)
 Authentication/authorization APIs
 OAuth support
 OpenID support
 Secret management
Security 1.0 (JSR 375)
 REST-based APIs
Management 2.0 (JSR 373)
 Flexible JMS MDBs
 Improved XA support
JMS 2.1 (JSR 368)
 Externalized configuration
 Multiple configuration sources
 Layering and overrides
Configuration
 Client-side health checking
Health Checking
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 22
Java EE 7
Connector JAXBJSP Debugging
Managed BeansJSPConcurrency EE Interceptors JAX-WS WebSocket
Bean Validation JASPIC ServletJMS JTADeployment
Batch JACCDependency
Injection JAXR JSTL Management
CDI EJB JAX-RPC Web ServicesJSF Java Persistence
JSON-PCommon
Annotations EL JAX-RS Web Services
MetadataJavaMail
CDI
JSON-P
Security
Bean Validation
JSF
JAX-RS
JSP
Servlet
Health CheckConfiguration
Java EE 8 (Revised Proposal, 2016)
JSON-B
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
JSON-P 1.1
• Update JSON-P spec to stay current with emerging standards (RFC 7159)
• Support for IETF standards on
– JSON Pointer (RFC 6901)
– JSON Patch (RFC 6902)
– JSON Merge Patch (RFC 7396)
• Add editing/transformation operations to JSON objects and arrays
• Support for a streaming API, together with Collectors
• Support for processing big JSON, e.g. add filters to JSON parsing.
23
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
JSON Pointer Sample
JsonArray dogs = . . .;
JsonPointer pointer =
Json.createPointer("/1/breed");
JsonValue breed =
pointer.getValue(dogs);
p.replace(dogs,
Json.createValue("English Bulldog"));
24
[
{
"name": "Cassidy",
"breed": "English Bulldog",
"age": 6
},
{
"name": "Falco",
"breed": "Pug",
"age": 4
}
]
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
JSON Patch Sample
• Modify Parts of JSON document
• Patch is a JSON document itself
• Operations:
– Add, replace, remove, move, copy, test
25
[
{
"name": "Cassidy",
"breed": "English Bulldog",
"age": 6
},
{
"name": "Falco",
"breed": "Pug",
"age": 4
},
{
"name": "Funes",
"breed": "Frenchie",
"age": 2
}
]
[
{ "op": "replace",
"path": "/1/breed",
"value": "English Bulldog" },
{ "op": "remove",
"path": "/2" }
]
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
JSON-B 1.0
• API to serialize/deserialize Java objects to/from JSON documents
– Similar to JAX-B
– Standardizes the current technologies (Jackson, Genson, Gson)
• Default mapping between classes and JSON
• Customization APIs
– Annotations (@JsonbProperty, @JsonbNillable)
– Runtime configuration builder
• Natural follow on to JSON-P
– Closes the JSON support gap
– Allows to change providers
26
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
JSON-B Sample
27
Dog dog1 = new Dog();
dog1.setName("Cassidy");
dog1.setBreed("English Bulldog");
dog1.setAge(6);
Dog dog2 = new Dog();
dog2.setName("Falco");
dog2.setBreed("English Bulldog");
dog2.setAge(4);
List<Dog> dogs = new ArrayList<>();
dogs.add(dog1);
dogs.add(dog2);
Jsonb jsonb = JsonbBuilder.create();
jsonb.toJson(dogs);
[
{
"name": "Cassidy",
"breed": "English Bulldog",
"age": 6
},
{
"name": "Falco",
"breed": "English Bulldog",
"age": 4
}
]
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
CDI 2.0
• Define behavior of CDI outside of a Java EE container
• Make CDI more modular to help other Java EE specs better integrate with it
– Core CDI
– CDI in Java SE
– CDI in Java EE
• API to bootstrap a CDI container in Java SE
• Observer ordering
• Asynchronous event firing
28
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
JAX-RS 2.1
• Server-sent events
• Non-blocking I/O in providers (filters, interceptors…)
• Reactive programming paradigm to improve JAX-RS asynchronous clients
• Hypermedia API enhancements
• Integration with other JSRs and frameworks
• Circuit breakers
29
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SSE – Server Code
30
@Path("tickers")
public class StockTicker {
@Resource ManagedExecutorService executor;
@GET @Produces("text/event-stream")
public EventOutput getQuotes() {
EventOutput output = new EventOutput();
executor.execute(() -> {
...
output.send(new StockQuote(...));
...
});
return output;
}
}
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SSE – Client Code
31
WebTarget target = client.target("http://example.com/tickers");
EventSource eventSource = new EventSource(target) {
@Override
public void onEvent(InboundEvent inboundEvent) {
StockQuote quote = inboundEvent.readData(StockQuote.class);
...
}
};
eventSource.open();
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Servlet 4.0
• Support for HTTP/2
– Request/response multiplexing
– Server push
– Upgrade from HTTP 1.1
• Compatibility with latest HTTP 1.1 RFCs
• Smaller community-requested improvements (JIRA issues)
32
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
JSF 2.3
• Better CDI integration
• WebSocket integration
• Ajax method invocation
• Class-level Bean Validation
• Java Date/Time support
33
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Java EE Security 1.0
• API for managing users and groups
• Simple security providers
• Support for password aliasing
• API for role mapping
• Metadata and API for authentication
• Interceptors for authorization, with CDI support
• OAuth and OpenID Connect support
• Secret management
34
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Simple Security Providers
35
@EmbedddedSecurityProvider({
@Credentials(username="user1", password="password", roles="admin"),
@Credentials(username="user2", password="password", roles="user")})
@DatabaseSecurityProvider(
lookup="java:global/MyDB",
userQuery="SELECT password FROM principals WHERE username=?",
rolesQuery="SELECT role FROM roles where username=?", ...)
@LdapSecurityProvider(url="...", dnPrefix="...", dnSuffix="...", ...)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Bean Validation 2.0
• Constraints applied to collection elements
• Support for new Date/Time API
• Integration with Optional wrappers
• Repeatable annotations
• Additional features requested from community
36
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Java EE Configuration
• Unified API
• Externalized configuration
• Support of multiple configuration sources
– Properties, xml and json
• Layering and overrides
• Optional configuration descriptor
• Dynamic configuration
• Integration with other Java EE frameworks
37
Java EE
Config
XML JSONprop
DBweb
Application
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Java EE Configuration
• Unified API
• Externalized configuration
• Support of multiple configuration sources
– Properties, xml and json formats support out of the box
• Layering and overrides
38
Java EE 8
• Optional configuration descriptor
• Dynamic configuration
• Integration with other Java EE frameworks
Java EE 9
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
API
39
a=JavaOne
b=9
c=2016
Config config = ConfigProvider.getConfig();
// Returns "JavaOne"
String a = config.getProperty("a");
// Returns string "9"
String b = config.getProperty("b");
// Returns null
String notExists = config.getProperty("not.exist");
// Returns string "default"
String notExistsDefault = config.getProperty("not.exist","default");
// Returns number 2016
Long c = config.getProperty("c", Long.class);
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Defining Configuration Sources
40
• Using config.sources runtime parameter
• Using API
• Using config-sources.xml
java –jar my.jar –Dconfig.source=/cfg/config.json,http://shared/global.xml
Config config = ConfigProvider.builder()
.addSource(new FileSource("/cfg/config.json"), 200)
.addSource(new WebSource("http://shared/global.xml"), 100)
.build();
<config-sources>
<source>/cfg/config.json</source>
<source>http://shared/config.xml</source>
</config-sources>
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Health Check
• Standard health-check end-point
– <service>/management/health
– Services can choose to over-ride default location
• Define a format of health-check
– JSON, XML
• Health-check Java API
– Annotations
– Lightweight Java API
41
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Health Check Sample
42
public class MyHealthContributor {
// Variant example which does not take a HealthContext.
// Directly callable with REST
@HealthProvider
@Path("bar")
@GET
public Health contributeHealthSummary() {
Health health = new Health();
...
return health;
}
}
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Eventing API
• Make event producer and consumer as top level configurable, injectable
objects
• Be able to send and receive events synchronously and asynchronously
• Incorporate reactive style in API
– Use Java 9 Flow for batched asynchronous event sending
• Be able to programmatically start and stop asynchronous event consumer
• Provide pluggability of underlying messaging system
– Kafka, ZeroMQ, RabbitMQ
• Integration with Java EE Configuration API
43
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Eventing API Example
44
@Inject
@EventConfig(configkey="myeventconfig")
EventProducer producer;
public void someMethod() {
producer.sendEvent("My event: hello");
}
@Inject
@EventConfig(configkey="myeventconfig")
EventConsumer consumer;
public void someMethod() {
System.out.println(consumer.receiveEvent(1000L));
}
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Q & A
45
Java EE for the Cloud

More Related Content

PPTX
Adopt-a-JSR session (JSON-B/P)
PPTX
What's new in the Java API for JSON Binding
PPTX
Configuration for Java EE and the Cloud
PPTX
JSON-B for CZJUG
PPTX
Configuration for Java EE: Config JSR and Tamaya
DOCX
Aneez Hasan_Resume
PDF
What’s new in JSR 367 Java API for JSON Binding
PDF
JSONB introduction and comparison with other frameworks
Adopt-a-JSR session (JSON-B/P)
What's new in the Java API for JSON Binding
Configuration for Java EE and the Cloud
JSON-B for CZJUG
Configuration for Java EE: Config JSR and Tamaya
Aneez Hasan_Resume
What’s new in JSR 367 Java API for JSON Binding
JSONB introduction and comparison with other frameworks

What's hot (20)

PDF
JSON support in Java EE 8
PDF
Oracle Keynote from JMagghreb 2014
PDF
Java: Create The Future Keynote
PDF
Adopt-a-JSR for JSON Processing 1.1, JSR 374
PDF
Java EE 8 Overview (Japanese)
PDF
JavaCro'15 - Java Certification – in theory and practice - Branko Mihaljević,...
PPTX
Modularization With Project Jigsaw in JDK 9
PDF
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
PDF
What's coming in Java EE 8
PPTX
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
PPTX
JSF 2.3 Adopt-a-JSR 10 Minute Infodeck
PDF
JavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
PDF
JavaOne 2014 Java EE 8 Booth Slides
PDF
JavaOne2015報告会 in Okinawa
PDF
Java EE 8 - An instant snapshot
PPTX
Oracle REST Data Services
PPT
What's New in WebLogic 12.1.3 and Beyond
PPTX
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
PDF
Java EE 7 and HTML5: Developing for the Cloud
PDF
Harnessing the Power of Optimizer Hints
JSON support in Java EE 8
Oracle Keynote from JMagghreb 2014
Java: Create The Future Keynote
Adopt-a-JSR for JSON Processing 1.1, JSR 374
Java EE 8 Overview (Japanese)
JavaCro'15 - Java Certification – in theory and practice - Branko Mihaljević,...
Modularization With Project Jigsaw in JDK 9
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
What's coming in Java EE 8
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
JSF 2.3 Adopt-a-JSR 10 Minute Infodeck
JavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
JavaOne 2014 Java EE 8 Booth Slides
JavaOne2015報告会 in Okinawa
Java EE 8 - An instant snapshot
Oracle REST Data Services
What's New in WebLogic 12.1.3 and Beyond
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
Java EE 7 and HTML5: Developing for the Cloud
Harnessing the Power of Optimizer Hints
Ad

Similar to Java EE for the Cloud (20)

PDF
Java EE, What's Next? by Anil Gaur
PPTX
Oracle JET overview
PDF
RMOUG MySQL 5.7 New Features
PPT
Java EE7 in action
PDF
JDK 10 Java Module System
PPT
Have You Seen Java EE Lately?
PDF
B1 roadmap to cloud platform with oracle web logic server-oracle coherence ...
PDF
Enterprise java unit-1_chapter-1
PPTX
Java @ Cloud - Setor Público SP
PPT
WebLogic 12c - OMF Canberra June 2014
PPTX
ODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptx
PDF
The State of Java under Oracle at JCertif 2011
PDF
20160123 java one2015_feedback @ Osaka
PPTX
Coherence RoadMap 2018
PDF
Servidores de Aplicação: por que ainda precisamos deles?
PPTX
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
PDF
JDK 8 and JDK 8 Updates in OpenJDK
PDF
Building Java Desktop Apps with JavaFX 8 and Java EE 7
PPTX
Java EE Arquillian Testing with Docker & The Cloud
PDF
Java EE 7 for WebLogic 12c Developers
Java EE, What's Next? by Anil Gaur
Oracle JET overview
RMOUG MySQL 5.7 New Features
Java EE7 in action
JDK 10 Java Module System
Have You Seen Java EE Lately?
B1 roadmap to cloud platform with oracle web logic server-oracle coherence ...
Enterprise java unit-1_chapter-1
Java @ Cloud - Setor Público SP
WebLogic 12c - OMF Canberra June 2014
ODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptx
The State of Java under Oracle at JCertif 2011
20160123 java one2015_feedback @ Osaka
Coherence RoadMap 2018
Servidores de Aplicação: por que ainda precisamos deles?
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
JDK 8 and JDK 8 Updates in OpenJDK
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Java EE Arquillian Testing with Docker & The Cloud
Java EE 7 for WebLogic 12c Developers
Ad

More from Dmitry Kornilov (12)

PPTX
Helidon Nima - Loom based microserfice framework.pptx
PPTX
Jakarta EE: Today and Tomorrow
PPTX
Building Cloud-Native Applications with Helidon
PPTX
Nonblocking Database Access in Helidon SE
PPTX
JSON Support in Jakarta EE: Present and Future
PPTX
Building cloud native microservices with project Helidon
PPTX
Developing cloud-native microservices using project Helidon
PPTX
From Java EE to Jakarta EE
PPTX
Helidon: Java Libraries for Writing Microservices
PPTX
Introduction to Yasson
PPTX
JSON Support in Java EE 8
PPTX
JSON Support in Java EE 8
Helidon Nima - Loom based microserfice framework.pptx
Jakarta EE: Today and Tomorrow
Building Cloud-Native Applications with Helidon
Nonblocking Database Access in Helidon SE
JSON Support in Jakarta EE: Present and Future
Building cloud native microservices with project Helidon
Developing cloud-native microservices using project Helidon
From Java EE to Jakarta EE
Helidon: Java Libraries for Writing Microservices
Introduction to Yasson
JSON Support in Java EE 8
JSON Support in Java EE 8

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Empathic Computing: Creating Shared Understanding
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Cloud computing and distributed systems.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Approach and Philosophy of On baking technology
PPTX
sap open course for s4hana steps from ECC to s4
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Spectral efficient network and resource selection model in 5G networks
PPT
Teaching material agriculture food technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Programs and apps: productivity, graphics, security and other tools
Empathic Computing: Creating Shared Understanding
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Mobile App Security Testing_ A Comprehensive Guide.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Cloud computing and distributed systems.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Electronic commerce courselecture one. Pdf
MYSQL Presentation for SQL database connectivity
Reach Out and Touch Someone: Haptics and Empathic Computing
The AUB Centre for AI in Media Proposal.docx
Advanced methodologies resolving dimensionality complications for autism neur...
Approach and Philosophy of On baking technology
sap open course for s4hana steps from ECC to s4
The Rise and Fall of 3GPP – Time for a Sabbatical?
Spectral efficient network and resource selection model in 5G networks
Teaching material agriculture food technology
Network Security Unit 5.pdf for BCA BBA.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton

Java EE for the Cloud

  • 1. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Java EE for the Cloud Dmitry Kornilov JSONB/P Specification Lead Oracle @m0mus October 20, 2016
  • 2. Copyright © 2016, 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 © 2016, Oracle and/or its affiliates. All rights reserved. | Program Agenda Road to Java EE 8 Proposed Shift in Focus Java EE 8 Revised Proposal Java EE 9 Proposal Q & A 1 2 3 4 3 5
  • 4. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Road to Java EE 8 4 J2EE 1.2 J2EE 1.3 J2EE 1.4 Java EE 5 Java EE 6 Java EE 7 1999 2001 2003 2006 2009 2013 Servlet, JSP, EJB, JMS, JTA, RMI-IIOP EJB 2.0, JSTL, JAAS, JCA EJB 2.1, WebServices, JAXP, JSF, JMX, Deployment EJB 3.0, JPA, JAX-WS, JAXB, SAAJ, StAX JAX-RS, Servlet 3.0, EJB 3.1, JPA 2.0, CDI, BV JAX-RS 2.0, WebSocket, JSON-P, Concurrency, JMS 2.0
  • 5. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 5 Java EE 8 Community Survey https://java.net/downloads/javaee-spec/JavaEE8_Community_Survey_Results.pdf
  • 6. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 6 Java EE 7 Connector JAXBJSP Debugging Managed BeansJSPConcurrency EE Interceptors JAX-WS WebSocket Bean Validation JASPIC ServletJMS JTADeployment Batch JACCDependency Injection JAXR JSTL Management CDI EJB JAX-RPC Web ServicesJSF Java Persistence JSON-PCommon Annotations EL JAX-RS Web Services MetadataJavaMail CDI JSON-P MVC Bean Validation JSF JAX-RS JSP Servlet Java EE 8 (Original Proposal, 2014) JSON-B Security
  • 7. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | “The world has changed. I see it in the water. I feel it in the Earth. I smell it in the air...” – J.R.R. Tolkien 7
  • 8. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Java EE - Available On Premise and in the Cloud 10/20/2016 Confidential – Oracle 8 Cloud On Premise WebSphere WebLogic Red Hat JBoss 8Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Choice of Implementations
  • 9. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Java EE APIs - Backbone of Leading Open Source Projects 9 Java EE Containers Microservices Web Containers Web Frameworks PaaSREST
  • 10. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 10 Java EE + Cloud• More demanding business requirements • Move to the Cloud for agility & flexibility • Shift from physical infrastructure to virtual • Microservices vs. monolithic applications • Runtime packaged with applications
  • 11. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Cloud Development Heterogeneous Clients • Mobile, REST, HTML5 Stateless Services • Managed and scaled independently Data Sources • Relational, non-relational User profile service Order service Partner service Catalog service Notification service Import service HTTP/2 REST JSON XHR Event JAX-RS/JSON Notifications JAX-WS RDBMS NoSQL DB TSDBData Streams Time SeriesEventsKey ValueJDBC 11
  • 12. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | It's Confusing! 12 Too many choices... Which components? Overall architecture? Standards? Vendor commitment?
  • 13. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Proposed Enhancements to Java EE • New AppDev style for Cloud and Microservices • Build on proven technologies • Comprehensive – Programming Model, Packaging, Portability • Standards-based – This is a proposal only – Will work with the community and follow the JCP process 13
  • 14. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Designed for Agility and Scalability with Security • Programming Model – Reactive programming – Unified event model • Eventual Consistency – Automatically event out changes to observed data structures – Data sources with manageable consistency • NoSQL – Persistence and query interface for Key Value and Document DB • Security – Support of OAuth2, OpenID Connect – Secret management 14 App App App App
  • 15. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Location Transparency and Resiliency • Configuration – Externalized configuration – Multiple configuration sources • State – API for external state • Resiliency – Circuit breakers – Health check API 15 Reliability, Monitoring Container Management Scheduling & Elastic Scaling Key Value Database Logging Configuration State Security Notification User profile service Order service Catalog service
  • 16. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Packaging and Simplicity • Packaging – Package applications, runtimes into containers – Standalone immutable executable binary – Multi-artifact archives – Leveraging Java 9 module system • Serverless – Ephemeral instantiation • Multitenancy – Increased density – Tenant-aware 16 App Server Order service App Server Catalog service
  • 17. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Recent Java EE 7 compatibility updates: Congratulations!Technical Focus Areas 17  Extend for reactive programming  Unified event model  Event messaging API  JAX-RS, HTTP/2, Lambda, JSON-B, ... Programming Model  API to store externalized state  Automatically event out changes to observed data structures  Extension to support client-side circuit breakers  Resilient commands  Standardize on client-side format for reporting health  New spec – interfaces, packaging format, manifest  Ephemeral instantiation  Secret management  OAuth  OpenID  Package applications, runtimes into services  Standalone immutable executable binary  Multi-artifact archives  Increased density  Tenant-aware routing and deployment  Externalize configuration  Unified API for accessing configuration  Persistence and query interface for key value and document DB Key Value/Doc Store Configuration Resiliency Packaging Eventual Consistency Serverless Multitenancy State Security
  • 18. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 18 Engage Java EE Community • Feedback through Survey • Launch Java EE Next JSRs 2016 Java EE 8 • Specs, RI, TCK complete • Initial microservices support • Define Java EE 9 • Early access implementation of Java EE 9 Java EE 9 • Specs, RI, TCK complete • Modular Java EE runtime • Enhanced microservices support Java EE Roadmap 2017 2018
  • 19. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | We Are Hiring • Senior Java Developer – Work on JAX-RS, HTTP/2 and Servlet projects – Participate in specifications development – Working on Reference Implementations and TCKs – Participate in community reviews, forums, mailing lists – Strong experience in Java and Java EE (5+ years) – Full description • Contacts – dmitry.kornilov@oracle.com 19
  • 20. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | We Need Your Feedback 20 Take the Java Community Survey http://glassfish.org/survey
  • 21. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Java EE 8 Revised Proposal 21  JSON <-> object mapping JSON-B 1.0 (JSR 367) No Change Proposed to Drop Proposed to Add  JSON Pointer  JSON Patch  Java 8 Lambda support JSON-P 1.1 (JSR 374)  Reactive enhancements  Server-sent events  Non-blocking I/O  Client-side circuit breakers JAX-RS 2.1 (JSR 370)  HTTP/2 support Servlet 4.0 (JSR 369)  Small-scale new features  Community-driven improvements JSF 2.3 (JSR 372)  Action-based MVC framework MVC 1.0 (JSR 371)  Bootstrap API for Java SE  Asynchronous events  Observer ordering CDI 2.0 (JSR 365)  Collection constraints  Date/Time support  Community-requested features Bean Validation 2.0 (JSR 380)  Authentication/authorization APIs  OAuth support  OpenID support  Secret management Security 1.0 (JSR 375)  REST-based APIs Management 2.0 (JSR 373)  Flexible JMS MDBs  Improved XA support JMS 2.1 (JSR 368)  Externalized configuration  Multiple configuration sources  Layering and overrides Configuration  Client-side health checking Health Checking
  • 22. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 22 Java EE 7 Connector JAXBJSP Debugging Managed BeansJSPConcurrency EE Interceptors JAX-WS WebSocket Bean Validation JASPIC ServletJMS JTADeployment Batch JACCDependency Injection JAXR JSTL Management CDI EJB JAX-RPC Web ServicesJSF Java Persistence JSON-PCommon Annotations EL JAX-RS Web Services MetadataJavaMail CDI JSON-P Security Bean Validation JSF JAX-RS JSP Servlet Health CheckConfiguration Java EE 8 (Revised Proposal, 2016) JSON-B
  • 23. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | JSON-P 1.1 • Update JSON-P spec to stay current with emerging standards (RFC 7159) • Support for IETF standards on – JSON Pointer (RFC 6901) – JSON Patch (RFC 6902) – JSON Merge Patch (RFC 7396) • Add editing/transformation operations to JSON objects and arrays • Support for a streaming API, together with Collectors • Support for processing big JSON, e.g. add filters to JSON parsing. 23
  • 24. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | JSON Pointer Sample JsonArray dogs = . . .; JsonPointer pointer = Json.createPointer("/1/breed"); JsonValue breed = pointer.getValue(dogs); p.replace(dogs, Json.createValue("English Bulldog")); 24 [ { "name": "Cassidy", "breed": "English Bulldog", "age": 6 }, { "name": "Falco", "breed": "Pug", "age": 4 } ]
  • 25. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | JSON Patch Sample • Modify Parts of JSON document • Patch is a JSON document itself • Operations: – Add, replace, remove, move, copy, test 25 [ { "name": "Cassidy", "breed": "English Bulldog", "age": 6 }, { "name": "Falco", "breed": "Pug", "age": 4 }, { "name": "Funes", "breed": "Frenchie", "age": 2 } ] [ { "op": "replace", "path": "/1/breed", "value": "English Bulldog" }, { "op": "remove", "path": "/2" } ]
  • 26. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | JSON-B 1.0 • API to serialize/deserialize Java objects to/from JSON documents – Similar to JAX-B – Standardizes the current technologies (Jackson, Genson, Gson) • Default mapping between classes and JSON • Customization APIs – Annotations (@JsonbProperty, @JsonbNillable) – Runtime configuration builder • Natural follow on to JSON-P – Closes the JSON support gap – Allows to change providers 26
  • 27. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | JSON-B Sample 27 Dog dog1 = new Dog(); dog1.setName("Cassidy"); dog1.setBreed("English Bulldog"); dog1.setAge(6); Dog dog2 = new Dog(); dog2.setName("Falco"); dog2.setBreed("English Bulldog"); dog2.setAge(4); List<Dog> dogs = new ArrayList<>(); dogs.add(dog1); dogs.add(dog2); Jsonb jsonb = JsonbBuilder.create(); jsonb.toJson(dogs); [ { "name": "Cassidy", "breed": "English Bulldog", "age": 6 }, { "name": "Falco", "breed": "English Bulldog", "age": 4 } ]
  • 28. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | CDI 2.0 • Define behavior of CDI outside of a Java EE container • Make CDI more modular to help other Java EE specs better integrate with it – Core CDI – CDI in Java SE – CDI in Java EE • API to bootstrap a CDI container in Java SE • Observer ordering • Asynchronous event firing 28
  • 29. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | JAX-RS 2.1 • Server-sent events • Non-blocking I/O in providers (filters, interceptors…) • Reactive programming paradigm to improve JAX-RS asynchronous clients • Hypermedia API enhancements • Integration with other JSRs and frameworks • Circuit breakers 29
  • 30. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SSE – Server Code 30 @Path("tickers") public class StockTicker { @Resource ManagedExecutorService executor; @GET @Produces("text/event-stream") public EventOutput getQuotes() { EventOutput output = new EventOutput(); executor.execute(() -> { ... output.send(new StockQuote(...)); ... }); return output; } }
  • 31. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SSE – Client Code 31 WebTarget target = client.target("http://example.com/tickers"); EventSource eventSource = new EventSource(target) { @Override public void onEvent(InboundEvent inboundEvent) { StockQuote quote = inboundEvent.readData(StockQuote.class); ... } }; eventSource.open();
  • 32. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Servlet 4.0 • Support for HTTP/2 – Request/response multiplexing – Server push – Upgrade from HTTP 1.1 • Compatibility with latest HTTP 1.1 RFCs • Smaller community-requested improvements (JIRA issues) 32
  • 33. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | JSF 2.3 • Better CDI integration • WebSocket integration • Ajax method invocation • Class-level Bean Validation • Java Date/Time support 33
  • 34. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Java EE Security 1.0 • API for managing users and groups • Simple security providers • Support for password aliasing • API for role mapping • Metadata and API for authentication • Interceptors for authorization, with CDI support • OAuth and OpenID Connect support • Secret management 34
  • 35. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Simple Security Providers 35 @EmbedddedSecurityProvider({ @Credentials(username="user1", password="password", roles="admin"), @Credentials(username="user2", password="password", roles="user")}) @DatabaseSecurityProvider( lookup="java:global/MyDB", userQuery="SELECT password FROM principals WHERE username=?", rolesQuery="SELECT role FROM roles where username=?", ...) @LdapSecurityProvider(url="...", dnPrefix="...", dnSuffix="...", ...)
  • 36. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Bean Validation 2.0 • Constraints applied to collection elements • Support for new Date/Time API • Integration with Optional wrappers • Repeatable annotations • Additional features requested from community 36
  • 37. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Java EE Configuration • Unified API • Externalized configuration • Support of multiple configuration sources – Properties, xml and json • Layering and overrides • Optional configuration descriptor • Dynamic configuration • Integration with other Java EE frameworks 37 Java EE Config XML JSONprop DBweb Application
  • 38. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Java EE Configuration • Unified API • Externalized configuration • Support of multiple configuration sources – Properties, xml and json formats support out of the box • Layering and overrides 38 Java EE 8 • Optional configuration descriptor • Dynamic configuration • Integration with other Java EE frameworks Java EE 9
  • 39. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | API 39 a=JavaOne b=9 c=2016 Config config = ConfigProvider.getConfig(); // Returns "JavaOne" String a = config.getProperty("a"); // Returns string "9" String b = config.getProperty("b"); // Returns null String notExists = config.getProperty("not.exist"); // Returns string "default" String notExistsDefault = config.getProperty("not.exist","default"); // Returns number 2016 Long c = config.getProperty("c", Long.class);
  • 40. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Defining Configuration Sources 40 • Using config.sources runtime parameter • Using API • Using config-sources.xml java –jar my.jar –Dconfig.source=/cfg/config.json,http://shared/global.xml Config config = ConfigProvider.builder() .addSource(new FileSource("/cfg/config.json"), 200) .addSource(new WebSource("http://shared/global.xml"), 100) .build(); <config-sources> <source>/cfg/config.json</source> <source>http://shared/config.xml</source> </config-sources>
  • 41. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Health Check • Standard health-check end-point – <service>/management/health – Services can choose to over-ride default location • Define a format of health-check – JSON, XML • Health-check Java API – Annotations – Lightweight Java API 41
  • 42. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Health Check Sample 42 public class MyHealthContributor { // Variant example which does not take a HealthContext. // Directly callable with REST @HealthProvider @Path("bar") @GET public Health contributeHealthSummary() { Health health = new Health(); ... return health; } }
  • 43. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Eventing API • Make event producer and consumer as top level configurable, injectable objects • Be able to send and receive events synchronously and asynchronously • Incorporate reactive style in API – Use Java 9 Flow for batched asynchronous event sending • Be able to programmatically start and stop asynchronous event consumer • Provide pluggability of underlying messaging system – Kafka, ZeroMQ, RabbitMQ • Integration with Java EE Configuration API 43
  • 44. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Eventing API Example 44 @Inject @EventConfig(configkey="myeventconfig") EventProducer producer; public void someMethod() { producer.sendEvent("My event: hello"); } @Inject @EventConfig(configkey="myeventconfig") EventConsumer consumer; public void someMethod() { System.out.println(consumer.receiveEvent(1000L)); }
  • 45. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Q & A 45

Editor's Notes

  • #12: Let’s take a look at the cloud development model. When you look at it you more likely to see heterogeneous set of clients. They are applications on mobile phones, tablets and desktops using various of javascript and HTML5 frameworks using REST, HTTP or XML for communication with backends. Traditional RDMSes are used as a storage. Or many people started to use NoSQL databases, data streams or some other options are there. In between there is a collection of services (microservices). Typically, they are stateless. What developers want is an ability to manage their lifecycle independently. Not relying on some other person who is in charge of your AS administration. And you also want to scale them independently according to business needs.