SlideShare a Scribd company logo
1 of 13
Download to read offline
JAVA 9
ALİCAN AKKUS
JAVA 9
TIMELINE
1.0
1996
1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8
1997 1998 2000 2002 2004 2006 2011 2014
1.9
2017
‣ * MODULES

* JSHELL / JLINK

* G1GC

* REACTIVE API
‣ * PROCESS API
‣ * HTTP 2 CLIENT

* OTHERS..
JAVA 9
MODULE SYSTEM
▸ Problems;

(1) : JDK is too big.

* 4240 classes in Java 8

* 4024 classes in Java 7

* 3793 classes in Java 6

(2) : As User can access Internal APIs too, Security is also big issue.

(3) : Its a bit tough to support Less Coupling between components.

▸ Solutions;

Each Module contains only a set of related code and data to support Single Responsibility (Functionality) Principle (SRP).
1. The Moduler JDK

* Java 9 Module System has 73 modules in JDK
2. Modular Source Code
3. Encapsulate Most Internal APIs
4. Java Platform Module System(JPMS)
5. jlink: The Java Linker
JAVA 9 - MODULE SYSTEM
JAVA 9 - MODULE SYSTEM
module com.caysever.java9 {
requires java.logging;
requires jdk.incubator.httpclient;
exports com.caysever.java9.http2client;
}
Module module = moduleInfo.getClass().getModule();
Optional.ofNullable(module).ifPresent(m -> System.out.println(module.getName()));
Optional.ofNullable(module.getDescriptor().requires()).ifPresent(requires ->
Stream.ofNullable(requires).forEach(rs -> rs.forEach(r ->
System.out.println(r.name()))));
com.caysever.java9
java.logging
java.base
jdk.incubator.httpclient
JAVA 9 - JSHELL
▸ JShell introduces a REPL (Read-Eval-Print-Loop) environment in Java.
▸ JShell gives you a prompt (and interactive session history) so that you can type and execute Java
commands.
▸ JShell makes it really easy to write, execute and test fragments of code. So you can perform quick tasks,
test and mockup code.
JAVA 9 - JLINK
▸ Jlink is Java’s new command line tool which allows you to link sets of modules (and their transitive
dependencies) to create a run-time image.
▸ jlink --module-path <modulepath> --add-modules <modules> --limit-modules <modules> --output
<path>
▸ This command creates a run-time image which only has the modules that our application needs.
JAVA 9 - GARBAGE COLLECTOR
▸ With Java 9, the default garbage collector (GC) is being changed from the ParallelGC to the G1GC.
▸ The “Garbage-first” garbage collector, aka G1, is a concurrent multi-threaded GC. It mostly works
alongside the application threads (much like the concurrent mark sweep GC) and is designed to offer
shorter, more predictable pause times – while still achieving high throughput.
▸ G1 also tracks various metrics for each region, and calculates how long it will take to collect them – give it
a target for pause times, and it will attempt to collect as much garbage as it can within the given
constraints.
▸ You can test the G1GC yourself using the VM flag –XX:+UseG1GC.
JAVA 9 - REACTIVE STREAM
▸ Publisher

* Produces items for subscribers to consume. The only method is subscribe(Subscriber) whose purpose
should be obvious.
▸ Subscriber

* Subscribes to publisher(usually only one) to receive items (via method onNext(T)), 

error messages (onError(Throwable)), 

or a signal that no more items are to be expected (onComplete()). 

Before any of those things happen, though, the publisher calls onSubscribe(Subscription)
▸ Subscription

* The connection between a single publisher and a single subscriber. The subscriber will use it to request
more items (request(long)) or to sever the connection (cancel()).
JAVA 9 - PROCESS API
▸ Java SE 9 is coming with some improvements in Process API. They have added couple new classes and
methods to ease the controlling and managing of OS processes.
▸ Sample;

* ProcessHandle.current().pid(); 

* ProcessHandle.allProcesses()

.map(p -> p.info().command())

.filter(Optional::isPresent)

.collect(Collectors.toList())

.forEach(System.out::println);

* new ProcessBuilder().command("sleep", "3").start().onExit().thenAccept(System.out::println);

* ProcessBuilder.startPipeline(List.of(new ProcessBuilder(“ls”), new ProcessBuilder(“sort”,”-u”) ));
JAVA 9 - HTTP 2.0
▸ Still in incubation
▸ Provides support for HTTP 2.0
▸ Sync & Async request
▸ HttpClient, HttpRequest, HttpResponse
HttpClient httpClient = HttpClient.newHttpClient(); 

