SlideShare a Scribd company logo
Presente e Futuro:
Java EE.next()
Bruno Borges
Oracle Product Manager e Java Evangelist
blogs.oracle.com/brunoborges
@brunoborges
The preceding 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.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java EE 6
10 Dezembro, 2009

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java EE 6 – Estatísticas

 50+ Milhões de Downloads de Componentes Java EE 6
 #1 Escolha para Desenvolvedores Enterprise
 #1 Plataforma de Desenvolvimento de Aplicações
 Implementação mais Rápida de uma versão do Java EE

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Top Ten Features in Java EE 6

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

EJB packaging in a WAR
Type-safe dependency injection
Optional deployment descriptors (web.xml, faces-config.xml)
JSF standardizing on Facelets
One class per EJB
Servlet and CDI extension points
CDI Events
EJBContainer API
Cron-based @Schedule
Web Profile

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java EE 7 Scope
JSR 342
 Developer Productivity
– Less Boilerplate
– Richer Functionality
– More Defaults

 HTML5 Support
– WebSocket
– JSON
– HTML5 Forms

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java EE 7 Themes





 Batch Applications
 Concurrency Utilities
 Simplified JMS and
Compatibility

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

WebSocket
JSON Processing
Servlet 3.1 NIO
REST
HTML5-Friendly
Markup






More annotated POJOs
Less boilerplate code
Cohesive integrated platform
Default resources
WebSockets

Java EE 7 for Next Generation Applications

Deliver HTML5 Dynamic Scalable Apps

 Reduce response time with low latency data exchange using WebSockets
 Simplify data parsing for portable applications with standard JSON support
 Deliver asynchronous, scalable, high performance RESTful Services
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java EE 7 for the Developer
110101011101010011000101001001010001
PRODUCTIVITY
011001011010010011010010010100100001
001010100111010010110010101001011010
010010100100001001010100111010011101
010111010100110001010010010100010110
010110100100110100100101001000010010
101001110100101100101010010110100100
101001000010010101001110100100110101

Increased Developer Productivity

 Simplify application architecture with a cohesive integrated platform
 Increase efficiency with reduced boiler-plate code and broader use of annotations
 Enhance application portability with standard RESTful web service client support

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java EE 7 for the Enterprise
Scaling to the Most Demanding Requirements

 Break down batch jobs into manageable chunks for



Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

uninterrupted OLTP performance
Easily define multithreaded concurrent tasks for
improved scalability
Simplify application integration with standard Java
Messaging Service interoperability
Java EE 7 JSRs
CDI
Extensions

JSF 2.2,
JSP 2.3,
EL 3.0

Web
Fragments

JAX-RS 2.0,
JAX-WS 2.2

JSON 1.0

WebSocket
1.0

Servlet 3.1

CDI 1.1

Interceptors
1.2, JTA 1.2

Common
Annotations 1.1

EJB 3.2

Managed Beans 1.0

JPA 2.1

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

JMS 2.0

Concurrency 1.0

JCA 1.7

Batch 1.0
Top 10 Features Java EE 7
 WebSocket client/server endpoints
 Batch Applications
 JSON Processing
 Concurrency Utilities
 Simplified JMS API
 @Transactional and @TransactionScoped!
 JAX-RS Client API
 Default Resources
 More annotated POJOs
 Faces Flow
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java API for WebSocket 1.0
Annotated Endpoint
import javax.websocket.*;
@ServerEndpoint("/hello")
public class HelloBean {
@OnMessage
public String sayHello(String name) {
return “Hello “ + name;
}
}

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java API for WebSocket 1.0
Chat Server
@ServerEndpoint("/chat")
public class ChatBean {
static Set<Session> peers = Collections.synchronizedSet(…);
@OnOpen
public void onOpen(Session peer) {peers.add(peer);}
@OnClose
public void onClose(Session peer) {peers.remove(peer);}
@OnMessage
public void message(String message, Session client) {
peers.forEach(peer -> peer.getRemote().sendObject(message);
}
}
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java API for JSON Processing 1.0
 API to parse and generate JSON
 Streaming API
– Low-level, efficient way to parse/generate JSON
– Provides pluggability for parsers/generators

 Object Model API
– Simple, easy-to-use high-level API
– Implemented on top of Streaming API

