SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
What's new and noteworthy in Java EE 8?
Expertenkreis Java, 05.12.2017, GEDOPLAN
Dirk Weil, GEDOPLAN GmbH
Dirk Weil
GEDOPLAN GmbH, Bielefeld
GEDOPLAN IT Consulting
Konzeption, Realisierung von IT-Lösungen
GEDOPLAN IT Training
Seminare in Berlin, Bielefeld, on-site
Java EE seit 1998
Vorträge, Veröffentlichungen
What's new and noteworthy in Java EE 8? 2gedoplan.de
New and noteworthy in CDI 2.0
Observer ordering
What's new and noteworthy in Java EE 8? 3gedoplan.de
@ApplicationScoped
public class EventObserver {
void a(@Observes @Priority(Interceptor.Priority.APPLICATION + 1) DemoEvent e) {
…
}
void b(@Observes @Priority(Interceptor.Priority.APPLICATION + 2) DemoEvent e) {
…
}
@ApplicationScoped
public class EventProducer {
@Inject
Event<DemoEvent> eventSource;
public void fireSyncEvent() {
this.eventSource.fire(new DemoEvent());
New and noteworthy in CDI 2.0
Asynchronuous
events
What's new and noteworthy in Java EE 8? 4gedoplan.de
@ApplicationScoped
public class EventObserver {
void x(@ObservesAsync DemoEvent e) {
…
}
void y(@ObservesAsync DemoEvent e) {
…
}
@ApplicationScoped
public class EventProducer {
@Inject
Event<DemoEvent> eventSource;
public void fireAsyncEvent() {
CompletionStage<DemoEvent> completionStage
= this.eventSource.fireAsync(new DemoEvent());
New and noteworthy in CDI 2.0
SE container
What's new and noteworthy in Java EE 8? 5gedoplan.de
SeContainerInitializer seContainerInitializer
= SeContainerInitializer.newInstance();
try (SeContainer container = seContainerInitializer.initialize()) {
HelloWorldService helloWorldService
= container.select(HelloWorldService.class).get();
this.log.debug(helloWorldService.getHelloWorld());
}
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-shaded</artifactId>
<version>3.0.2.Final</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-se</artifactId>
<version>2.0.2</version>
</dependency>
New and noteworthy in CDI 2.0
Java 8 alignment
Repeatable qualifier annotations
Instance.stream()
Various minor adjustments
No context control in SE 
What's new and noteworthy in Java EE 8? 6gedoplan.de
New and noteworthy in Bean Validation 2.0
New constraints
@Email, @NotEmpty, @NotBlank, @Positive,
@PositiveOrZero, @Negative, @NegativeOrZero,
@PastOrPresent, @FutureOrPresent
Container element constraints
Java 8 alignment
Repeatable constraint annotations
Support for Java 8 date and time types
Support for Optional<T>
What's new and noteworthy in Java EE 8? 7gedoplan.de
List<@Positive @Max(6) Integer> marks;
Optional<@Email String> getEmail() {
…
}
New and noteworthy in JPA 2.2
Java 8 alignment
Repeatable annotations
Support for LocalDate, LocalDateTime, LocalTime,
OffsetDateTime, OffsetTime
Query.getResultStream()
Allow CDI injections into AttributeConverter
What's new and noteworthy in Java EE 8? 8gedoplan.de
public class Employee {
@AttributeOverride(name = "street", column = @Column(name = "HOME_STREET"))
@AttributeOverride(name = "zipCode", column = @Column(name = "HOME_ZIPCODE"))
@AttributeOverride(name = "city", column = @Column(name = "HOME_CITY"))
private Address homeAddress;
public class DocumentRepository {
public Stream<Document> findAllAsStream() {
return entityManager
.createQuery("select x from Document x", Document.class)
.getResultStream();
New and noteworthy in JSF 2.3
Java Time Support in <f:convertDateTime>
CDI integration
Deprecate javax.faces.bean
Allow injection of specific JSF artifacts (e.g. FacesContext)
Support CDI injections into converters
What's new and noteworthy in Java EE 8? 9gedoplan.de
<h:outputText id="founded" value="#{countryPresenter.someCountry.founded}">
<f:convertDateTime type="localDate"/>
</h:outputText>
public class Country {
private LocalDate founded;
@FacesConverter(forClass = Country.class, managed = true)
public class CountryConverter implements Converter<Country> {
@Inject
CountryRepository countryRepository;
New and noteworthy in JSF 2.3
Websocket integration
What's new and noteworthy in Java EE 8? 10gedoplan.de
<f:websocket
channel="ticker"
onmessage="function(message) {
document.getElementById('coolNewFeature').value=message;
}" />
<h:inputText id="coolNewFeature" value="" size="25" readonly="true" />
public class TickerEndpoint {
@Inject
@Push(channel = "ticker")
private PushContext channel;
public void tick() {
String message = …
this.channel.send(message);
New and noteworthy in JSF 2.3
Multi-field validation
Use non-default
bean validation
group for one or
more input fields
Use <f:validateWholeBean> after input fields
Enable feature in web.xml
Works by validating a temporary copy
Not working on GlassFish 5 
Incredibly bloated 
What's new and noteworthy in Java EE 8? 11gedoplan.de
<h:inputText value="#{questionnaire.email}">
<f:validateBean validationGroups="InitialInput" />
</h:inputText>
<h:inputText value="#{questionnaire.comment}">
<f:validateBean validationGroups="InitialInput" />
</h:inputText>
<f:validateWholeBean value="#{questionnaire}"
validationGroups="InitialInput" />
New and noteworthy: JSON-B 1.0
Java – JSON binding
Similar to JAXB
Mapping annotations
@JsonbVisibility
@JsonbNillable
@JsonbTransient
@JsonbTypeAdapter
@JsonbDateFormat
@JsonbNumberFormat
What's new and noteworthy in Java EE 8? 12gedoplan.de
@JsonbNillable
public class Country {
private String id;
private String name;
@JsonbTypeAdapter(ContinentConverter.class)
private Continent continent;
@JsonbTransient
private String dummy = "unused";
New and noteworthy: JSON-B 1.0
(De)serialization API: JsonbBuilder, Jsonb
Configuration:
Class level annotations (@JsonbNillable, …)
JsonbConfig
What's new and noteworthy in Java EE 8? 13gedoplan.de
Country country = …
try (Jsonb jsonb = JsonbBuilder.create()) {
String json = jsonb.toJson(country);
…
} String json = …
try (Jsonb jsonb = JsonbBuilder.create()) {
Country country = jsonb.fromJson(json, Country.class);
…
}
JsonbConfig jsonbConfig = new JsonbConfig().withFormatting(true);
Jsonb jsonb = JsonbBuilder.create(jsonbConfig);
New and noteworthy in Servlet 4.0
HTTP/2 support
Header compression
Request multiplexing:
Allow multiple parallel requests on same connection
Server push:
Send content probably needed in advance
In general „behind the scenes“
What's new and noteworthy in Java EE 8? 14gedoplan.de
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
PushBuilder pushBuilder = req.newPushBuilder();
if (pushBuilder != null) {
pushBuilder.path("/dummy.css").push();
}
…
New and noteworthy in JAX-RS 2.1
Reactive client support
What's new and noteworthy in Java EE 8? 15gedoplan.de
Client client= ClientBuilder.newClient();
CompletionStage<String> planetearthCompletionStage = client
.path("http://localhost:8080/whats-new-in-jee8/rest/planetearth")
.request()
.accept(MediaType.TEXT_PLAIN)
.rx()
.get(String.class)
.exceptionally(e -> "the ultimate question of life, the universe, and everything");
New and noteworthy in JAX-RS 2.1
SSE support
What's new and noteworthy in Java EE 8? 16gedoplan.de
@Path("sse")
public class SseResource {
@Context Sse sse;
SseBroadcaster sseBroadcaster;
@PostConstruct
void init() {
this.sseBroadcaster = this.sse.newBroadcaster();
}
@GET
@Produces(MediaType.SERVER_SENT_EVENTS)
public void register(@Context SseEventSink sseEventSink) {
this.sseBroadcaster.register(sseEventSink);
}
public void tick() {
this.sseBroadcaster.broadcast(this.sse.newEvent("Hello, it is " + new Date()));
}
New and noteworthy in JAX-RS 2.1
SSE support
What's new and noteworthy in Java EE 8? 17gedoplan.de
try (SseEventSource sseEventSource = SseEventSource
.target("http://localhost:8080/whats-new-in-jee8/rest/sse")
.build()) {
sseEventSource.register(e -> log.debug("Event received: " + e));
sseEventSource.open();
Odds and ends
JSON-P
JSON-Pointer
JSON-Patch
JSON-Big-Data
Java EE Security API
Authentication Mechanism
Identity Store
Security Context
What's new and noteworthy in Java EE 8? 18gedoplan.de
<TTFN>
 -  = 3 years, 5 months
Evolution or maintenance release?
Implementations
GlassFish 5.0 (big areas nonfunctional)
Payara 5.0.0 (still alpha)
Open Liberty (daily build)
What's new and noteworthy in Java EE 8? 19gedoplan.de
The future …
What's new and noteworthy in Java EE 8? 20gedoplan.de
More
gedoplan-it-consulting.de/expertenkreis-java
Slides
github.com/GEDOPLAN/whats-new-in-jee8
Demo project
www.gedoplan-it-training.de
Trainings in Berlin, Bielefeld, inhouse
www.gedoplan-it-consulting.de
Reviews, Coaching, …
Blog
 dirk.weil@gedoplan.de
@dirkweil
What's new and noteworthy in Java EE 8? 21gedoplan.de

Contenu connexe

Tendances

OrientDB - The 2nd generation of (multi-model) NoSQL
OrientDB - The 2nd generation of  (multi-model) NoSQLOrientDB - The 2nd generation of  (multi-model) NoSQL
OrientDB - The 2nd generation of (multi-model) NoSQLRoberto Franchini
 
Synthesizing API Usage Examples
Synthesizing API Usage Examples Synthesizing API Usage Examples
Synthesizing API Usage Examples Ray Buse
 
Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113SOAT
 
Kotlin is charming; The reasons Java engineers should start Kotlin.
Kotlin is charming; The reasons Java engineers should start Kotlin.Kotlin is charming; The reasons Java engineers should start Kotlin.
Kotlin is charming; The reasons Java engineers should start Kotlin.JustSystems Corporation
 
Laporan multi client
Laporan multi clientLaporan multi client
Laporan multi clientichsanbarokah
 
Vaadin 7 Today and Tomorrow
Vaadin 7 Today and TomorrowVaadin 7 Today and Tomorrow
Vaadin 7 Today and TomorrowJoonas Lehtinen
 
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald PehlGWTcon
 
Dependency Injection with CDI in 15 minutes
Dependency Injection with CDI in 15 minutesDependency Injection with CDI in 15 minutes
Dependency Injection with CDI in 15 minutesAntonio Goncalves
 
Kotlin 101 for Java Developers
Kotlin 101 for Java DevelopersKotlin 101 for Java Developers
Kotlin 101 for Java DevelopersChristoph Pickl
 
The Ring programming language version 1.6 book - Part 184 of 189
The Ring programming language version 1.6 book - Part 184 of 189The Ring programming language version 1.6 book - Part 184 of 189
The Ring programming language version 1.6 book - Part 184 of 189Mahmoud Samir Fayed
 
Implementing CQRS and Event Sourcing with RavenDB
Implementing CQRS and Event Sourcing with RavenDBImplementing CQRS and Event Sourcing with RavenDB
Implementing CQRS and Event Sourcing with RavenDBOren Eini
 
Better Code: Concurrency
Better Code: ConcurrencyBetter Code: Concurrency
Better Code: ConcurrencyPlatonov Sergey
 
Introduction to CDI and DI in Java EE 6
Introduction to CDI and DI in Java EE 6Introduction to CDI and DI in Java EE 6
Introduction to CDI and DI in Java EE 6Ray Ploski
 

Tendances (20)

Qtp test
Qtp testQtp test
Qtp test
 
OrientDB - The 2nd generation of (multi-model) NoSQL
OrientDB - The 2nd generation of  (multi-model) NoSQLOrientDB - The 2nd generation of  (multi-model) NoSQL
OrientDB - The 2nd generation of (multi-model) NoSQL
 
Synthesizing API Usage Examples
Synthesizing API Usage Examples Synthesizing API Usage Examples
Synthesizing API Usage Examples
 
Graphql, REST and Apollo
Graphql, REST and ApolloGraphql, REST and Apollo
Graphql, REST and Apollo
 
Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113
 
Kotlin is charming; The reasons Java engineers should start Kotlin.
Kotlin is charming; The reasons Java engineers should start Kotlin.Kotlin is charming; The reasons Java engineers should start Kotlin.
Kotlin is charming; The reasons Java engineers should start Kotlin.
 
Laporan multi client
Laporan multi clientLaporan multi client
Laporan multi client
 
Vaadin 7 Today and Tomorrow
Vaadin 7 Today and TomorrowVaadin 7 Today and Tomorrow
Vaadin 7 Today and Tomorrow
 
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
 
Dependency Injection with CDI in 15 minutes
Dependency Injection with CDI in 15 minutesDependency Injection with CDI in 15 minutes
Dependency Injection with CDI in 15 minutes
 
Kotlin meets Gadsu
Kotlin meets GadsuKotlin meets Gadsu
Kotlin meets Gadsu
 
greenDAO
greenDAOgreenDAO
greenDAO
 
Kotlin 101 for Java Developers
Kotlin 101 for Java DevelopersKotlin 101 for Java Developers
Kotlin 101 for Java Developers
 
The Ring programming language version 1.6 book - Part 184 of 189
The Ring programming language version 1.6 book - Part 184 of 189The Ring programming language version 1.6 book - Part 184 of 189
The Ring programming language version 1.6 book - Part 184 of 189
 
Hidden rocks in Oracle ADF
Hidden rocks in Oracle ADFHidden rocks in Oracle ADF
Hidden rocks in Oracle ADF
 
droidparts
droidpartsdroidparts
droidparts
 
Angular 2 introduction
Angular 2 introductionAngular 2 introduction
Angular 2 introduction
 
Implementing CQRS and Event Sourcing with RavenDB
Implementing CQRS and Event Sourcing with RavenDBImplementing CQRS and Event Sourcing with RavenDB
Implementing CQRS and Event Sourcing with RavenDB
 
Better Code: Concurrency
Better Code: ConcurrencyBetter Code: Concurrency
Better Code: Concurrency
 
Introduction to CDI and DI in Java EE 6
Introduction to CDI and DI in Java EE 6Introduction to CDI and DI in Java EE 6
Introduction to CDI and DI in Java EE 6
 

Similaire à What's new and noteworthy in Java EE 8?

Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Murat Yener
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
Android dev toolbox
Android dev toolboxAndroid dev toolbox
Android dev toolboxShem Magnezi
 
Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015Svetlin Nakov
 
JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?gedoplan
 
JavaCro 2014 Scala and Java EE 7 Development Experiences
JavaCro 2014 Scala and Java EE 7 Development ExperiencesJavaCro 2014 Scala and Java EE 7 Development Experiences
JavaCro 2014 Scala and Java EE 7 Development ExperiencesPeter Pilgrim
 
JDK1.7 features
JDK1.7 featuresJDK1.7 features
JDK1.7 featuresindia_mani
 
MVC and Entity Framework
MVC and Entity FrameworkMVC and Entity Framework
MVC and Entity FrameworkJames Johnson
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on AndroidSven Haiges
 
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Red Hat Developers
 
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallJavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallYuichi Sakuraba
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7Deniz Oguz
 
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09Daniel Bryant
 
EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)Montreal JUG
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLsintelliyole
 

Similaire à What's new and noteworthy in Java EE 8? (20)

Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Android dev toolbox
Android dev toolboxAndroid dev toolbox
Android dev toolbox
 
Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015
 
Green dao
Green daoGreen dao
Green dao
 
JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?
 
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter PilgrimJavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
 
JavaCro 2014 Scala and Java EE 7 Development Experiences
JavaCro 2014 Scala and Java EE 7 Development ExperiencesJavaCro 2014 Scala and Java EE 7 Development Experiences
JavaCro 2014 Scala and Java EE 7 Development Experiences
 
JDK1.7 features
JDK1.7 featuresJDK1.7 features
JDK1.7 features
 
MVC and Entity Framework
MVC and Entity FrameworkMVC and Entity Framework
MVC and Entity Framework
 
Ejb examples
Ejb examplesEjb examples
Ejb examples
 
Json generation
Json generationJson generation
Json generation
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on Android
 
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
 
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallJavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7
 
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
 
Play 2.0
Play 2.0Play 2.0
Play 2.0
 
EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
 

Dernier

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 

Dernier (20)

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 

What's new and noteworthy in Java EE 8?

  • 1. What's new and noteworthy in Java EE 8? Expertenkreis Java, 05.12.2017, GEDOPLAN Dirk Weil, GEDOPLAN GmbH
  • 2. Dirk Weil GEDOPLAN GmbH, Bielefeld GEDOPLAN IT Consulting Konzeption, Realisierung von IT-Lösungen GEDOPLAN IT Training Seminare in Berlin, Bielefeld, on-site Java EE seit 1998 Vorträge, Veröffentlichungen What's new and noteworthy in Java EE 8? 2gedoplan.de
  • 3. New and noteworthy in CDI 2.0 Observer ordering What's new and noteworthy in Java EE 8? 3gedoplan.de @ApplicationScoped public class EventObserver { void a(@Observes @Priority(Interceptor.Priority.APPLICATION + 1) DemoEvent e) { … } void b(@Observes @Priority(Interceptor.Priority.APPLICATION + 2) DemoEvent e) { … } @ApplicationScoped public class EventProducer { @Inject Event<DemoEvent> eventSource; public void fireSyncEvent() { this.eventSource.fire(new DemoEvent());
  • 4. New and noteworthy in CDI 2.0 Asynchronuous events What's new and noteworthy in Java EE 8? 4gedoplan.de @ApplicationScoped public class EventObserver { void x(@ObservesAsync DemoEvent e) { … } void y(@ObservesAsync DemoEvent e) { … } @ApplicationScoped public class EventProducer { @Inject Event<DemoEvent> eventSource; public void fireAsyncEvent() { CompletionStage<DemoEvent> completionStage = this.eventSource.fireAsync(new DemoEvent());
  • 5. New and noteworthy in CDI 2.0 SE container What's new and noteworthy in Java EE 8? 5gedoplan.de SeContainerInitializer seContainerInitializer = SeContainerInitializer.newInstance(); try (SeContainer container = seContainerInitializer.initialize()) { HelloWorldService helloWorldService = container.select(HelloWorldService.class).get(); this.log.debug(helloWorldService.getHelloWorld()); } <dependency> <groupId>org.jboss.weld.se</groupId> <artifactId>weld-se-shaded</artifactId> <version>3.0.2.Final</version> </dependency> <dependency> <groupId>org.apache.openwebbeans</groupId> <artifactId>openwebbeans-se</artifactId> <version>2.0.2</version> </dependency>
  • 6. New and noteworthy in CDI 2.0 Java 8 alignment Repeatable qualifier annotations Instance.stream() Various minor adjustments No context control in SE  What's new and noteworthy in Java EE 8? 6gedoplan.de
  • 7. New and noteworthy in Bean Validation 2.0 New constraints @Email, @NotEmpty, @NotBlank, @Positive, @PositiveOrZero, @Negative, @NegativeOrZero, @PastOrPresent, @FutureOrPresent Container element constraints Java 8 alignment Repeatable constraint annotations Support for Java 8 date and time types Support for Optional<T> What's new and noteworthy in Java EE 8? 7gedoplan.de List<@Positive @Max(6) Integer> marks; Optional<@Email String> getEmail() { … }
  • 8. New and noteworthy in JPA 2.2 Java 8 alignment Repeatable annotations Support for LocalDate, LocalDateTime, LocalTime, OffsetDateTime, OffsetTime Query.getResultStream() Allow CDI injections into AttributeConverter What's new and noteworthy in Java EE 8? 8gedoplan.de public class Employee { @AttributeOverride(name = "street", column = @Column(name = "HOME_STREET")) @AttributeOverride(name = "zipCode", column = @Column(name = "HOME_ZIPCODE")) @AttributeOverride(name = "city", column = @Column(name = "HOME_CITY")) private Address homeAddress; public class DocumentRepository { public Stream<Document> findAllAsStream() { return entityManager .createQuery("select x from Document x", Document.class) .getResultStream();
  • 9. New and noteworthy in JSF 2.3 Java Time Support in <f:convertDateTime> CDI integration Deprecate javax.faces.bean Allow injection of specific JSF artifacts (e.g. FacesContext) Support CDI injections into converters What's new and noteworthy in Java EE 8? 9gedoplan.de <h:outputText id="founded" value="#{countryPresenter.someCountry.founded}"> <f:convertDateTime type="localDate"/> </h:outputText> public class Country { private LocalDate founded; @FacesConverter(forClass = Country.class, managed = true) public class CountryConverter implements Converter<Country> { @Inject CountryRepository countryRepository;
  • 10. New and noteworthy in JSF 2.3 Websocket integration What's new and noteworthy in Java EE 8? 10gedoplan.de <f:websocket channel="ticker" onmessage="function(message) { document.getElementById('coolNewFeature').value=message; }" /> <h:inputText id="coolNewFeature" value="" size="25" readonly="true" /> public class TickerEndpoint { @Inject @Push(channel = "ticker") private PushContext channel; public void tick() { String message = … this.channel.send(message);
  • 11. New and noteworthy in JSF 2.3 Multi-field validation Use non-default bean validation group for one or more input fields Use <f:validateWholeBean> after input fields Enable feature in web.xml Works by validating a temporary copy Not working on GlassFish 5  Incredibly bloated  What's new and noteworthy in Java EE 8? 11gedoplan.de <h:inputText value="#{questionnaire.email}"> <f:validateBean validationGroups="InitialInput" /> </h:inputText> <h:inputText value="#{questionnaire.comment}"> <f:validateBean validationGroups="InitialInput" /> </h:inputText> <f:validateWholeBean value="#{questionnaire}" validationGroups="InitialInput" />
  • 12. New and noteworthy: JSON-B 1.0 Java – JSON binding Similar to JAXB Mapping annotations @JsonbVisibility @JsonbNillable @JsonbTransient @JsonbTypeAdapter @JsonbDateFormat @JsonbNumberFormat What's new and noteworthy in Java EE 8? 12gedoplan.de @JsonbNillable public class Country { private String id; private String name; @JsonbTypeAdapter(ContinentConverter.class) private Continent continent; @JsonbTransient private String dummy = "unused";
  • 13. New and noteworthy: JSON-B 1.0 (De)serialization API: JsonbBuilder, Jsonb Configuration: Class level annotations (@JsonbNillable, …) JsonbConfig What's new and noteworthy in Java EE 8? 13gedoplan.de Country country = … try (Jsonb jsonb = JsonbBuilder.create()) { String json = jsonb.toJson(country); … } String json = … try (Jsonb jsonb = JsonbBuilder.create()) { Country country = jsonb.fromJson(json, Country.class); … } JsonbConfig jsonbConfig = new JsonbConfig().withFormatting(true); Jsonb jsonb = JsonbBuilder.create(jsonbConfig);
  • 14. New and noteworthy in Servlet 4.0 HTTP/2 support Header compression Request multiplexing: Allow multiple parallel requests on same connection Server push: Send content probably needed in advance In general „behind the scenes“ What's new and noteworthy in Java EE 8? 14gedoplan.de protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { PushBuilder pushBuilder = req.newPushBuilder(); if (pushBuilder != null) { pushBuilder.path("/dummy.css").push(); } …
  • 15. New and noteworthy in JAX-RS 2.1 Reactive client support What's new and noteworthy in Java EE 8? 15gedoplan.de Client client= ClientBuilder.newClient(); CompletionStage<String> planetearthCompletionStage = client .path("http://localhost:8080/whats-new-in-jee8/rest/planetearth") .request() .accept(MediaType.TEXT_PLAIN) .rx() .get(String.class) .exceptionally(e -> "the ultimate question of life, the universe, and everything");
  • 16. New and noteworthy in JAX-RS 2.1 SSE support What's new and noteworthy in Java EE 8? 16gedoplan.de @Path("sse") public class SseResource { @Context Sse sse; SseBroadcaster sseBroadcaster; @PostConstruct void init() { this.sseBroadcaster = this.sse.newBroadcaster(); } @GET @Produces(MediaType.SERVER_SENT_EVENTS) public void register(@Context SseEventSink sseEventSink) { this.sseBroadcaster.register(sseEventSink); } public void tick() { this.sseBroadcaster.broadcast(this.sse.newEvent("Hello, it is " + new Date())); }
  • 17. New and noteworthy in JAX-RS 2.1 SSE support What's new and noteworthy in Java EE 8? 17gedoplan.de try (SseEventSource sseEventSource = SseEventSource .target("http://localhost:8080/whats-new-in-jee8/rest/sse") .build()) { sseEventSource.register(e -> log.debug("Event received: " + e)); sseEventSource.open();
  • 18. Odds and ends JSON-P JSON-Pointer JSON-Patch JSON-Big-Data Java EE Security API Authentication Mechanism Identity Store Security Context What's new and noteworthy in Java EE 8? 18gedoplan.de
  • 19. <TTFN>  -  = 3 years, 5 months Evolution or maintenance release? Implementations GlassFish 5.0 (big areas nonfunctional) Payara 5.0.0 (still alpha) Open Liberty (daily build) What's new and noteworthy in Java EE 8? 19gedoplan.de
  • 20. The future … What's new and noteworthy in Java EE 8? 20gedoplan.de
  • 21. More gedoplan-it-consulting.de/expertenkreis-java Slides github.com/GEDOPLAN/whats-new-in-jee8 Demo project www.gedoplan-it-training.de Trainings in Berlin, Bielefeld, inhouse www.gedoplan-it-consulting.de Reviews, Coaching, … Blog  dirk.weil@gedoplan.de @dirkweil What's new and noteworthy in Java EE 8? 21gedoplan.de