HttpRequest httpRequest = HttpRequest.newBuilder().uri(“alicanakkus.github.io”).GET().build(); 

HttpResponse<String> httpResponse = httpClient.send(httpRequest, BodyHandler.asString()); 

System.out.println(httpResponse.body());
SYNC
ASYNC httpClient.sendAsync(httpRequest, BodyHandler.asString());
JAVA 9 - OTHER IMPROVEMENTS
▸ Collection improvement
▸ Compact String
▸ Multi Release JAR
▸ JVM based logging
▸ Try With Resource Improvement
▸ CompletableFuture API
▸ Stream API improvement
JAVA 9
▸ http://openjdk.java.net/jeps/0
▸ https://www.journaldev.com/13121/java-9-features-with-examples
▸ www.baeldung.com
▸ www.blog.idrsolutions.com
THANKS :)
https://github.com/AlicanAkkus/java9

More Related Content

What's hot

Sql storeprocedure
Sql storeprocedureSql storeprocedure
Sql storeprocedureftz 420
 
Introduction to Retrofit and RxJava
Introduction to Retrofit and RxJavaIntroduction to Retrofit and RxJava
Introduction to Retrofit and RxJavaFabio Collini
 
Performance Test Automation With Gatling
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With GatlingKnoldus Inc.
 
Reactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaReactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaAli Muzaffar
 
Lecture 2. MS SQL. Stored procedures.
Lecture 2. MS SQL. Stored procedures.Lecture 2. MS SQL. Stored procedures.
Lecture 2. MS SQL. Stored procedures.Alexey Furmanov
 
Gatling Tool in Action at Devoxx 2012
Gatling Tool in Action at Devoxx 2012Gatling Tool in Action at Devoxx 2012
Gatling Tool in Action at Devoxx 2012slandelle
 
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAmin Uddin
 
Bypass dbms assert
Bypass dbms assertBypass dbms assert
Bypass dbms assertfangjiafu
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functionsAmrit Kaur
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2wiradikusuma
 

What's hot (20)

Sql storeprocedure
Sql storeprocedureSql storeprocedure
Sql storeprocedure
 
Passing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flowPassing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flow
 
Introduction to Retrofit and RxJava
Introduction to Retrofit and RxJavaIntroduction to Retrofit and RxJava
Introduction to Retrofit and RxJava
 
Performance Test Automation With Gatling
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With Gatling
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
Reactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaReactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJava
 
Lecture 2. MS SQL. Stored procedures.
Lecture 2. MS SQL. Stored procedures.Lecture 2. MS SQL. Stored procedures.
Lecture 2. MS SQL. Stored procedures.
 
Gatling Tool in Action at Devoxx 2012
Gatling Tool in Action at Devoxx 2012Gatling Tool in Action at Devoxx 2012
Gatling Tool in Action at Devoxx 2012
 
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure Presentation
 
Bypass dbms assert
Bypass dbms assertBypass dbms assert
Bypass dbms assert
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Jsp project module
Jsp project moduleJsp project module
Jsp project module
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Dn D Custom 1
Dn D Custom 1Dn D Custom 1
Dn D Custom 1
 
Dn D Custom 1
Dn D Custom 1Dn D Custom 1
Dn D Custom 1
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functions
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Group111
Group111Group111
Group111
 
SQL Server Stored procedures
SQL Server Stored proceduresSQL Server Stored procedures
SQL Server Stored procedures
 

Similar to Java 9

Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profilerIhor Bobak
 
PERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACH
PERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACHPERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACH
PERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACHcscpconf
 
Performance comparison on java technologies a practical approach
Performance comparison on java technologies   a practical approachPerformance comparison on java technologies   a practical approach
Performance comparison on java technologies a practical approachcsandit
 
ScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency InjectionScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency Injection7mind
 
High Performance NodeJS
High Performance NodeJSHigh Performance NodeJS
High Performance NodeJSDicoding
 
Preparing your code for Java 9
Preparing your code for Java 9Preparing your code for Java 9
Preparing your code for Java 9Deepu Xavier
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slidesDavid Barreto
 
Java programming concept
Java programming conceptJava programming concept
Java programming conceptSanjay Gunjal
 
