SlideShare a Scribd company logo
Java 9 Overview
Mateusz
Skawiński
I work on position of Technical Leader in SoftServe. I work with Java on
professional, commercial projects since 2009. Over the years, I was interested and
involved in using object oriented programming in large enterprise applications.
Currently working on real time data integrations of large HCM systems.
Agenda
• Java Platform Module System
• JShell
• Reactive Streams
• Process API
• HTTP API
• Other
Java Platform
Module System
Java Platform Module System – What?
• JSR 376 – Project Jigsaw (http://openjdk.java.net/projects/jigsaw)
• Named, self-describing collection of code and data.
• JDK has been divided into a set of modules.
• Adds a higher level of aggregation above packages.
Java Platform Module System – Why?
• Reliable configuration, to replace classpath mechanism with a means for program components
to declare explicit dependences upon one another.
• Strong encapsulation, to allow a component to declare which of its public types are accessible to
other components, and which are not.
• Make it easier for developers to construct and maintain libraries and large applications.
• Improve the security and maintainability of Java SE Platform Implementations in general, and the JDK
in particular.
• Enable improved application performance.
• Enable the Java SE Platform, and the JDK, to scale down for use in small computing devices and
dense cloud deployments.
Java Platform Module System – How?
• Define a module: Files structure module-info.java
• Declare requirements
• Define exposed packages
module com.itc {
requires com.coffee;
requires com.tea;
exports com.itc;
}
Example – com.coffee
Example – com.coffee
package com.coffee;
public interface Coffee {
void drink();
}
package com.coffee;
import com.coffee.types.Arabica;
import com.coffee.types.Robusta;
public class CoffeeMaker {
public Coffee brewArabica() {
return new Arabica();
}
public Coffee brewRobusta() {
return new Robusta();
}
}
module com.coffee {
exports com.coffee;
}
Example – com.coffee.types
package com.coffee.types;
import com.coffee.Coffee;
public class Arabica implements
Coffee {
@Override
public void drink() {
System.out.println
("Strong black arabica");
}
}
package com.coffee.types;
import com.coffee.Coffee;
public class Robusta implements
Coffee {
@Override
public void drink() {
System.out.println
("Full of caffeine robusta");
}
}
Example – com.itc
package com.itc;
import com.coffee.Coffee;
import com.coffee.CoffeeMaker;
public class ILikeCoffee {
public static void main(String[] args) {
CoffeeMaker coffeeMaker = new CoffeeMaker();
final Coffee wakeUpCoffee = coffeeMaker.brewRobusta();
final Coffee eveningCoffee = coffeeMaker.brewArabica();
wakeUpCoffee.drink(); // Full of caffeine robusta
eveningCoffee.drink(); // Strong black arabica
} …
Example – com.itc
package com.itc;
import com.coffee.Coffee;
import com.coffee.CoffeeMaker;
import com.coffee.types.Arabica;
public class ILikeCoffee {…
The type com.coffee.types.Arabica is not
accessible
module com.itc {
requires com.coffee;
requires com.coffee.types;
}
com.coffee.types cannot be resolved to a module
Backward Compatibility
• JDK was divided into set of modules – java.base – 78 modules
• Classpath can be used
• Unnamed modules
• Automatic modules
Unnamed Modules
• A class which is not a member of any named module.
• Classed compiled in Java 8 and older versions which are not migrated to modules when run in Java 9.
• The unnamed module requires all other available named modules.
• The unnamed module exports all its packages.
• Named modules can not have a dependency on the unnamed module.
Automatic Modules
• JAR files are automatically detected as modules.
• Module name will be automaticaly created based on JAR file name.
• The automatic module requires all other available named modules.
• The automatic module exports all its packages.
Example – com.tea
module com.itc {
requires com.coffee;
requires com.tea;
}
package com.itc;
import com.tea.Tea;
import com.tea.types.Roiboos;
public class ILikeTea {
public static void main(String[] args) {
final Tea tea = new Roiboos();
tea.drink(); } }
JLink
• Command line tool.
• Generate your own JRE.
• Set required modules.
• Less consumption (deployment size, memory, performance).
• Embedded, IoT, microservices.
• All in One
Beyond Modules
JShell
• Read-Evaluate-Print Loop (REPL), which evaluates declarations, statements, and expressions
as they are entered and immediately shows the results.
• Command line tool.
• Its quick, small and easy.
JShell – External Editor
Reactive Streams
• Near real time, asynchronous processing.
• Not predetermined data volume.
• Load leverage (backpressure).
• Publisher - subscriber.
• http://www.reactive-streams.org
• Multiple implementations available
Producer Subscriber
Subscription
subscribe()
create
onSubscribe(s)
alternative
[via subscription]
[direct]
send m items
request(n)
onNext() - m items
send n items
request(m)
onNext() - m items
request(n)
m >= n
java.util.concurrent.Flow
Modifier and Type Class Description
static interface Flow.Processor<T,R> A component that acts as both a Subscriber and Publisher.
static interface Flow.Publisher<T> A producer of items (and related control messages) received by Subscribers.
static interface Flow.Subscriber<T> A receiver of messages.
static interface Flow.Subscription Message control linking a Flow.Publisher and Flow.Subscriber.
java.util.concurrent.Flow
public interface Publisher<T> {
public void subscribe(Subscriber<? super T> s); }
public interface Subscriber<T> {
public void onSubscribe(Subscription s);
public void onNext(T t);
public void onError(Throwable t);
public void onComplete(); }
public interface Subscription {
public void request(long n);
public void cancel(); }
public interface Processor<T, R> extends Subscriber<T>, Publisher<R> {}
Process API
• Start, retrieve information about, and manage native operating system processes.
• New interfaces: ProcessHandle and ProcessHandle.Info
• Operating system independant API
• process.toHandle()
• Process class extension.
ProcessHandle (selected)
Modifier and Type Method Description
static Stream<ProcessHandle> allProcesses​() Returns a snapshot of all processes visible to the current process.
Stream<ProcessHandle> children​() Returns a snapshot of the current direct children of the process.
static ProcessHandle current​() Returns a ProcessHandle for the current process.
Stream<ProcessHandle> descendants​() Returns a snapshot of the descendants of the process.
ProcessHandle.Info info​() Returns a snapshot of information about the process.
CompletableFuture<ProcessHandle> onExit​() Returns a CompletableFuture<ProcessHandle> for the termination of the
process.
Optional<ProcessHandle> parent​() Returns an Optional<ProcessHandle> for the parent process.
long pid​() Returns the native process ID of the process.
ProcessHandle.Info
Modifier and Type Method Description
Optional<String[]> arguments​() Returns an array of Strings of the arguments of the process.
Optional<String> command​() Returns the executable pathname of the process.
Optional<String> commandLine​() Returns the command line of the process.
Optional<Instant> startInstant​() Returns the start time of the process.
Optional<Duration> totalCpuDuration​() Returns the total cputime accumulated of the process.
Optional<String> user​() Return the user of the process.
HTTP API
• Working with HttpURLConnection is inconvinient.
• Streams operations.
• Pre Java 9 external libs were used.
• HttpClient class.
• Supports HTTP2 spec.
Other
• List.of
List<String> coffies = List.of("Espresso", "Americano", "Cappuchino", "Latte");
• New default garbage collector: ParallelGC → G1GC.
• Private methods in interfaces.
• Try with resources improvement.
• Javadocs improvement (html5).
• Security improvements (incl. SHA-3 Hash algorithms)
• … and more → https://docs.oracle.com/javase/9/whatsnew/toc.htm
Thank you
See you on our next
meeting in April!
19 / 04 / 2018

More Related Content

What's hot

Java ain't scary - introducing Java to PL/SQL Developers
Java ain't scary - introducing Java to PL/SQL DevelopersJava ain't scary - introducing Java to PL/SQL Developers
Java ain't scary - introducing Java to PL/SQL Developers
Lucas Jellema
 
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
 
Java 8 concurrency abstractions
Java 8 concurrency abstractionsJava 8 concurrency abstractions
Java 8 concurrency abstractions
Nawazish Mohammad Khan
 
Getting started with agile database migrations for java flywaydb
Getting started with agile database migrations for java flywaydbGetting started with agile database migrations for java flywaydb
Getting started with agile database migrations for java flywaydb
Girish Bapat
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
Nicola Pedot
 
Java 7 & 8
Java 7 & 8Java 7 & 8
Java 7 & 8
Ken Coenen
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics
Ulrich Krause
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
Josué Neis
 
Spring Batch Workshop (advanced)
Spring Batch Workshop (advanced)Spring Batch Workshop (advanced)
Spring Batch Workshop (advanced)
lyonjug
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
Ryan Cuprak
 
Advanced java
Advanced java Advanced java
Advanced java
NA
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
Ryan Cuprak
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
Purbarun Chakrabarti
 
Petro Gordiievych "From Java 9 to Java 12"
Petro Gordiievych "From Java 9 to Java 12"Petro Gordiievych "From Java 9 to Java 12"
Petro Gordiievych "From Java 9 to Java 12"
LogeekNightUkraine
 
Java 9 Features
Java 9 FeaturesJava 9 Features
Java 9 Features
NexThoughts Technologies
 
Spring Batch Behind the Scenes
Spring Batch Behind the ScenesSpring Batch Behind the Scenes
Spring Batch Behind the Scenes
Joshua Long
 
Haj 4308-open jpa, eclipselink, and the migration toolkit
Haj 4308-open jpa, eclipselink, and the migration toolkitHaj 4308-open jpa, eclipselink, and the migration toolkit
Haj 4308-open jpa, eclipselink, and the migration toolkit
Kevin Sutter
 
Next stop: Spring 4
Next stop: Spring 4Next stop: Spring 4
Next stop: Spring 4
Oleg Tsal-Tsalko
 
EIP In Practice
EIP In PracticeEIP In Practice
EIP In Practice
Bruce Snyder
 
Spring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSpring Framework 3.2 - What's New
Spring Framework 3.2 - What's New
Sam Brannen
 

What's hot (20)

Java ain't scary - introducing Java to PL/SQL Developers
Java ain't scary - introducing Java to PL/SQL DevelopersJava ain't scary - introducing Java to PL/SQL Developers
Java ain't scary - introducing Java to PL/SQL Developers
 
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)
 
Java 8 concurrency abstractions
Java 8 concurrency abstractionsJava 8 concurrency abstractions
Java 8 concurrency abstractions
 
Getting started with agile database migrations for java flywaydb
Getting started with agile database migrations for java flywaydbGetting started with agile database migrations for java flywaydb
Getting started with agile database migrations for java flywaydb
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
 
Java 7 & 8
Java 7 & 8Java 7 & 8
Java 7 & 8
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
Spring Batch Workshop (advanced)
Spring Batch Workshop (advanced)Spring Batch Workshop (advanced)
Spring Batch Workshop (advanced)
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
 
Advanced java
Advanced java Advanced java
Advanced java
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
Petro Gordiievych "From Java 9 to Java 12"
Petro Gordiievych "From Java 9 to Java 12"Petro Gordiievych "From Java 9 to Java 12"
Petro Gordiievych "From Java 9 to Java 12"
 
Java 9 Features
Java 9 FeaturesJava 9 Features
Java 9 Features
 
Spring Batch Behind the Scenes
Spring Batch Behind the ScenesSpring Batch Behind the Scenes
Spring Batch Behind the Scenes
 
Haj 4308-open jpa, eclipselink, and the migration toolkit
Haj 4308-open jpa, eclipselink, and the migration toolkitHaj 4308-open jpa, eclipselink, and the migration toolkit
Haj 4308-open jpa, eclipselink, and the migration toolkit
 
Next stop: Spring 4
Next stop: Spring 4Next stop: Spring 4
Next stop: Spring 4
 
EIP In Practice
EIP In PracticeEIP In Practice
EIP In Practice
 
Spring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSpring Framework 3.2 - What's New
Spring Framework 3.2 - What's New
 

Similar to Java 9

Google cloud Dataflow & Apache Flink
Google cloud Dataflow & Apache FlinkGoogle cloud Dataflow & Apache Flink
Google cloud Dataflow & Apache Flink
Iván Fernández Perea
 
Core java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsCore java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutions
QUONTRASOLUTIONS
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
vstorm83
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
Introduction to java programming part 1
Introduction to java programming   part 1Introduction to java programming   part 1
Introduction to java programming part 1
university of education,Lahore
 
Concurrency Utilities in Java 8
Concurrency Utilities in Java 8Concurrency Utilities in Java 8
Concurrency Utilities in Java 8
Martin Toshev
 
Tech Talks_04.07.15_Session 3_Martin Toshev_Concurrency Utilities In Java 8
Tech Talks_04.07.15_Session 3_Martin Toshev_Concurrency Utilities In Java 8Tech Talks_04.07.15_Session 3_Martin Toshev_Concurrency Utilities In Java 8
Tech Talks_04.07.15_Session 3_Martin Toshev_Concurrency Utilities In Java 8
EPAM_Systems_Bulgaria
 
Java review00
Java review00Java review00
Java review00
saryu2011
 
My Saminar On Php
My Saminar On PhpMy Saminar On Php
My Saminar On Php
Arjun Kumawat
 
Basic java part_ii
Basic java part_iiBasic java part_ii
Basic java part_ii
Khaled AlGhazaly
 
Spring boot
Spring bootSpring boot
Spring boot
sdeeg
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
mitesh_sharma
 
1- java
1- java1- java
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9
Ivan Krylov
 
Cloud Native Serverless Java — Orkhan Gasimov
Cloud Native Serverless Java — Orkhan GasimovCloud Native Serverless Java — Orkhan Gasimov
Cloud Native Serverless Java — Orkhan Gasimov
GlobalLogic Ukraine
 
Java introduction
Java introductionJava introduction
Java introduction
The icfai university jaipur
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
SachinSingh217687
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
David Barreto
 
2014 International Software Testing Conference in Seoul
2014 International Software Testing Conference in Seoul2014 International Software Testing Conference in Seoul
2014 International Software Testing Conference in Seoul
Jongwook Woo
 
Java ppts unit1
Java ppts unit1Java ppts unit1
Java ppts unit1
Priya11Tcs
 

Similar to Java 9 (20)

Google cloud Dataflow & Apache Flink
Google cloud Dataflow & Apache FlinkGoogle cloud Dataflow & Apache Flink
Google cloud Dataflow & Apache Flink
 
Core java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsCore java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutions
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Introduction to java programming part 1
Introduction to java programming   part 1Introduction to java programming   part 1
Introduction to java programming part 1
 
Concurrency Utilities in Java 8
Concurrency Utilities in Java 8Concurrency Utilities in Java 8
Concurrency Utilities in Java 8
 
Tech Talks_04.07.15_Session 3_Martin Toshev_Concurrency Utilities In Java 8
Tech Talks_04.07.15_Session 3_Martin Toshev_Concurrency Utilities In Java 8Tech Talks_04.07.15_Session 3_Martin Toshev_Concurrency Utilities In Java 8
Tech Talks_04.07.15_Session 3_Martin Toshev_Concurrency Utilities In Java 8
 
Java review00
Java review00Java review00
Java review00
 
My Saminar On Php
My Saminar On PhpMy Saminar On Php
My Saminar On Php
 
Basic java part_ii
Basic java part_iiBasic java part_ii
Basic java part_ii
 
Spring boot
Spring bootSpring boot
Spring boot
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
 
1- java
1- java1- java
1- java
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9
 
Cloud Native Serverless Java — Orkhan Gasimov
Cloud Native Serverless Java — Orkhan GasimovCloud Native Serverless Java — Orkhan Gasimov
Cloud Native Serverless Java — Orkhan Gasimov
 
Java introduction
Java introductionJava introduction
Java introduction
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
 
2014 International Software Testing Conference in Seoul
2014 International Software Testing Conference in Seoul2014 International Software Testing Conference in Seoul
2014 International Software Testing Conference in Seoul
 
Java ppts unit1
Java ppts unit1Java ppts unit1
Java ppts unit1
 

Recently uploaded

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 

Recently uploaded (20)

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 

Java 9

  • 2. Mateusz Skawiński I work on position of Technical Leader in SoftServe. I work with Java on professional, commercial projects since 2009. Over the years, I was interested and involved in using object oriented programming in large enterprise applications. Currently working on real time data integrations of large HCM systems.
  • 3. Agenda • Java Platform Module System • JShell • Reactive Streams • Process API • HTTP API • Other
  • 5. Java Platform Module System – What? • JSR 376 – Project Jigsaw (http://openjdk.java.net/projects/jigsaw) • Named, self-describing collection of code and data. • JDK has been divided into a set of modules. • Adds a higher level of aggregation above packages.
  • 6. Java Platform Module System – Why? • Reliable configuration, to replace classpath mechanism with a means for program components to declare explicit dependences upon one another. • Strong encapsulation, to allow a component to declare which of its public types are accessible to other components, and which are not. • Make it easier for developers to construct and maintain libraries and large applications. • Improve the security and maintainability of Java SE Platform Implementations in general, and the JDK in particular. • Enable improved application performance. • Enable the Java SE Platform, and the JDK, to scale down for use in small computing devices and dense cloud deployments.
  • 7. Java Platform Module System – How? • Define a module: Files structure module-info.java • Declare requirements • Define exposed packages module com.itc { requires com.coffee; requires com.tea; exports com.itc; }
  • 9. Example – com.coffee package com.coffee; public interface Coffee { void drink(); } package com.coffee; import com.coffee.types.Arabica; import com.coffee.types.Robusta; public class CoffeeMaker { public Coffee brewArabica() { return new Arabica(); } public Coffee brewRobusta() { return new Robusta(); } } module com.coffee { exports com.coffee; }
  • 10. Example – com.coffee.types package com.coffee.types; import com.coffee.Coffee; public class Arabica implements Coffee { @Override public void drink() { System.out.println ("Strong black arabica"); } } package com.coffee.types; import com.coffee.Coffee; public class Robusta implements Coffee { @Override public void drink() { System.out.println ("Full of caffeine robusta"); } }
  • 11. Example – com.itc package com.itc; import com.coffee.Coffee; import com.coffee.CoffeeMaker; public class ILikeCoffee { public static void main(String[] args) { CoffeeMaker coffeeMaker = new CoffeeMaker(); final Coffee wakeUpCoffee = coffeeMaker.brewRobusta(); final Coffee eveningCoffee = coffeeMaker.brewArabica(); wakeUpCoffee.drink(); // Full of caffeine robusta eveningCoffee.drink(); // Strong black arabica } …
  • 12. Example – com.itc package com.itc; import com.coffee.Coffee; import com.coffee.CoffeeMaker; import com.coffee.types.Arabica; public class ILikeCoffee {… The type com.coffee.types.Arabica is not accessible module com.itc { requires com.coffee; requires com.coffee.types; } com.coffee.types cannot be resolved to a module
  • 13. Backward Compatibility • JDK was divided into set of modules – java.base – 78 modules • Classpath can be used • Unnamed modules • Automatic modules
  • 14. Unnamed Modules • A class which is not a member of any named module. • Classed compiled in Java 8 and older versions which are not migrated to modules when run in Java 9. • The unnamed module requires all other available named modules. • The unnamed module exports all its packages. • Named modules can not have a dependency on the unnamed module.
  • 15. Automatic Modules • JAR files are automatically detected as modules. • Module name will be automaticaly created based on JAR file name. • The automatic module requires all other available named modules. • The automatic module exports all its packages.
  • 16. Example – com.tea module com.itc { requires com.coffee; requires com.tea; } package com.itc; import com.tea.Tea; import com.tea.types.Roiboos; public class ILikeTea { public static void main(String[] args) { final Tea tea = new Roiboos(); tea.drink(); } }
  • 17. JLink • Command line tool. • Generate your own JRE. • Set required modules. • Less consumption (deployment size, memory, performance). • Embedded, IoT, microservices. • All in One
  • 19. JShell • Read-Evaluate-Print Loop (REPL), which evaluates declarations, statements, and expressions as they are entered and immediately shows the results. • Command line tool. • Its quick, small and easy.
  • 21. Reactive Streams • Near real time, asynchronous processing. • Not predetermined data volume. • Load leverage (backpressure). • Publisher - subscriber. • http://www.reactive-streams.org • Multiple implementations available Producer Subscriber Subscription subscribe() create onSubscribe(s) alternative [via subscription] [direct] send m items request(n) onNext() - m items send n items request(m) onNext() - m items request(n) m >= n
  • 22. java.util.concurrent.Flow Modifier and Type Class Description static interface Flow.Processor<T,R> A component that acts as both a Subscriber and Publisher. static interface Flow.Publisher<T> A producer of items (and related control messages) received by Subscribers. static interface Flow.Subscriber<T> A receiver of messages. static interface Flow.Subscription Message control linking a Flow.Publisher and Flow.Subscriber.
  • 23. java.util.concurrent.Flow public interface Publisher<T> { public void subscribe(Subscriber<? super T> s); } public interface Subscriber<T> { public void onSubscribe(Subscription s); public void onNext(T t); public void onError(Throwable t); public void onComplete(); } public interface Subscription { public void request(long n); public void cancel(); } public interface Processor<T, R> extends Subscriber<T>, Publisher<R> {}
  • 24. Process API • Start, retrieve information about, and manage native operating system processes. • New interfaces: ProcessHandle and ProcessHandle.Info • Operating system independant API • process.toHandle() • Process class extension.
  • 25. ProcessHandle (selected) Modifier and Type Method Description static Stream<ProcessHandle> allProcesses​() Returns a snapshot of all processes visible to the current process. Stream<ProcessHandle> children​() Returns a snapshot of the current direct children of the process. static ProcessHandle current​() Returns a ProcessHandle for the current process. Stream<ProcessHandle> descendants​() Returns a snapshot of the descendants of the process. ProcessHandle.Info info​() Returns a snapshot of information about the process. CompletableFuture<ProcessHandle> onExit​() Returns a CompletableFuture<ProcessHandle> for the termination of the process. Optional<ProcessHandle> parent​() Returns an Optional<ProcessHandle> for the parent process. long pid​() Returns the native process ID of the process.
  • 26. ProcessHandle.Info Modifier and Type Method Description Optional<String[]> arguments​() Returns an array of Strings of the arguments of the process. Optional<String> command​() Returns the executable pathname of the process. Optional<String> commandLine​() Returns the command line of the process. Optional<Instant> startInstant​() Returns the start time of the process. Optional<Duration> totalCpuDuration​() Returns the total cputime accumulated of the process. Optional<String> user​() Return the user of the process.
  • 27. HTTP API • Working with HttpURLConnection is inconvinient. • Streams operations. • Pre Java 9 external libs were used. • HttpClient class. • Supports HTTP2 spec.
  • 28. Other • List.of List<String> coffies = List.of("Espresso", "Americano", "Cappuchino", "Latte"); • New default garbage collector: ParallelGC → G1GC. • Private methods in interfaces. • Try with resources improvement. • Javadocs improvement (html5). • Security improvements (incl. SHA-3 Hash algorithms) • … and more → https://docs.oracle.com/javase/9/whatsnew/toc.htm
  • 30. See you on our next meeting in April! 19 / 04 / 2018