I participated in Java Day Tokyo 2017, so a memo at that time.
This time, we focused on Java SE 9.
I wrote it for myself, so I'm sorry that there are many missing teeth.
We would appreciate it if you could point out any mistakes or supplements.
What is Java Day Tokyo 2017?
Japan's largest annual Java event held by Oracle Japan.
Official page: http://www.oracle.co.jp/events/javaday/2017/
Hashtag: #JavaDayTokyo
Participated session
※Titles omitted
- Keynote speech (Oracle Japan President Hiroshige Sugihara, Oracle Vice President Bernard Traversat, Oracle Senior Director Will Lions)
- Java 9 and Beyond: Java Renaissance in the Cloud(Oracle Vice President Bernard Traversat)
- Modular Development with JDK (David Back, Oracle Corporation Japan)
- HTTP / 2 starting with Servlet 4.0 (Oracle Corporation Japan, Shinya Yanagihara)
- Recommendation of Java SE 9 (Java in the Box, Yuichi Sakuraba)
- Reactive Web Application by Spring Framework 5.0 (Pivotal Japan Co., Ltd. Toshiaki Maki)
Presentation material: https://www.slideshare.net/makingx/spring-framework-50-reactive-web-application-javadaytokyo
Topic & Summary
◆ About the current state of Java and future trends
--Java SE 9, Java EE 8 released
--Enhancements for optimization on Claud
◆ About Java SE 9, Java EE 8 scheduled to be released in July this year
--Java SE 9 will be described later. I didn't hear much about Java EE 8, so I won't mention it.
◆ About module (Project jigsaw) and other new features introduced in Java SE 9
--Module System (Project jigsaw): The most noticeable feature. Dependencies can be set on a module-by-module basis.
--JShell: Ability to execute code interactively, like the REPL in Python and Ruby.
--JLink: A function that allows you to specify and load only the required JDK class modules.
--Ahead of Time Compilation (AOT): Ability to compile Java classes into native code before starting a virtual machine. Reduced startup time.
--G1GC: The default GC has been changed from parallel GC to G1GC.
◆ About specification changes that occurred in Java SE 9
--Milling Project Coin (Reference: http://itpro.nikkeibp.co.jp/atcl/column/15/120700278/050800037/?rt=nocnt)
--Immutable collections can be created. (Of method of Collection interface)
--Internal implementation of String is changed from char [] to byte []. Heap usage is significantly reduced.
◆ About HTTP / 2 supported by Servlet 4.0
--By using HTTP / 2, HTTP communication with clients can be accelerated. Since it is not very feasible to use Servlet 4.0 in plain text, check the support trend on the framework side.
◆ Supports Reactive programming of Spring Framework 5.0
--From Spring Framework 5.0, a new web framework called Spring WebFlux has been added to support Reactive programming.
--If you perform Reactive programming, you can expect high speed and flexible scalability by non-blocking data communication.
--The libraries such as RxJava, Reactor, and Akka are famous. Java SE 9 supports Reactive programming with the Flow interface.
Below is a memo of each session
Java Day Tokyo 2017 Keynote Speech (Oracle Japan President Hiroshige Sugihara, Oracle Vice President Bernard Traversat, Oracle Senior Director Will Lions)
Overview (from the official page)
The release of Java SE 9 and Java EE 8 is finally approaching! In this Java Day Tokyo keynote speech, the Vice Presidents of the Java SE and Java EE development departments will directly introduce the value of the new version to you. Be sure to see for yourself what's remarkable about the new version and what's ahead. We look forward to your participation.
Hiroshige Sugihara, CEO of Oracle Japan
―― "To be a company that makes Japan happy"
--The shortage of IT personnel is an issue, and by 2030 there will be a shortage of 600,000 people
--On-premise (12 trillion)> IaaS (210 billion)
--Enhancements for optimizing on the Cloud
Oracle Vice President Bernard Traversat
--The foundation of Cloud
--Java is used for cores such as AWS and MS Azule
--Java is dead was acquired by Oracle and wiped out
--The other day, we announced a partnership with Docker.
Java9
--122 features included
- module system
- modular JDK
- JShell
- Encapsulate Internal APIs
- JLink: Java Linker
- Ahead of time compilation(AOT)
--Static compilation available in Java 9
--Compiler can get real time information
Trends after Java 9 (OpenJDK)
project Valhalla
- ValueTypes
- Specialized Generics
- Var Handles
Project Panama
Application to big data
Run on GPU
- Foreign Function Inteerface
- Date Layout Control
- Arrays 2.0
About using Java with Mazda
Conventional type
- Support business processes
- Required to support functional and non-functional requirements
- All developers use a common development environment, architecture, development rules and FW
- Create an automatic generation tool
- It is also important that the language lives long
- Backward compatibility (easy to upgrade)
Recent trends
- Combination
- Strategy Pattern → Function type
- Expectations
- Standardization of development environment and FW → bloat → Expectations for Jigsaw
- Large amount of data → GC problem → Expectations for Java in the Big Data / AI era
JShell
--Can be executed interactively like REPL
- mvn jshell compile
--It also has a complementary function
--Create a prototype with JShell, and when the shape is formed, put it in the code
Oracle Senior Director Will Lions
--Java EE 8 will be announced as early as this summer
--HTTP / 2 is fast and secure, no application changes required
JJUG
--Currently more than 6300 people, core is in their 20s and 30s
――Why join the community
- Meet friends who think together
- Get to know a great engineer
- You can send and study
Java 9 and Beyond: Java Renaissance in the Cloud
Overview (from the official page)
This session provides updates for Java 9 releases. Java 9 radically changes the way engineers develop and deploy java services in the cloud. New tools, AOT and JLink, take advantage of Java 9's new modular system to enable new types of performance and density optimization. Positioned as the default GC in Java 9, G1 offers a new level of scalability for big data cloud services. In addition, I would like to touch on new features since Java 9 such as value type, JNI migration, and language improvements. This session will also show you the importance of Java 9 to cloud-based developers by demonstrating these new features.
Java9
--Java problem
- Redundancy
- Eat memory
--Java Priority
- Security
new function
- jigsaw
- JLink
- Ahead of Time(AOT) Java Compiler
- JShell
- G1 GC as the Default
Java SE Advanced
- Flight Recorder Performance
- It is possible to trace information based on conditions
- Java Mission Control Console
- You can investigate the problem area
- Advanced Management Console
- You can set to use old Java only for specific apps, etc. (improved security)
Trends after Java 9
- Uniform
- memory
- As compact and lighter thread as possible
- Compatible
- compatibility
- Performance
Modular Development with JDK 9 (Oracle Corporation Japan, David Back)
Overview (from the official page)
The modular development style benefits all Java developers (whether your application has only one JAR or 100 JARs). In this session, we will introduce a Java 9 module system that structures the JDK as dozens of reusable modules while strongly protecting the internal API.
Then, in the session, we will explain how to create a module and how to avoid relying on the internal API of the JDK, which is a commonly used library. Finally, I will explain the tools provided for the module.
Programs are ~~Classes~~ ~~Package~~ Mogules
- “public” no longer mean “accessile ti everyone”.
exports is a package unit. requires is a module unit
By using JLink, you can specify and load only the necessary JDK class modules.
→ What are the benefits?
Saves resources when launching a large number of JDKs in the cloud etc.
You can check jar dependencies with jdeps (provided from Java 8)
Automatic Modules
Ability to automatically modularize an existing Jar
Those that have not been developed on a module basis use the Automatic modules function. No change in Jar
HTTP / 2 starting with Servlet 4.0 (Oracle Corporation Japan, Shinya Yanagihara)
Overview (from the official page)
The HTTP specification has been updated from HTTP / 1.1 to HTTP / 2 for the first time in 16 years, incorporating various mechanisms to improve communication efficiency. Servlet 4.0 has been updated to take advantage of HTTP / 2. In this session, we will introduce an example of using HTTP / 2 with Servlet 4.0.
Servlet review
- Java running on the server side
- Role as Controller
Servlet 4.0 overview
- Servlet4.0 Scheduled to be released in July 2017
- HTTP2 compatible
HTTP / 2 overview
- 1 system
- Request response is 1: 1 for TCP connection
- As a general rule, wait for the completion of one request before sending the next request → Waiting occurs
- Efforts to speed up
- CSS sprite
- Inline image
- Domain sharding
- 2 series
- Stream multiplexing for TCP connections
- Stream priority
- Header compression (reduces overhead)
- Binary frame (previously text-based)
Server Push
- Returns multiple responses to one request
- Create PushBuilder object (request.newPushBuilder ();)
- PushBuilder object is reusable
- Use GET or HEAD ("cacheable" and "safe" (according to RFC 7540 specifications))
- No need to combine JS files or do CSS sprites
Recommendation of Java SE 9 (Java in the Box, Yuichi Sakuraba)
Overview (from the official page)
When you think of Java SE 9, you might think of Project Jigsaw or J Shell. But Java SE 9 isn't the only one. There are 89 JEPs that define the addition of Java SE features.
In this session, we will explain changes in language specifications, changes in core libraries, and compatibility problems among many new features of Java SE 9 with actual examples.
I don't talk about Jigsaw, J Shell
agenda
- Compatibility
- Brand new
- Update
Compatibility
- Language & Library
- Variable names with only underscores can no longer be used
- The disappeared method
- Methods that are directly connected to the OS are hidden (Jigsaw involved)
- Thread Stop
- Reflection methods
- VM&Tools
- No More Java Plug-in Applet
- No More Windows x86 Clinent VM
- No More Java DB
- Operation & Management
- No More hprof (heap profiler), jhat
- Directory structure has changed
- No More rt.jar, tools,jar, lib/ext
- No More -Xbootclasspath
- Default GC: G1GC (previously parallel GC)
- Deprecated: CMS (a type of GC)
Brand New
- Jigsaw
- Project Kulla/JShell
- Reactive Streams
- Asynchronous process
- Publisher-Subscriver Model (w / Back Pressure)
- Flow interface
* Publisher
* Subscriber
* Subscription
- JEP11 Incubator Modules
- Include beta-like features in the JDK
* Java SE 9 : HTTP/2 Client
Update
- Language: Milling Project Coin
- @SafeVarargs
- try-with-resources
- Variables with final can be used in the try clause (substantially final is OK (from Java 8))
- Diamond operator (<>)
- Also available in anonymous classes
- Private method in Interface
- underscore
- Library
- Stream
- Factory Methods
- ofNullable(t)
*
- iterate(seed, hasNext, next)
- Can now be attached as a condition (until now infinite iterator)
- New Methods
- take/dropWhile
- Collectors.flatMapping
- Collectors.filtering
- Optional
- stream()
- ifPresentOrElse(action, elseAction)
- or(supplier)
- Optional opt = opt1.or(() -> opt2)
- Collection
- Factory Method
- of()
- List l = List.of(0,1,2);
- Map<Integer, String> m = Map.of(0,”a”,1,”b”);
- Making Immutable Collection
- Enumeration.asIterator();
- String
- Heap usage is significantly reduced
- concatenation
- StringBuilder → InvokeDynamic
- Optimized
- Deprecated
- Those with @Deprecated are really erased
- If you get a Deprecated warning, you should take immediate action
- Javadoc
- HTML5 compatible
Reactive Web Application by Spring Framework 5.0 (Pivotal Japan Co., Ltd. Toshiaki Maki)
Overview (from the official page)
Reactive programming support has been added as a feature of Spring Framework 5.0, and a new web framework and runtime called Spring WebFlux has been added.
In this session, we will start with the background of Reactive support and the explanation of Reactive Streams / Project Reactor, and introduce how to use Spring WebFlux with Spring Boot 2.0, focusing on code examples.
Briefing paper
https://www.slideshare.net/makingx/spring-framework-50-reactive-web-application-javadaytokyo
What is Reactive?
- Non-Blocking
- event-driven
- backpressure
type
- Sync/Bloking
- Async & Blocking
- Multithread
- The process of launching a thread is heavy
- Async & Non-Blocking
- Effective use of I / O waiting time
--Using Servlet inevitably becomes Blocking
--Non-Blocking & Event-Loop with Netty (used by Apple, Twitter, etc.)
Why Spring supports Reactive
- Microservices → Can be scaled without waste
- Access from slow client
- Scalability, stability, etc.
Reactive Streams
- non-blocking
- back prassure
- Mechanism to adjust the flow rate of data
Supported libraries
- RxJava
- Reactor
- Acca Stream
For Reactor
Flux/Mono
- Flux
- Publisher implementation Used to represent 0 to N data
- Mono
- Publisher implementation Used to represent 0 or 1 data
Reactive Stream in Spring FW 5.0