Grails 1.1 Testing - Unit, Integration & Functional
Grails 1.1 Testing - Unit, Integration & FunctionalGrails 1.1 Testing - Unit, Integration & Functional
Grails 1.1 Testing - Unit, Integration & Functional2Paths Solutions Ltd.
 
Angular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupAngular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupDavid Barreto
 
patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack David McNish
 
STATISTICAL ANALYSIS FOR PERFORMANCE COMPARISON
STATISTICAL ANALYSIS FOR PERFORMANCE COMPARISONSTATISTICAL ANALYSIS FOR PERFORMANCE COMPARISON
STATISTICAL ANALYSIS FOR PERFORMANCE COMPARISONijseajournal
 
Developing Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideDeveloping Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideMohanraj Thirumoorthy
 
Features java9
Features java9Features java9
Features java9srmohan06
 
JDK 9: Migrating Applications
JDK 9: Migrating ApplicationsJDK 9: Migrating Applications
JDK 9: Migrating ApplicationsSimon Ritter
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersJavan Rasokat
 
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...7mind
 
Java @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SPJava @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SPIlan Salviano
 

Similar to Java 9 (20)

Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profiler
 
PERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACH
PERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACHPERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACH
PERFORMANCE COMPARISON ON JAVA TECHNOLOGIES - A PRACTICAL APPROACH
 
Performance comparison on java technologies a practical approach
Performance comparison on java technologies   a practical approachPerformance comparison on java technologies   a practical approach
Performance comparison on java technologies a practical approach
 
ScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency InjectionScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency Injection
 
High Performance NodeJS
High Performance NodeJSHigh Performance NodeJS
High Performance NodeJS
 
Preparing your code for Java 9
Preparing your code for Java 9Preparing your code for Java 9
Preparing your code for Java 9
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
 
Java programming concept
Java programming conceptJava programming concept
Java programming concept
 
Grails 1.1 Testing - Unit, Integration & Functional
Grails 1.1 Testing - Unit, Integration & FunctionalGrails 1.1 Testing - Unit, Integration & Functional
Grails 1.1 Testing - Unit, Integration & Functional
 
Angular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupAngular Optimization Web Performance Meetup
Angular Optimization Web Performance Meetup
 
patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack
 
STATISTICAL ANALYSIS FOR PERFORMANCE COMPARISON
STATISTICAL ANALYSIS FOR PERFORMANCE COMPARISONSTATISTICAL ANALYSIS FOR PERFORMANCE COMPARISON
STATISTICAL ANALYSIS FOR PERFORMANCE COMPARISON
 
Developing Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideDeveloping Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's Guide
 
How can your applications benefit from Java 9?
How can your applications benefit from Java 9?How can your applications benefit from Java 9?
How can your applications benefit from Java 9?
 
Features java9
Features java9Features java9
Features java9
 
JDK 9: Migrating Applications
JDK 9: Migrating ApplicationsJDK 9: Migrating Applications
JDK 9: Migrating Applications
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
 
Java @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SPJava @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SP
 
Grails and Ajax
Grails and AjaxGrails and Ajax
Grails and Ajax
 

Recently uploaded

Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 

Recently uploaded (20)

Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 

