Java EE 8
Why We Need to Take Action to
Move Forward
Kito D. Mann
Virtua, Inc.
Kito D. Mann
@kito99
• Principal Consultant at Virtua (http://virtua.tech)
• Training, consulting, architecture, mentoring
• PrimeFaces, JSF, Java EE, Polymer, Web
Components, Liferay, etc.
• Official US PrimeFaces partner
• Author, JavaServer Faces in Action
• Founder, JSF Central (http://www.jsfcentral.com)
Kito D. Mann
@kito99
• Co-host, Enterprise Java Newscast
• http://enterprisejavanews.com
• Internationally recognized speaker
• JavaOne, JavaZone, Devoxx, Devnexus,
NFJS, etc.
• JCP Member
• JSF, MVC, JSF Portlet Bridge, Portlets
Agenda
• Overview of the specifications that are part of
Java EE 8, provide current status
• Examples of Proposed Enhancements and New
Features
• What the current status of Java EE 8 progress is
and what you can do to help
The Importance of Java
EE to the Ecosystem
https://javaee-guardians.io/java-ee-adoption-surveys
Java EE Ecosystem
Microservices and Java
EE
http://microprofile.io
Java EE
Past, Present, Future
J2EE 1.2
Servlet,
JSP, EJB,
JMS, RMI
J2EE 1.3
CMP,
JCA
J2EE 1.4
Web
Services,
Mgmt,
Deplymnt
Java EE 5
Ease of
Use,
EJB 3,
JPA, JSF,
JAXB,
JAX-WS
Java EE 6
Pruning,
Ease of Use,
JAX-RS,
CDI,
Bean-
Validation
Servlet 3,
EJB 3.1 Lite
Java EE 7
JMS 2, Batch,
TX,
Concurrency,
Web-Sockets,
JSON
Java EE 8
SERVLET 4,
JSON-B,
JSON-P 1.1,
JSF 2.3, CDI
2.0, JAX-RS
2.1,
SECURITY,
MVC,
MANAGEMENT
Java EE Past, Present, &
Future
J2EE 1.3
CMP,
JCA
J2EE 1.4
Web
Services,
Mgmt,
Deplymnt
Java EE 5
Ease of
Use,
EJB 3,
JPA, JSF,
JAXB,
JAX-WS
Java EE 6
Pruning,
Ease of
Use,
JAX-RS,
CDI,
Bean-
Validation
Servlet 3,
EJB 3.1
Lite
Java EE 7
JMS 2,
Batch, TX,
Concurr,
Web-
Sockets,
JSON
JAX-RS 2
JAX-RPC, CMP/
BMP, JSR 88
J2EE 1.2
Servlet,
JSP, EJB,
JMS, RMI
Java EE Past, Present, &
Future
Java EE 5
Ease of
Use,
EJB 3,
JPA, JSF,
JAXB,
JAX-WS
Java EE 6
Pruning,
Ease of
Use,
JAX-RS,
CDI,
Bean-
Validation
Web Profile
Servlet 3,
EJB 3.1
Lite
Java EE 7
JMS 2,
Batch, TX,
Concurr,
Web-
Sockets,
JSON
Web Profile
JAX-RS 2
JAX-RPC, CMP/
BMP, JSR 88
J2EE 1.3
CMP,
JCA
J2EE 1.4
Web
Services,
Mgmt,
Deplymnt
J2EE 1.2
Servlet,
JSP, EJB,
JMS, RMI
Java EE Past, Present, &
Future
J2EE 1.3
CMP,
JCA
J2EE 1.4
Web
Services,
Mgmt,
Deplymnt
Java EE 5
Ease of
Use,
EJB 3,
JPA, JSF,
JAXB,
JAX-WS
Java EE 6
Pruning,
Ease of
Use,
JAX-RS,
CDI,
Bean-
Validation
Web Profile
Servlet 3,
EJB 3.1
Lite
Java EE 7
JMS 2,
Batch, TX,
Concurr,
Web-
Sockets,
JSON
JAX-RS 2
JAX-RPC, CMP/
BMP, JSR 88
J2EE 1.2
Servlet,
JSP, EJB,
JMS, RMI
Java EE Past, Present, &
Future
J2EE 1.3
CMP,
JCA
J2EE 1.4
Web
Services,
Mgmt,
Deplymnt
Java EE 5
Ease of
Use,
EJB 3,
JPA, JSF,
JAXB,
JAX-WS
Java EE 6
Pruning,
Ease of
Use,
JAX-RS,
CDI,
Bean-
Validation
Web Profile
Servlet 3,
EJB 3.1
Lite
Java EE 7
JMS 2,
Batch, TX,
Concurr,
Web-
Sockets,
JSON
Web Profile
JAX-RS 2
JAX-RPC, CMP/
BMP, JSR 88
J2EE 1.2
Servlet,
JSP, EJB,
JMS, RMI
Java EE 8 Community Survey
https://java.net/downloads/javaee-spec/JavaEE8_Community_Survey_Results.pdf
https://blogs.oracle.com/ldemichiel/entry/results_from_the_java_ee
Java EE 8: Original
Plan
• Continued Enhancements for Web Standards
Alignment
• HTTP2, JSON Binding, JSON-P, MVC
• Cloud enhancements
• Security, RESTful Management API
• CDI Programming Model
• Ease of use, EJB via CDI
• Smaller, but Important Features
• Caching, Better Messaging
• Alignment with Java SE 8
Java EE 8
Original Overview
• JMS 2.1
• JAX-RS 2.1
• JSF 2.3
• CDI 2.0
• JSON-P 1.1
• Servlet 4.0
• JCache 1.0
• JSON-B 1.0
• MVC 1.0
• Java EE Security1.0
• Java EE Management 2.0
Java EE 8: New Proposal
Expected release: Q4 2017
• JMS 2.1
• JAX-RS 2.1
• JSF 2.3
• CDI 2.0
• JSON-P 1.1
• Servlet 4.0
• JCache 1.0
• JSON-B 1.0
• MVC 1.0
• Java EE Security 1.0
• Java EE Management 2.0
●Health Checking
●Configuration
Java EE 9: New Proposal
Expected release: Q4 2018
• Increased focus on microservices and cloud
• Proposed new features:
• Multi-tenancy
• Circuit-breaker
• Reactive programming support
Updated
Specifications
Servlet 4.0
• Principal goal to support HTTP 2
• Modernization of internet protocol
• Boost web performance
• Early Draft has been published
• Join mailing list or follow expert group (JSR 369)
• Keep tabs on Ed Burns’ presentations, although
not anything new since JavaOne 2015
Servlet 4.0
• HTTP 2 Support -> Major Update
• Why do we need HTTP 2?
• Problems with HTTP 1.1
• Head-of-Line Blocking
• HTTP Pipelining, File Concatenation, &
Image Sprites
Servlet 4.0
HTTP 2
• Request/Response Multiplexing
• Binary Framing
• Socket Optimization
• Upgrade from HTTP 1.1
Servlet 4.0
Exposing HTTP 2
• Stream Prioritization
• New class Priority
• Enhance HttpServletRequest and
HttpServletResponse to accommodate
• Server Push
• Not replacing WebSockets
Servlet 4.0
Newer HttpClient API (Java SE
9)
• Plans to provide easy to use API
• Support both HTTP/1.1 and 2
• Builds on existing Java API Classes
JMS 2.1
(Proposed for Removal)
• JSR 368 - In early stages
• No builds available for testing, as yet.
• Planning: https://java.net/projects/jms-
spec/pages/JMS21Planning
JMS 2.1
• JMS 2.0 was a major overhaul
• Continuation of API Modernization
• Declarative Message Listeners
• Alternative to MDB
• More Powerful Features
• Available to all Beans
JMS 2.1
• JMS Provider Portability Improvements
• Dead Message Queues
• Redelivery Behavior on JMS MDB Rollback
(delays, max # consecutive)
JMS 2.1
Asynchronous Batches
• In JMS 2.0, messages delivered asynchronously by
calling:
javax.jms.MessageListener onMessage(Message
message)
• Define new:
javax.jms.BatchMessageListener
onMessages(Message[] messages)
JMS 2.1
Declarative JMS Listeners
@ApplicationScoped
@MaxConcurrency(10)
public class HandlingEventRegistrationAttemptConsumer {
@JmsListener(
destinationLookup="jms/HandlingEventRegistrationAttempt
Queue",
selector="source = 'mobile'",
batchSize=10, retry=5, retryDelay=7000,
orderBy=TIMESTAMP)
@Transactional
public void onEventRegistrationAttempt(
HandlingEventRegistrationAttempt... attempts) {
...
}
}
JAX-RS 2.1
• JSR 370 - In Early Stages
• No builds available for testing
• Follow JSR-370 EG and Mailing Lists
JAX-RS 2.1
• Hypermedia API
• Reactive API
• Security API
• Support for SSE (Server Sent Events)
• Improved CDI Integration
• Support for Non-Blocking IO in Providers
JAX-RS 2.1
• Conditional JAXB on Runtimes
• Integration with JSON-B
• Support for CDI in Java SE
JSF 2.3
• JSR 372 - in active progress
• Milestones available for testing
• Read, Test, Supply Feedback
JSF 2.3
• Enhanced CDI Integration
• Lifecycle Enhancements
• PostRenderViewEvent
• EL API Enhancements
• Configuration Enhancements
• AJAX Enhancements
JSF 2.3
Enhanced CDI Integration
• Injection of Resources
@Inject FacesContext facesContext;
@ApplicationMap
@Inject
Map applicationMap;
JSF 2.3
Enhanced CDI Integration
• Wider Support of Injection into JSF Artifacts
• javax.faces.convert.Converter
• javax.faces.validator.Validator
• javax.faces.component.behavior.Behavior
• Upgraded to CDI qualifiers
CDI 2.0
• JSR 365 - in active progress
• Test Releases of Reference Implementation
(Weld 3.0.0 Alphas)
• http://weld.cdi-spec.org/news/
• Follow the Expert Group
CDI 2.0
• Java SE Bootstrap
• XML Configuration
• Asynchronous Events@S@tar
• @Startup for CDI Beans
• Portable Extension SPI Simplification
• Small features and enhancements
CDI 2.0
Event System
Enhancements
• Asynchronous Events
• Call to event.fireAsync() returns immediately
@Inject
private ExperimentalEvent<Configuration> event;
…
event.fireAsync(new Configuration());
CDI 2.0
@Schedule Outside EJB
@ApplicationScoped
public class MyScheduledBean {
...
@Schedule(...)
public void myScheduledTask() { ... }
}
@ApplicationScoped
@Stereotype
@Retention(RUNTIME)
@Target(TYPE)
@Schedule(...)
public @interface MonthlyTask {}
JSON-P 1.1
• JSR 374 - In Early Draft Review
• More Information:
• https://json-processing-spec.java.net/
• Sources: https://java.net/projects/jsonp
JSON-P 1.1
• Updates to new API in Java EE 7
• New JSON Standards
• JSON-Pointer and JSON-Patch
• Editing Operations on JSON objects and arrays
• Helper Classes and Enhanced Java SE 8
support
JSON-P 1.1
Java SE 8 Support
• Stream Support
JsonArray persons;
persons.getValuesAs(JsonObject.class).stream()
.filter(x->x.getString(“age”) >= 65)
.forEach(System.out.println(x.getString(“name”)));
JSON-P 1.1
JSON-Pointer
JSON-P 1.1
JSON-Patch
public void shouldBuildJsonPatchExpressionUsingJsonPatchBuilder() {
JsonPatchBuilder patchBuilder = new JsonPatchBuilder();
JsonObject result = patchBuilder.add("/email”,
"john@example.com").replace("/age", 30)
.remove("/phoneNumber”)
.test("/firstName", "John”)
.copy("/address/lastName", "/lastName”)
.apply(buildPerson());
}
Java EE Management API
2.0
(Proposed for Removal)
• Currently working on Early Draft
• Join mailing list of JSR 373
Java EE Management API
2.0
• REST Based Interface to Supersede EJB
Management APIs of JSR 77
• Monitoring and deployment as well
• SSE for Event Support (WebSockets also under
consideration)
New Specifications
MVC
(Proposed for Removal)
• Model - View - Controller
• JSR 371
• Active Progress…download milestones
• Ozark: https://ozark.java.net/
MVC
• Action-Based Web Framework for Java EE
• Follows suit of Spring MVC or Apache Struts
• Does Not Replace JSF
• Model: CDI, Bean Validation, JPA
• View: Facelets, JSP (Extensible)
• Controller: Layered on top of JAX-RS
MVC
Controller Example
@Controller
@Path("/customers")
@View("my-view.jsp")
public class CustomerController {
@Inject
private Models models;
@GET
public String getItems(){
...
return “customers.jsp”;
}
MVC
View Example
<c:forEach var="customer" items="${customers}">
<tr>
<td class="text-left">${customer.name}</td>
<td class="text-center">
<form
action="${pageContext.request.contextPath}/r/customers/edit"
method="POST">
<input type="hidden" name="id" value="${item.id}"/>
<button type="submit">
Edit
</button>
</form>
</td>
</tr>
</c:forEach>
JSON-B
• Java API for JSON Binding
• JSR 367 - Public Review
• Read the spec, start testing:
https://java.net/projects/jsonb-spec/pages/Home
JSON-B
• Standardize means of converting JSON to Java
objects and vice versa
• Default mapping algorithm for converting Java
classes
• Draw from best of breed ideas in existing JSON
binding solutions
• Provide JAX-RS a standard way to support
“application/json” for POJOs
• JAX-RS currently supports JSON-P
JSON-B
Mapping
@Entity public class Person {
@Id String name;
String gender;
@ElementCollection
Map<String, String> phones;
...
}
Person duke = new Person();
duke.setName("Duke");
duke.setGender("Male");
phones = new HashMap<>();
phones.put("home", "650-123-4567");
phones.put("mobile",
"650-234-5678");
duke.setPhones(phones);
{
"name":"Duke",
"gender":"Male",
"phones":{
"home":"650-123-4567",
"mobile":"650-234-5678"
}
}
JSON-B
Proposed API - Custom Mapping
• Utilization of annotations to map fields to JSON
Document Elements
{
poolType : “Inground”,
}
@JsonProperty(“poolType”)
public String poolType;
{
poolType : “Inground”,
shape : “Rectangle”
}
@JsonPropertyOrder(“poolType”,
”shape”)
public class Pool(){
public String poolType;
public String shape;
…
}
Java EE Security
• JSR 365
• Early Draft Development
• Improve Java EE platform by ensuring that the
security API is useful in the modern cloud/PaaS
paradigm
• Simplify, standardize, modernize
• Promotes modern concepts (EL and CDI)
Java EE Security
• Simple security providers
• Easy pluggability and mapping
• Enabling Existing Security Annotations for all
beans
Java EE Security
Proposed Security Provider
@SecurityProvider
public class MySecurityProvider {
@Inject UserService userService;
@OnAuthentication
// The parameters could suit the credentials mechanism being
used.
public Principal getPrincipal(String username, String password) {
// Construct the principal using the user service.
}
@OnAuthorization
public String[] getRoles (Principal principal) {
// Construct an array of roles using the principal and user
service.
}
}
Java EE Security
• Proposed Idea Examples:
• https://github.com/javaee-security-spec/javaee-
security-proposals
JCache
• Java Temporary Caching API
• JSR 107 - Started in 2001
• Finished in 2014
• Provides a common way for Java applications to
create, access, update, and remove entries from
caches
JCache
• Provide applications with caching
functionality…particularly the ability to cache Java
objects
• Define common set of caching concepts & facilities
• Minimize learning curve
• Maximize portability
• Support in-process and distributed cache
implementations
JCache
• Unknown status...not mentioned in the Oracle
update
• Make use of JCache with some application servers
now with CDI
Health Checking
• Newly proposed specification, geared towards
monitoring the health of microservices
• Client-side standard
• Automatic, periodic, and self-monitoring
• Possibly statistics
Configuration
• Standard for externalizing configuration
• Aimed at cloud based environments
• Provide the ability to change one or more
configurations that are independent/decoupled of
apps...multiple configuration files
• Unified API for accessing configuration in many
different environments
• Layering and Overrides
Not Addressed
• JPA
• WebSocket
• Concurrency Utilities
• etc...
Java EE 8 Timeline
Q4 2014
Expert Groups
Q4 2015
Early
Draft
Q1 2016
Public
Review
Q3 2016
Proposed Final
Draft
H2
2017?
Final
Release
Java
EE.Next
Java EE 8:
Take Action
• Start working with Java EE 8 today
• Tools:
• GlassFish v4.1, Payara 5 Branch
• Milestones
• Examples and Specification Docs
Adopt-A-JSR
• Started in 2007, easy way for JUGs to get
involved
• What you can do depends upon what you want
to do & what spec leads are looking for
Join Us!
https://javaee-guardians.io

Java EE8 - by Kito Mann

  • 1.
    Java EE 8 WhyWe Need to Take Action to Move Forward Kito D. Mann Virtua, Inc.
  • 2.
    Kito D. Mann @kito99 •Principal Consultant at Virtua (http://virtua.tech) • Training, consulting, architecture, mentoring • PrimeFaces, JSF, Java EE, Polymer, Web Components, Liferay, etc. • Official US PrimeFaces partner • Author, JavaServer Faces in Action • Founder, JSF Central (http://www.jsfcentral.com)
  • 3.
    Kito D. Mann @kito99 •Co-host, Enterprise Java Newscast • http://enterprisejavanews.com • Internationally recognized speaker • JavaOne, JavaZone, Devoxx, Devnexus, NFJS, etc. • JCP Member • JSF, MVC, JSF Portlet Bridge, Portlets
  • 4.
    Agenda • Overview ofthe specifications that are part of Java EE 8, provide current status • Examples of Proposed Enhancements and New Features • What the current status of Java EE 8 progress is and what you can do to help
  • 5.
    The Importance ofJava EE to the Ecosystem https://javaee-guardians.io/java-ee-adoption-surveys
  • 6.
  • 7.
  • 8.
    Java EE Past, Present,Future J2EE 1.2 Servlet, JSP, EJB, JMS, RMI J2EE 1.3 CMP, JCA J2EE 1.4 Web Services, Mgmt, Deplymnt Java EE 5 Ease of Use, EJB 3, JPA, JSF, JAXB, JAX-WS Java EE 6 Pruning, Ease of Use, JAX-RS, CDI, Bean- Validation Servlet 3, EJB 3.1 Lite Java EE 7 JMS 2, Batch, TX, Concurrency, Web-Sockets, JSON Java EE 8 SERVLET 4, JSON-B, JSON-P 1.1, JSF 2.3, CDI 2.0, JAX-RS 2.1, SECURITY, MVC, MANAGEMENT
  • 9.
    Java EE Past,Present, & Future J2EE 1.3 CMP, JCA J2EE 1.4 Web Services, Mgmt, Deplymnt Java EE 5 Ease of Use, EJB 3, JPA, JSF, JAXB, JAX-WS Java EE 6 Pruning, Ease of Use, JAX-RS, CDI, Bean- Validation Servlet 3, EJB 3.1 Lite Java EE 7 JMS 2, Batch, TX, Concurr, Web- Sockets, JSON JAX-RS 2 JAX-RPC, CMP/ BMP, JSR 88 J2EE 1.2 Servlet, JSP, EJB, JMS, RMI
  • 10.
    Java EE Past,Present, & Future Java EE 5 Ease of Use, EJB 3, JPA, JSF, JAXB, JAX-WS Java EE 6 Pruning, Ease of Use, JAX-RS, CDI, Bean- Validation Web Profile Servlet 3, EJB 3.1 Lite Java EE 7 JMS 2, Batch, TX, Concurr, Web- Sockets, JSON Web Profile JAX-RS 2 JAX-RPC, CMP/ BMP, JSR 88 J2EE 1.3 CMP, JCA J2EE 1.4 Web Services, Mgmt, Deplymnt J2EE 1.2 Servlet, JSP, EJB, JMS, RMI
  • 11.
    Java EE Past,Present, & Future J2EE 1.3 CMP, JCA J2EE 1.4 Web Services, Mgmt, Deplymnt Java EE 5 Ease of Use, EJB 3, JPA, JSF, JAXB, JAX-WS Java EE 6 Pruning, Ease of Use, JAX-RS, CDI, Bean- Validation Web Profile Servlet 3, EJB 3.1 Lite Java EE 7 JMS 2, Batch, TX, Concurr, Web- Sockets, JSON JAX-RS 2 JAX-RPC, CMP/ BMP, JSR 88 J2EE 1.2 Servlet, JSP, EJB, JMS, RMI
  • 12.
    Java EE Past,Present, & Future J2EE 1.3 CMP, JCA J2EE 1.4 Web Services, Mgmt, Deplymnt Java EE 5 Ease of Use, EJB 3, JPA, JSF, JAXB, JAX-WS Java EE 6 Pruning, Ease of Use, JAX-RS, CDI, Bean- Validation Web Profile Servlet 3, EJB 3.1 Lite Java EE 7 JMS 2, Batch, TX, Concurr, Web- Sockets, JSON Web Profile JAX-RS 2 JAX-RPC, CMP/ BMP, JSR 88 J2EE 1.2 Servlet, JSP, EJB, JMS, RMI
  • 13.
    Java EE 8Community Survey https://java.net/downloads/javaee-spec/JavaEE8_Community_Survey_Results.pdf https://blogs.oracle.com/ldemichiel/entry/results_from_the_java_ee
  • 14.
    Java EE 8:Original Plan • Continued Enhancements for Web Standards Alignment • HTTP2, JSON Binding, JSON-P, MVC • Cloud enhancements • Security, RESTful Management API • CDI Programming Model • Ease of use, EJB via CDI • Smaller, but Important Features • Caching, Better Messaging • Alignment with Java SE 8
  • 15.
    Java EE 8 OriginalOverview • JMS 2.1 • JAX-RS 2.1 • JSF 2.3 • CDI 2.0 • JSON-P 1.1 • Servlet 4.0 • JCache 1.0 • JSON-B 1.0 • MVC 1.0 • Java EE Security1.0 • Java EE Management 2.0
  • 16.
    Java EE 8:New Proposal Expected release: Q4 2017 • JMS 2.1 • JAX-RS 2.1 • JSF 2.3 • CDI 2.0 • JSON-P 1.1 • Servlet 4.0 • JCache 1.0 • JSON-B 1.0 • MVC 1.0 • Java EE Security 1.0 • Java EE Management 2.0 ●Health Checking ●Configuration
  • 17.
    Java EE 9:New Proposal Expected release: Q4 2018 • Increased focus on microservices and cloud • Proposed new features: • Multi-tenancy • Circuit-breaker • Reactive programming support
  • 18.
  • 19.
    Servlet 4.0 • Principalgoal to support HTTP 2 • Modernization of internet protocol • Boost web performance • Early Draft has been published • Join mailing list or follow expert group (JSR 369) • Keep tabs on Ed Burns’ presentations, although not anything new since JavaOne 2015
  • 20.
    Servlet 4.0 • HTTP2 Support -> Major Update • Why do we need HTTP 2? • Problems with HTTP 1.1 • Head-of-Line Blocking • HTTP Pipelining, File Concatenation, & Image Sprites
  • 21.
    Servlet 4.0 HTTP 2 •Request/Response Multiplexing • Binary Framing • Socket Optimization • Upgrade from HTTP 1.1
  • 22.
    Servlet 4.0 Exposing HTTP2 • Stream Prioritization • New class Priority • Enhance HttpServletRequest and HttpServletResponse to accommodate • Server Push • Not replacing WebSockets
  • 23.
    Servlet 4.0 Newer HttpClientAPI (Java SE 9) • Plans to provide easy to use API • Support both HTTP/1.1 and 2 • Builds on existing Java API Classes
  • 24.
    JMS 2.1 (Proposed forRemoval) • JSR 368 - In early stages • No builds available for testing, as yet. • Planning: https://java.net/projects/jms- spec/pages/JMS21Planning
  • 25.
    JMS 2.1 • JMS2.0 was a major overhaul • Continuation of API Modernization • Declarative Message Listeners • Alternative to MDB • More Powerful Features • Available to all Beans
  • 26.
    JMS 2.1 • JMSProvider Portability Improvements • Dead Message Queues • Redelivery Behavior on JMS MDB Rollback (delays, max # consecutive)
  • 27.
    JMS 2.1 Asynchronous Batches •In JMS 2.0, messages delivered asynchronously by calling: javax.jms.MessageListener onMessage(Message message) • Define new: javax.jms.BatchMessageListener onMessages(Message[] messages)
  • 28.
    JMS 2.1 Declarative JMSListeners @ApplicationScoped @MaxConcurrency(10) public class HandlingEventRegistrationAttemptConsumer { @JmsListener( destinationLookup="jms/HandlingEventRegistrationAttempt Queue", selector="source = 'mobile'", batchSize=10, retry=5, retryDelay=7000, orderBy=TIMESTAMP) @Transactional public void onEventRegistrationAttempt( HandlingEventRegistrationAttempt... attempts) { ... } }
  • 29.
    JAX-RS 2.1 • JSR370 - In Early Stages • No builds available for testing • Follow JSR-370 EG and Mailing Lists
  • 30.
    JAX-RS 2.1 • HypermediaAPI • Reactive API • Security API • Support for SSE (Server Sent Events) • Improved CDI Integration • Support for Non-Blocking IO in Providers
  • 31.
    JAX-RS 2.1 • ConditionalJAXB on Runtimes • Integration with JSON-B • Support for CDI in Java SE
  • 32.
    JSF 2.3 • JSR372 - in active progress • Milestones available for testing • Read, Test, Supply Feedback
  • 33.
    JSF 2.3 • EnhancedCDI Integration • Lifecycle Enhancements • PostRenderViewEvent • EL API Enhancements • Configuration Enhancements • AJAX Enhancements
  • 34.
    JSF 2.3 Enhanced CDIIntegration • Injection of Resources @Inject FacesContext facesContext; @ApplicationMap @Inject Map applicationMap;
  • 35.
    JSF 2.3 Enhanced CDIIntegration • Wider Support of Injection into JSF Artifacts • javax.faces.convert.Converter • javax.faces.validator.Validator • javax.faces.component.behavior.Behavior • Upgraded to CDI qualifiers
  • 36.
    CDI 2.0 • JSR365 - in active progress • Test Releases of Reference Implementation (Weld 3.0.0 Alphas) • http://weld.cdi-spec.org/news/ • Follow the Expert Group
  • 37.
    CDI 2.0 • JavaSE Bootstrap • XML Configuration • Asynchronous Events@S@tar • @Startup for CDI Beans • Portable Extension SPI Simplification • Small features and enhancements
  • 38.
    CDI 2.0 Event System Enhancements •Asynchronous Events • Call to event.fireAsync() returns immediately @Inject private ExperimentalEvent<Configuration> event; … event.fireAsync(new Configuration());
  • 39.
    CDI 2.0 @Schedule OutsideEJB @ApplicationScoped public class MyScheduledBean { ... @Schedule(...) public void myScheduledTask() { ... } } @ApplicationScoped @Stereotype @Retention(RUNTIME) @Target(TYPE) @Schedule(...) public @interface MonthlyTask {}
  • 40.
    JSON-P 1.1 • JSR374 - In Early Draft Review • More Information: • https://json-processing-spec.java.net/ • Sources: https://java.net/projects/jsonp
  • 41.
    JSON-P 1.1 • Updatesto new API in Java EE 7 • New JSON Standards • JSON-Pointer and JSON-Patch • Editing Operations on JSON objects and arrays • Helper Classes and Enhanced Java SE 8 support
  • 42.
    JSON-P 1.1 Java SE8 Support • Stream Support JsonArray persons; persons.getValuesAs(JsonObject.class).stream() .filter(x->x.getString(“age”) >= 65) .forEach(System.out.println(x.getString(“name”)));
  • 43.
  • 44.
    JSON-P 1.1 JSON-Patch public voidshouldBuildJsonPatchExpressionUsingJsonPatchBuilder() { JsonPatchBuilder patchBuilder = new JsonPatchBuilder(); JsonObject result = patchBuilder.add("/email”, "john@example.com").replace("/age", 30) .remove("/phoneNumber”) .test("/firstName", "John”) .copy("/address/lastName", "/lastName”) .apply(buildPerson()); }
  • 45.
    Java EE ManagementAPI 2.0 (Proposed for Removal) • Currently working on Early Draft • Join mailing list of JSR 373
  • 46.
    Java EE ManagementAPI 2.0 • REST Based Interface to Supersede EJB Management APIs of JSR 77 • Monitoring and deployment as well • SSE for Event Support (WebSockets also under consideration)
  • 47.
  • 48.
    MVC (Proposed for Removal) •Model - View - Controller • JSR 371 • Active Progress…download milestones • Ozark: https://ozark.java.net/
  • 49.
    MVC • Action-Based WebFramework for Java EE • Follows suit of Spring MVC or Apache Struts • Does Not Replace JSF • Model: CDI, Bean Validation, JPA • View: Facelets, JSP (Extensible) • Controller: Layered on top of JAX-RS
  • 50.
    MVC Controller Example @Controller @Path("/customers") @View("my-view.jsp") public classCustomerController { @Inject private Models models; @GET public String getItems(){ ... return “customers.jsp”; }
  • 51.
    MVC View Example <c:forEach var="customer"items="${customers}"> <tr> <td class="text-left">${customer.name}</td> <td class="text-center"> <form action="${pageContext.request.contextPath}/r/customers/edit" method="POST"> <input type="hidden" name="id" value="${item.id}"/> <button type="submit"> Edit </button> </form> </td> </tr> </c:forEach>
  • 52.
    JSON-B • Java APIfor JSON Binding • JSR 367 - Public Review • Read the spec, start testing: https://java.net/projects/jsonb-spec/pages/Home
  • 53.
    JSON-B • Standardize meansof converting JSON to Java objects and vice versa • Default mapping algorithm for converting Java classes • Draw from best of breed ideas in existing JSON binding solutions • Provide JAX-RS a standard way to support “application/json” for POJOs • JAX-RS currently supports JSON-P
  • 54.
    JSON-B Mapping @Entity public classPerson { @Id String name; String gender; @ElementCollection Map<String, String> phones; ... } Person duke = new Person(); duke.setName("Duke"); duke.setGender("Male"); phones = new HashMap<>(); phones.put("home", "650-123-4567"); phones.put("mobile", "650-234-5678"); duke.setPhones(phones); { "name":"Duke", "gender":"Male", "phones":{ "home":"650-123-4567", "mobile":"650-234-5678" } }
  • 55.
    JSON-B Proposed API -Custom Mapping • Utilization of annotations to map fields to JSON Document Elements { poolType : “Inground”, } @JsonProperty(“poolType”) public String poolType; { poolType : “Inground”, shape : “Rectangle” } @JsonPropertyOrder(“poolType”, ”shape”) public class Pool(){ public String poolType; public String shape; … }
  • 56.
    Java EE Security •JSR 365 • Early Draft Development • Improve Java EE platform by ensuring that the security API is useful in the modern cloud/PaaS paradigm • Simplify, standardize, modernize • Promotes modern concepts (EL and CDI)
  • 57.
    Java EE Security •Simple security providers • Easy pluggability and mapping • Enabling Existing Security Annotations for all beans
  • 58.
    Java EE Security ProposedSecurity Provider @SecurityProvider public class MySecurityProvider { @Inject UserService userService; @OnAuthentication // The parameters could suit the credentials mechanism being used. public Principal getPrincipal(String username, String password) { // Construct the principal using the user service. } @OnAuthorization public String[] getRoles (Principal principal) { // Construct an array of roles using the principal and user service. } }
  • 59.
    Java EE Security •Proposed Idea Examples: • https://github.com/javaee-security-spec/javaee- security-proposals
  • 60.
    JCache • Java TemporaryCaching API • JSR 107 - Started in 2001 • Finished in 2014 • Provides a common way for Java applications to create, access, update, and remove entries from caches
  • 61.
    JCache • Provide applicationswith caching functionality…particularly the ability to cache Java objects • Define common set of caching concepts & facilities • Minimize learning curve • Maximize portability • Support in-process and distributed cache implementations
  • 62.
    JCache • Unknown status...notmentioned in the Oracle update • Make use of JCache with some application servers now with CDI
  • 63.
    Health Checking • Newlyproposed specification, geared towards monitoring the health of microservices • Client-side standard • Automatic, periodic, and self-monitoring • Possibly statistics
  • 64.
    Configuration • Standard forexternalizing configuration • Aimed at cloud based environments • Provide the ability to change one or more configurations that are independent/decoupled of apps...multiple configuration files • Unified API for accessing configuration in many different environments • Layering and Overrides
  • 65.
    Not Addressed • JPA •WebSocket • Concurrency Utilities • etc...
  • 66.
    Java EE 8Timeline Q4 2014 Expert Groups Q4 2015 Early Draft Q1 2016 Public Review Q3 2016 Proposed Final Draft H2 2017? Final Release Java EE.Next
  • 67.
    Java EE 8: TakeAction • Start working with Java EE 8 today • Tools: • GlassFish v4.1, Payara 5 Branch • Milestones • Examples and Specification Docs
  • 68.
    Adopt-A-JSR • Started in2007, easy way for JUGs to get involved • What you can do depends upon what you want to do & what spec leads are looking for
  • 69.