 Binding JSON to Java objects forthcoming
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java API for JSON Processing 1.0
Streaming API – JsonParser
{
"firstName": "John", "lastName": "Smith", "age": 25,
"phoneNumber": [
{ "type": "home", "number": "212 555-1234" },
{ "type": "fax", "number": "646 555-4567" }
]
}
Iterator<Event> it = parser.iterator();
Event event = it.next();

// START_OBJECT

event = it.next();

// KEY_NAME

event = it.next();

// VALUE_STRING

String name = parser.getString();

// "John”

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Batch Applications 1.0
 Suited for non-interactive, bulk-oriented and

long-running tasks
 Computationally intensive
 Can execute sequentially/parallel
 May be initiated
– Adhoc
– Scheduled
 No scheduling APIs included

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Batch Applications 1.0
 Job: Batch process
 Step: Independent, sequential phase of job
– Reader, Processor, Writer

 Job Operator: Manage batch processing
 Job Repository: Metadata for jobs

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Batch Applications 1.0
Job Specification Language – Chunked Step
<step id=”sendStatements”>
…implements ItemReader {
<chunk reader ref=”accountReader” public Object readItem() {
processor ref=”accountProcessor”
// read account using JPA
writer ref=”emailWriter”
}
chunk-size=”10” />
</step>
…implements ItemProcessor {
Public Object processItems(Object account) {
// read Account, return Statement
}
…implements ItemWriter {
public void writeItems(List accounts) {
// use JavaMail to send email
}
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Concurrency Utilities for Java EE 1.0
 Provide asynchronous capabilities to Java EE

application components
– Without compromising container integrity

 Extension of Java SE Concurrency Utilities API (JSR

166)
 Support simple (common) and advanced concurrency
patterns

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Concurrency Utilities for Java EE 1.0
 Provide 4 managed objects
– ManagedExecutorService
– ManagedScheduledExecutorService
– ManagedThreadFactory
– ContextService

 Context propagation
 Task event notifications
 Transactions
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Concurrency Utilities for Java EE 1.0
Submit Tasks to ManagedExecutorService using JNDI
public class TestServlet extends HTTPServlet {
@Resource(name=“concurrent/BatchExecutor”)
ManagedExecutorService executor;
Future future = executor.submit(new MyTask());
class MyTask implements Runnable {
public void run() {
. . . // task logic
}
}
}

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java API for RESTful Web Services 2.0
 Client API
 Message Filters and Entity Interceptors
 Asynchronous Processing – Server and Client
 Common Configuration

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java API for RESTful Web Services 2.0
Client API

// Get instance of Client
Client client = ClientBuilder.newClient();
// Get customer name for the shipped products
String name = client.target(“../orders/{orderId}/customer”)
.resolveTemplate(”orderId", ”10”)
.queryParam(”shipped", ”true”)
.request()
.get(String.class);

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java Message Service 2.0
 Simplified API
– Less verbose
– Reduced boilerplate code
– Resource injection
– Try-with-resources for Connection, Session, etc.

 Both in Java EE and SE

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java Message Service 2.0

Sending a Message using JMS 1.1
@Resource(lookup = "myConnectionFactory”)
ConnectionFactory connectionFactory;
@Resource(lookup = "myQueue”)
Queue myQueue;
public void sendMessage (String payload) {
Connection connection = null;
try {
connection = connectionFactory.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer messageProducer = session.createProducer(myQueue);
TextMessage textMessage = session.createTextMessage(payload);
messageProducer.send(textMessage);
} catch (JMSException ex) {
//. . .
} finally {
if (connection != null) {
try {
connection.close();
} catch (JMSException ex) {
//. . .
}
}
}
}

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Application Server
Specific Resources

Boilerplate Code

Exception Handling
Java Message Service 2.0

Sending message using JMS 2.0
@Inject
JMSContext context;
@Resource(lookup = "java:global/jms/demoQueue”)
Queue demoQueue;
public void sendMessage(String payload) {
context.createProducer().send(demoQueue, payload);
}

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Bean Validation 1.1
 Alignment with Dependency Injection
 Method-level validation
– Constraints on parameters and return values
– Check pre-/post-conditions

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Bean Validation 1.1

Method Parameter and Result Validation
public void placeOrder(
@NotNull String productName,
Built-in
@NotNull @Max(“10”) Integer quantity,
@Customer String customer) {
Custom
//. . .
}
@Future
public Date getAppointment() {
//. . .
}
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java Persistence API 2.1
 Schema Generation
– javax.persistence.schema-generation.* properties

 Unsynchronized Persistence Contexts
 Bulk update/delete using Criteria
 User-defined functions using FUNCTION
 Stored Procedure Query

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Servlet 3.1
 Non-blocking I/O
 Protocol Upgrade
 Security Enhancements
– <deny-uncovered-http-methods>: Deny request to HTTP

methods not explicitly covered

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Servlet 3.1
Non-blocking IO - Traditional
public class TestServlet extends HttpServlet
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
ServletInputStream input = request.getInputStream();
byte[] b = new byte[1024];
int len = -1;
while ((len = input.read(b)) != -1) {
. . .
}
}
}
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Servlet 3.1
Non-blocking I/O: doGet Code Sample
AsyncContext context = request.startAsync();
ServletInputStream input = request.getInputStream();
input.setReadListener(
new MyReadListener(input, context));

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Servlet 3.1
Non-blocking I/O: MyReadListener Code Sample
@Override
public void onDataAvailable() {
try {
StringBuilder sb = new StringBuilder();
int len = -1;
byte b[] = new byte[1024];
while (input.isReady() && (len = input.read(b)) != -1) {
String data = new String(b, 0, len);
System.out.println("--> " + data);
}
} catch (IOException ex) {
. . .
}
}
. . .
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
JavaServer Faces 2.2
 Faces Flow
 Resource Library Contracts
 HTML5 Friendly Markup Support
– Pass through attributes and elements

 Cross Site Request Forgery Protection
 Loading Facelets via ResourceHandler
 File Upload Component

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java Transaction API 1.2
 @Transactional: Define transaction boundaries on

CDI managed beans
 @TransactionScoped: CDI scope for bean instances
scoped to the current JTA transaction

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Novas Possibilidades com Java EE 7
 Camada Web
 100% server-side
– JSF
 100% client-side
– JAX-RS + WebSockets + (Angular.JS)
 Híbrido
– Utilize o que achar conveniente, e melhor, para

cada caso da aplicação
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Novas Possibilidades com Java EE 7
 Camada Back-end
 Java EE Web Profile
– EJB3 Lite + CDI + JTA + JPA
 Java EE Full Profile
– WebP + JMS + JCA + Batch

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java EE 7 Implementation

4.0

glassfish.org
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Java EE 8 and Beyond

Standards-based cloud programming model
• Deliver cloud architecture
• Multi tenancy for SaaS
applications
• Incremental delivery of JSRs
• Modularity based on Jigsaw

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

NoSQL

Storage
JSON-B
Modularity

Multitenancy

Java EE 7
Cloud
PaaS
Enablement

Thin Server
Architecture
Adopt-a-JSR
Participating JUGs

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Call to Action
•
•
•
•
•

Specs: javaee-spec.java.net
Implementation: glassfish.org
The Aquarium: blogs.oracle.com/theaquarium
Adopt a JSR: glassfish.org/adoptajsr
NetBeans: wiki.netbeans.org/JavaEE7

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Perguntas?

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
OBRIGADO!
@brunoborges
blogs.oracle.com/brunoborges

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

More Related Content

PDF
FullStack Reativo com Spring WebFlux + Angular
PDF
Full-Stack Reativo com Spring WebFlux + Angular - Devs Java Girl
PDF
Serverless Angular, Material, Firebase and Google Cloud applications
PDF
Full-Stack Reactive with Spring WebFlux + Angular - Oracle Code One 2018
PDF
Full-Stack Reactive with Spring WebFlux + Angular - JConf Colombia 2019
PDF
Full-Stack Reativo com Spring WebFlux + Angular - FiqueEmCasaConf
PDF
JavaOne 2013: Java 8 - The Good Parts
PDF
Angular for Java Enterprise Developers: Oracle Code One 2018
FullStack Reativo com Spring WebFlux + Angular
Full-Stack Reativo com Spring WebFlux + Angular - Devs Java Girl
Serverless Angular, Material, Firebase and Google Cloud applications
Full-Stack Reactive with Spring WebFlux + Angular - Oracle Code One 2018
Full-Stack Reactive with Spring WebFlux + Angular - JConf Colombia 2019
Full-Stack Reativo com Spring WebFlux + Angular - FiqueEmCasaConf
JavaOne 2013: Java 8 - The Good Parts
Angular for Java Enterprise Developers: Oracle Code One 2018

What's hot (20)

PDF
Full Stack Reactive with React and Spring WebFlux - SpringOne 2018
PDF
Gerenciamento de estado no Angular com NgRx
PDF
Using React with Grails 3
PDF
Spring Boot Actuator 2.0 & Micrometer
PDF
Introduction to Retrofit and RxJava
PDF
From Spring Boot 2.2 to Spring Boot 2.3 #jsug
PDF
Agile Development with OSGi
PDF
Angular 2 observables
PPTX
Reactive Programming in Java 8 with Rx-Java
PPTX
Advanced Durable Functions - Serverless Meetup Tokyo - Feb 2018
PDF
Azure Durable Functions (2018-06-13)
PDF
Azure Durable Functions (2019-04-27)
PDF
Reactive Fault Tolerant Programming with Hystrix and RxJava
PPTX
Azure Durable Functions
PDF
Apollo. The client we deserve
PDF
A realtime infrastructure for Android apps: Firebase may be what you need..an...
PDF
Reactive Microservice And Spring5
PDF
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
PDF
Durable functions 2.0 (2019-10-10)
PPTX
Angular 2 Migration - JHipster Meetup 6
Full Stack Reactive with React and Spring WebFlux - SpringOne 2018
Gerenciamento de estado no Angular com NgRx
Using React with Grails 3
Spring Boot Actuator 2.0 & Micrometer
Introduction to Retrofit and RxJava
From Spring Boot 2.2 to Spring Boot 2.3 #jsug
Agile Development with OSGi
Angular 2 observables
Reactive Programming in Java 8 with Rx-Java
Advanced Durable Functions - Serverless Meetup Tokyo - Feb 2018
Azure Durable Functions (2018-06-13)
Azure Durable Functions (2019-04-27)
Reactive Fault Tolerant Programming with Hystrix and RxJava
Azure Durable Functions
Apollo. The client we deserve
A realtime infrastructure for Android apps: Firebase may be what you need..an...
Reactive Microservice And Spring5
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
Durable functions 2.0 (2019-10-10)
Angular 2 Migration - JHipster Meetup 6
Ad

Viewers also liked (14)

PDF
Introducao ao Ionic 2 na pratica
PDF
Desenvolvimento mobile
PDF
Frameworks PHP
PDF
Exercicios Pilhas (Stacks) - Estruturas de dados e algoritmos com Java
PDF
Exercicios Vetores (Arrays) - Estruturas de dados e algoritmos com Java
PDF
Campus Party Brasil 2017: Angular 2 #cpbr10
PDF
Exercicios Filas (Queues) - Estruturas de dados e algoritmos com Java
PDF
Estrutura de Dados e Algoritmos com Java #02-12: Vetores e Arrays
PDF
Ionic adventures - Hybrid Mobile App Development rocks
PPT
Material de Apoio de Algoritmo e Lógica de Programação
PDF
Novidades Angular 4.x e CLI
PDF
The Programmer
PDF
Paris ML meetup
PDF
Top Rumors About Apple March 21 Big Event
Introducao ao Ionic 2 na pratica
Desenvolvimento mobile
Frameworks PHP
Exercicios Pilhas (Stacks) - Estruturas de dados e algoritmos com Java
Exercicios Vetores (Arrays) - Estruturas de dados e algoritmos com Java
Campus Party Brasil 2017: Angular 2 #cpbr10
Exercicios Filas (Queues) - Estruturas de dados e algoritmos com Java
Estrutura de Dados e Algoritmos com Java #02-12: Vetores e Arrays
Ionic adventures - Hybrid Mobile App Development rocks
Material de Apoio de Algoritmo e Lógica de Programação
Novidades Angular 4.x e CLI
The Programmer
Paris ML meetup
Top Rumors About Apple March 21 Big Event
Ad

Similar to Presente e Futuro: Java EE.next() (20)

PDF
OTN Tour 2013: What's new in java EE 7
PPT
GlassFish BOF
PPT
Java EE7 in action
PDF
As novidades do Java EE 7: do HTML5 ao JMS 2.0
PPTX
Java ee7 1hour
PDF
Java EE 7 in practise - OTN Hyderabad 2014
PDF
Aplicações HTML5 com Java EE 7 e NetBeans
PDF
What’s new in Java SE, EE, ME, Embedded world & new Strategy
PDF
What's new in Java EE 7? From HTML5 to JMS 2.0
PDF
Java EE 7 for WebLogic 12c Developers
PDF
JavaOne 2014 Java EE 8 Booth Slides
PDF
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
PPT
Have You Seen Java EE Lately?
PDF
Java EE 8 Overview (Japanese)
PDF
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
PDF
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
PDF
Java EE 7: Boosting Productivity and Embracing HTML5
PDF
Java EE 7 overview
PPTX
Java EE for the Cloud
PDF
AAI 2236-Using the New Java Concurrency Utilities with IBM WebSphere
OTN Tour 2013: What's new in java EE 7
GlassFish BOF
Java EE7 in action
As novidades do Java EE 7: do HTML5 ao JMS 2.0
Java ee7 1hour
Java EE 7 in practise - OTN Hyderabad 2014
Aplicações HTML5 com Java EE 7 e NetBeans
What’s new in Java SE, EE, ME, Embedded world & new Strategy
What's new in Java EE 7? From HTML5 to JMS 2.0
Java EE 7 for WebLogic 12c Developers
JavaOne 2014 Java EE 8 Booth Slides
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Have You Seen Java EE Lately?
Java EE 8 Overview (Japanese)
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7 overview
Java EE for the Cloud
AAI 2236-Using the New Java Concurrency Utilities with IBM WebSphere

More from Bruno Borges (20)

PDF
Secrets of Performance Tuning Java on Kubernetes
PDF
[Outdated] Secrets of Performance Tuning Java on Kubernetes
PDF
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
PDF
Making Sense of Serverless Computing
PPTX
Visual Studio Code for Java and Spring Developers
PDF
Taking Spring Apps for a Spin on Microsoft Azure Cloud
PDF
A Look Back at Enterprise Integration Patterns and Their Use into Today's Ser...
PPTX
Melhore o Desenvolvimento do Time com DevOps na Nuvem
PPTX
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
PPTX
Java EE Arquillian Testing with Docker & The Cloud
PPTX
Migrating From Applets to Java Desktop Apps in JavaFX
PDF
Servidores de Aplicação: Por quê ainda precisamos deles?
PDF
Build and Monitor Cloud PaaS with JVM’s Nashorn JavaScripts [CON1859]
PDF
Cloud Services for Developers: What’s Inside Oracle Cloud for You? [CON1861]
PDF
Booting Up Spring Apps on Lightweight Cloud Services [CON10258]
PDF
Java EE Application Servers: Containerized or Multitenant? Both! [CON7506]
PDF
Running Oracle WebLogic on Docker Containers [BOF7537]
PPTX
Lightweight Java in the Cloud
PDF
Tweet for Beer - Beertap Powered by Java Goes IoT, Cloud, and JavaFX
PDF
Integrando Oracle BPM com Java EE e WebSockets
Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
Making Sense of Serverless Computing
Visual Studio Code for Java and Spring Developers
Taking Spring Apps for a Spin on Microsoft Azure Cloud
A Look Back at Enterprise Integration Patterns and Their Use into Today's Ser...
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Java EE Arquillian Testing with Docker & The Cloud
Migrating From Applets to Java Desktop Apps in JavaFX
Servidores de Aplicação: Por quê ainda precisamos deles?
Build and Monitor Cloud PaaS with JVM’s Nashorn JavaScripts [CON1859]
Cloud Services for Developers: What’s Inside Oracle Cloud for You? [CON1861]
Booting Up Spring Apps on Lightweight Cloud Services [CON10258]
Java EE Application Servers: Containerized or Multitenant? Both! [CON7506]
Running Oracle WebLogic on Docker Containers [BOF7537]
Lightweight Java in the Cloud
Tweet for Beer - Beertap Powered by Java Goes IoT, Cloud, and JavaFX
Integrando Oracle BPM com Java EE e WebSockets

Recently uploaded (20)

PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Approach and Philosophy of On baking technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
NewMind AI Monthly Chronicles - July 2025
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
NewMind AI Weekly Chronicles - August'25 Week I
Approach and Philosophy of On baking technology
The AUB Centre for AI in Media Proposal.docx
Advanced methodologies resolving dimensionality complications for autism neur...
Review of recent advances in non-invasive hemoglobin estimation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Per capita expenditure prediction using model stacking based on satellite ima...
Spectral efficient network and resource selection model in 5G networks
Chapter 3 Spatial Domain Image Processing.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Machine learning based COVID-19 study performance prediction
Building Integrated photovoltaic BIPV_UPV.pdf
A Presentation on Artificial Intelligence
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
MYSQL Presentation for SQL database connectivity
Mobile App Security Testing_ A Comprehensive Guide.pdf

Presente e Futuro: Java EE.next()

  • 1. Presente e Futuro: Java EE.next() Bruno Borges Oracle Product Manager e Java Evangelist blogs.oracle.com/brunoborges @brunoborges
  • 2. The preceding 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. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 3. Java EE 6 10 Dezembro, 2009 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 4. Java EE 6 – Estatísticas  50+ Milhões de Downloads de Componentes Java EE 6  #1 Escolha para Desenvolvedores Enterprise  #1 Plataforma de Desenvolvimento de Aplicações  Implementação mais Rápida de uma versão do Java EE Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 5. Top Ten Features in Java EE 6 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. EJB packaging in a WAR Type-safe dependency injection Optional deployment descriptors (web.xml, faces-config.xml) JSF standardizing on Facelets One class per EJB Servlet and CDI extension points CDI Events EJBContainer API Cron-based @Schedule Web Profile Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 6. Java EE 7 Scope JSR 342  Developer Productivity – Less Boilerplate – Richer Functionality – More Defaults  HTML5 Support – WebSocket – JSON – HTML5 Forms Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 7. Java EE 7 Themes       Batch Applications  Concurrency Utilities  Simplified JMS and Compatibility Copyright © 2013, Oracle and/or its affiliates. All rights reserved. WebSocket JSON Processing Servlet 3.1 NIO REST HTML5-Friendly Markup     More annotated POJOs Less boilerplate code Cohesive integrated platform Default resources
  • 8. WebSockets Java EE 7 for Next Generation Applications Deliver HTML5 Dynamic Scalable Apps  Reduce response time with low latency data exchange using WebSockets  Simplify data parsing for portable applications with standard JSON support  Deliver asynchronous, scalable, high performance RESTful Services Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 9. Java EE 7 for the Developer 110101011101010011000101001001010001 PRODUCTIVITY 011001011010010011010010010100100001 001010100111010010110010101001011010 010010100100001001010100111010011101 010111010100110001010010010100010110 010110100100110100100101001000010010 101001110100101100101010010110100100 101001000010010101001110100100110101 Increased Developer Productivity  Simplify application architecture with a cohesive integrated platform  Increase efficiency with reduced boiler-plate code and broader use of annotations  Enhance application portability with standard RESTful web service client support Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 10. Java EE 7 for the Enterprise Scaling to the Most Demanding Requirements  Break down batch jobs into manageable chunks for   Copyright © 2013, Oracle and/or its affiliates. All rights reserved. uninterrupted OLTP performance Easily define multithreaded concurrent tasks for improved scalability Simplify application integration with standard Java Messaging Service interoperability
  • 11. Java EE 7 JSRs CDI Extensions JSF 2.2, JSP 2.3, EL 3.0 Web Fragments JAX-RS 2.0, JAX-WS 2.2 JSON 1.0 WebSocket 1.0 Servlet 3.1 CDI 1.1 Interceptors 1.2, JTA 1.2 Common Annotations 1.1 EJB 3.2 Managed Beans 1.0 JPA 2.1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. JMS 2.0 Concurrency 1.0 JCA 1.7 Batch 1.0
  • 12. Top 10 Features Java EE 7  WebSocket client/server endpoints  Batch Applications  JSON Processing  Concurrency Utilities  Simplified JMS API  @Transactional and @TransactionScoped!  JAX-RS Client API  Default Resources  More annotated POJOs  Faces Flow Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 13. Java API for WebSocket 1.0 Annotated Endpoint import javax.websocket.*; @ServerEndpoint("/hello") public class HelloBean { @OnMessage public String sayHello(String name) { return “Hello “ + name; } } Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 14. Java API for WebSocket 1.0 Chat Server @ServerEndpoint("/chat") public class ChatBean { static Set<Session> peers = Collections.synchronizedSet(…); @OnOpen public void onOpen(Session peer) {peers.add(peer);} @OnClose public void onClose(Session peer) {peers.remove(peer);} @OnMessage public void message(String message, Session client) { peers.forEach(peer -> peer.getRemote().sendObject(message); } } Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 15. Java API for JSON Processing 1.0  API to parse and generate JSON  Streaming API – Low-level, efficient way to parse/generate JSON – Provides pluggability for parsers/generators  Object Model API – Simple, easy-to-use high-level API – Implemented on top of Streaming API  Binding JSON to Java objects forthcoming Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 16. Java API for JSON Processing 1.0 Streaming API – JsonParser { "firstName": "John", "lastName": "Smith", "age": 25, "phoneNumber": [ { "type": "home", "number": "212 555-1234" }, { "type": "fax", "number": "646 555-4567" } ] } Iterator<Event> it = parser.iterator(); Event event = it.next(); // START_OBJECT event = it.next(); // KEY_NAME event = it.next(); // VALUE_STRING String name = parser.getString(); // "John” Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 17. Batch Applications 1.0  Suited for non-interactive, bulk-oriented and long-running tasks  Computationally intensive  Can execute sequentially/parallel  May be initiated – Adhoc – Scheduled  No scheduling APIs included Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 18. Batch Applications 1.0  Job: Batch process  Step: Independent, sequential phase of job – Reader, Processor, Writer  Job Operator: Manage batch processing  Job Repository: Metadata for jobs Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 19. Batch Applications 1.0 Job Specification Language – Chunked Step <step id=”sendStatements”> …implements ItemReader { <chunk reader ref=”accountReader” public Object readItem() { processor ref=”accountProcessor” // read account using JPA writer ref=”emailWriter” } chunk-size=”10” /> </step> …implements ItemProcessor { Public Object processItems(Object account) { // read Account, return Statement } …implements ItemWriter { public void writeItems(List accounts) { // use JavaMail to send email } Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 20. Concurrency Utilities for Java EE 1.0  Provide asynchronous capabilities to Java EE application components – Without compromising container integrity  Extension of Java SE Concurrency Utilities API (JSR 166)  Support simple (common) and advanced concurrency patterns Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 21. Concurrency Utilities for Java EE 1.0  Provide 4 managed objects – ManagedExecutorService – ManagedScheduledExecutorService – ManagedThreadFactory – ContextService  Context propagation  Task event notifications  Transactions Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 22. Concurrency Utilities for Java EE 1.0 Submit Tasks to ManagedExecutorService using JNDI public class TestServlet extends HTTPServlet { @Resource(name=“concurrent/BatchExecutor”) ManagedExecutorService executor; Future future = executor.submit(new MyTask()); class MyTask implements Runnable { public void run() { . . . // task logic } } } Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 23. Java API for RESTful Web Services 2.0  Client API  Message Filters and Entity Interceptors  Asynchronous Processing – Server and Client  Common Configuration Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 24. Java API for RESTful Web Services 2.0 Client API // Get instance of Client Client client = ClientBuilder.newClient(); // Get customer name for the shipped products String name = client.target(“../orders/{orderId}/customer”) .resolveTemplate(”orderId", ”10”) .queryParam(”shipped", ”true”) .request() .get(String.class); Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 25. Java Message Service 2.0  Simplified API – Less verbose – Reduced boilerplate code – Resource injection – Try-with-resources for Connection, Session, etc.  Both in Java EE and SE Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 26. Java Message Service 2.0 Sending a Message using JMS 1.1 @Resource(lookup = "myConnectionFactory”) ConnectionFactory connectionFactory; @Resource(lookup = "myQueue”) Queue myQueue; public void sendMessage (String payload) { Connection connection = null; try { connection = connectionFactory.createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer messageProducer = session.createProducer(myQueue); TextMessage textMessage = session.createTextMessage(payload); messageProducer.send(textMessage); } catch (JMSException ex) { //. . . } finally { if (connection != null) { try { connection.close(); } catch (JMSException ex) { //. . . } } } } Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Application Server Specific Resources Boilerplate Code Exception Handling
  • 27. Java Message Service 2.0 Sending message using JMS 2.0 @Inject JMSContext context; @Resource(lookup = "java:global/jms/demoQueue”) Queue demoQueue; public void sendMessage(String payload) { context.createProducer().send(demoQueue, payload); } Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 28. Bean Validation 1.1  Alignment with Dependency Injection  Method-level validation – Constraints on parameters and return values – Check pre-/post-conditions Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 29. Bean Validation 1.1 Method Parameter and Result Validation public void placeOrder( @NotNull String productName, Built-in @NotNull @Max(“10”) Integer quantity, @Customer String customer) { Custom //. . . } @Future public Date getAppointment() { //. . . } Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 30. Java Persistence API 2.1  Schema Generation – javax.persistence.schema-generation.* properties  Unsynchronized Persistence Contexts  Bulk update/delete using Criteria  User-defined functions using FUNCTION  Stored Procedure Query Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 31. Servlet 3.1  Non-blocking I/O  Protocol Upgrade  Security Enhancements – <deny-uncovered-http-methods>: Deny request to HTTP methods not explicitly covered Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 32. Servlet 3.1 Non-blocking IO - Traditional public class TestServlet extends HttpServlet protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ServletInputStream input = request.getInputStream(); byte[] b = new byte[1024]; int len = -1; while ((len = input.read(b)) != -1) { . . . } } } Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 33. Servlet 3.1 Non-blocking I/O: doGet Code Sample AsyncContext context = request.startAsync(); ServletInputStream input = request.getInputStream(); input.setReadListener( new MyReadListener(input, context)); Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 34. Servlet 3.1 Non-blocking I/O: MyReadListener Code Sample @Override public void onDataAvailable() { try { StringBuilder sb = new StringBuilder(); int len = -1; byte b[] = new byte[1024]; while (input.isReady() && (len = input.read(b)) != -1) { String data = new String(b, 0, len); System.out.println("--> " + data); } } catch (IOException ex) { . . . } } . . . Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 35. JavaServer Faces 2.2  Faces Flow  Resource Library Contracts  HTML5 Friendly Markup Support – Pass through attributes and elements  Cross Site Request Forgery Protection  Loading Facelets via ResourceHandler  File Upload Component Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 36. Java Transaction API 1.2  @Transactional: Define transaction boundaries on CDI managed beans  @TransactionScoped: CDI scope for bean instances scoped to the current JTA transaction Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 37. Novas Possibilidades com Java EE 7  Camada Web  100% server-side – JSF  100% client-side – JAX-RS + WebSockets + (Angular.JS)  Híbrido – Utilize o que achar conveniente, e melhor, para cada caso da aplicação Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 38. Novas Possibilidades com Java EE 7  Camada Back-end  Java EE Web Profile – EJB3 Lite + CDI + JTA + JPA  Java EE Full Profile – WebP + JMS + JCA + Batch Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 39. Java EE 7 Implementation 4.0 glassfish.org Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 40. Java EE 8 and Beyond Standards-based cloud programming model • Deliver cloud architecture • Multi tenancy for SaaS applications • Incremental delivery of JSRs • Modularity based on Jigsaw Copyright © 2013, Oracle and/or its affiliates. All rights reserved. NoSQL Storage JSON-B Modularity Multitenancy Java EE 7 Cloud PaaS Enablement Thin Server Architecture
  • 41. Adopt-a-JSR Participating JUGs Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 42. Call to Action • • • • • Specs: javaee-spec.java.net Implementation: glassfish.org The Aquarium: blogs.oracle.com/theaquarium Adopt a JSR: glassfish.org/adoptajsr NetBeans: wiki.netbeans.org/JavaEE7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 43. Perguntas? Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 44. OBRIGADO! @brunoborges blogs.oracle.com/brunoborges Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 45. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 46. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.