Java 9

  • 2. JAVA 9 TIMELINE 1.0 1996 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1997 1998 2000 2002 2004 2006 2011 2014 1.9 2017 ‣ * MODULES
 * JSHELL / JLINK
 * G1GC
 * REACTIVE API ‣ * PROCESS API ‣ * HTTP 2 CLIENT
 * OTHERS..
  • 3. JAVA 9 MODULE SYSTEM ▸ Problems;
 (1) : JDK is too big.
 * 4240 classes in Java 8
 * 4024 classes in Java 7
 * 3793 classes in Java 6
 (2) : As User can access Internal APIs too, Security is also big issue.
 (3) : Its a bit tough to support Less Coupling between components.
 ▸ Solutions;
 Each Module contains only a set of related code and data to support Single Responsibility (Functionality) Principle (SRP). 1. The Moduler JDK
 * Java 9 Module System has 73 modules in JDK 2. Modular Source Code 3. Encapsulate Most Internal APIs 4. Java Platform Module System(JPMS) 5. jlink: The Java Linker
  • 4. JAVA 9 - MODULE SYSTEM
  • 5. JAVA 9 - MODULE SYSTEM module com.caysever.java9 { requires java.logging; requires jdk.incubator.httpclient; exports com.caysever.java9.http2client; } Module module = moduleInfo.getClass().getModule(); Optional.ofNullable(module).ifPresent(m -> System.out.println(module.getName())); Optional.ofNullable(module.getDescriptor().requires()).ifPresent(requires -> Stream.ofNullable(requires).forEach(rs -> rs.forEach(r -> System.out.println(r.name())))); com.caysever.java9 java.logging java.base jdk.incubator.httpclient
  • 6. JAVA 9 - JSHELL ▸ JShell introduces a REPL (Read-Eval-Print-Loop) environment in Java. ▸ JShell gives you a prompt (and interactive session history) so that you can type and execute Java commands. ▸ JShell makes it really easy to write, execute and test fragments of code. So you can perform quick tasks, test and mockup code.
  • 7. JAVA 9 - JLINK ▸ Jlink is Java’s new command line tool which allows you to link sets of modules (and their transitive dependencies) to create a run-time image. ▸ jlink --module-path <modulepath> --add-modules <modules> --limit-modules <modules> --output <path> ▸ This command creates a run-time image which only has the modules that our application needs.
  • 8. JAVA 9 - GARBAGE COLLECTOR ▸ With Java 9, the default garbage collector (GC) is being changed from the ParallelGC to the G1GC. ▸ The “Garbage-first” garbage collector, aka G1, is a concurrent multi-threaded GC. It mostly works alongside the application threads (much like the concurrent mark sweep GC) and is designed to offer shorter, more predictable pause times – while still achieving high throughput. ▸ G1 also tracks various metrics for each region, and calculates how long it will take to collect them – give it a target for pause times, and it will attempt to collect as much garbage as it can within the given constraints. ▸ You can test the G1GC yourself using the VM flag –XX:+UseG1GC.
  • 9. JAVA 9 - REACTIVE STREAM ▸ Publisher
 * Produces items for subscribers to consume. The only method is subscribe(Subscriber) whose purpose should be obvious. ▸ Subscriber
 * Subscribes to publisher(usually only one) to receive items (via method onNext(T)), 
 error messages (onError(Throwable)), 
 or a signal that no more items are to be expected (onComplete()). 
 Before any of those things happen, though, the publisher calls onSubscribe(Subscription) ▸ Subscription
 * The connection between a single publisher and a single subscriber. The subscriber will use it to request more items (request(long)) or to sever the connection (cancel()).
  • 10. JAVA 9 - PROCESS API ▸ Java SE 9 is coming with some improvements in Process API. They have added couple new classes and methods to ease the controlling and managing of OS processes. ▸ Sample;
 * ProcessHandle.current().pid(); 
 * ProcessHandle.allProcesses()
 .map(p -> p.info().command())
 .filter(Optional::isPresent)
 .collect(Collectors.toList())
 .forEach(System.out::println);
 * new ProcessBuilder().command("sleep", "3").start().onExit().thenAccept(System.out::println);
 * ProcessBuilder.startPipeline(List.of(new ProcessBuilder(“ls”), new ProcessBuilder(“sort”,”-u”) ));
  • 11. JAVA 9 - HTTP 2.0 ▸ Still in incubation ▸ Provides support for HTTP 2.0 ▸ Sync & Async request ▸ HttpClient, HttpRequest, HttpResponse HttpClient httpClient = HttpClient.newHttpClient(); 
 HttpRequest httpRequest = HttpRequest.newBuilder().uri(“alicanakkus.github.io”).GET().build(); 
 HttpResponse<String> httpResponse = httpClient.send(httpRequest, BodyHandler.asString()); 
 System.out.println(httpResponse.body()); SYNC ASYNC httpClient.sendAsync(httpRequest, BodyHandler.asString());
  • 12. JAVA 9 - OTHER IMPROVEMENTS ▸ Collection improvement ▸ Compact String ▸ Multi Release JAR ▸ JVM based logging ▸ Try With Resource Improvement ▸ CompletableFuture API ▸ Stream API improvement
  • 13. JAVA 9 ▸ http://openjdk.java.net/jeps/0 ▸ https://www.journaldev.com/13121/java-9-features-with-examples ▸ www.baeldung.com ▸ www.blog.idrsolutions.com THANKS :) https://github.com/AlicanAkkus/java9