Blog

Home / Blog

Eclipse GlassFish catches up with Jakarta EE 10

Billy Yann
Data Scientist
Deep learning and machine learning specialist, well-versed with experience in Cloud infrastructure, Block-chain technologies, and Big Data solutions.
Janaury 10, 2023


The pervasiveness of Java is one of the fascinating phenomena in software. Java has survived radical changes in the technology landscape as both a language and a platform, and its internal structure has changed in tandem. How has Java remained at the forefront of enterprise and open-source software for over two decades? Let's take a look at some of the most notable factors.

Eclipse GlassFish 7.0 is a Java application server that implements the Jakarta EE 10 framework for enterprise-level Java deployments. GlassFish 7.0, released on December 14 and available for download from the Eclipse Foundation, includes Jakarta EE 10 APIs and implementation components. In September, Jakarta EE 10 was released, focusing on developing cloud-native Java applications and microservices. GlassFish 7 consists of the final APIs and implementation components for Jakarta EE 10, and it compiles and runs on Java Development Kits (JDKs) 11 through JDK 19.

GlassFish 7 has the following features:

1. MicroProfile's Config and JWT (JSON Web Tokens) APIs are supported. MicroProfile extends enterprise Java's microservices capabilities.

2. Support for the most recent Jakarta MVC 2.0.

3. The DOL (Deployment Object Library) module has been overhauled and cleaned up.

4. Fixes for high-load logging at detailed log levels.

5. GlassFish servers have been improved in terms of starting and stopping and have been revisited to work better on modern operating systems and environments.

6. Many non-Jakarta EE components have been updated, such as OSGi 7 to OSGI 8.

GlassFish, long a reference implementation for enterprise Java, was previously under the control of Oracle and, before that, Sun Microsystems. Eclipse took over stewardship of Java EE, including GlassFish, in 2017 after Oracle relinquished leadership of Java EE development.

GlassFish, long a reference implementation for enterprise Java, was previously under the control of Oracle and, before that, Sun Microsystems. Eclipse took over stewardship of Java EE, including GlassFish, in 2017 after Oracle relinquished leadership of Java EE development.

GlassFish has passed Jakarta EE TCK tests and implemented all required and optional Jakarta EE APIs (Technology Compatibility Kit). An administration console, clustering support, and other developer and production tools are also included in GlassFish.

Java 19's new features

Java 19, which is now in production, includes structured concurrency, virtual threads, pattern matching for switch expressions, a vector API, and a Linux/RISC-V port.

Java Development Kit 19, a non-LTS (long-term support) release of standard Java, is now available for download.

Structured concurrency, record patterns, a foreign function, memory API preview, and support for the open-source Linux/RISC-V instruction set architecture are the seven features targeted for the release (ISA). Except for the Linux/RISC-V capability, all components are in the preview or incubator phases.

Structured concurrency: In its early stages, this project aims to simplify multithreaded programming by providing a structured concurrency API. This concurrency treats multiple tasks running in different threads to facilitate error handling and cancellation as a single unit of work. Reliability and observability have been enhanced. Project Loom introduced a new lightweight concurrency model, which inspired this feature.

A sneak peek at record patterns for deconstructing record values. Nesting record patterns and type patterns allow declarative, powerful, and composable data navigation and processing. The proposal's goals include extending pattern matching to express more sophisticated, composable data queries while keeping the syntax and semantics of type patterns unchanged. This proposal builds on pattern matching, which was released in JDK 16 in March 2021. Record patterns may be expanded to include capabilities such as array patterns and vararg patterns. Project Amber is an effort to investigate and incubate more minor, productivity-oriented Java features.

A sneak peeks at a foreign function, and memory API would introduce an API allowing Java programs to interact with code and data outside the Java runtime. The API enables Java programs to call native libraries and process native data without the danger and brittleness of the Java Native Interface by efficiently invoking foreign functions (code outside the JVM) and safely accessing foreign memory (memory not managed by the JVM) (JNI). The foreign function and memory API brings together two previously incubating APIs: the foreign memory access API and the foreign linker API. JDK 17 incubated the foreign function and memory API, which was then reincubated in JDK 18. The proposal's objectives include usability, performance, generality, and safety.

A sneak peek at virtual threads, which are lightweight threads that drastically reduce the effort required to write, maintain, and monitor high-throughput, concurrent applications. The goals include allowing server applications written in the simple thread-per-request style to scale with near-optimal hardware utilization and allowing existing Java code.lang Thread API to adopt virtual threads with minimal change and enable virtual thread troubleshooting, debugging, and profiling with existing JDK tools. The goal of this proposal is not to change Java's basic concurrency model or to introduce new data parallelism constructs in the Java language or Java libraries. It is also not the goal to eliminate traditional thread implementations or silently migrate existing applications to virtual threads.

A third preview of pattern matching for switch expressions and statements, which extends pattern matching to switch, allowing a term to be tested against several patterns, each with a specific action, allowing complex data-oriented queries to be expressed concisely and safely. This capability was previously demonstrated in JDK 17 and JDK 18. The third preview would include refinements such as replacing guarded patterns in switch blocks with when clauses. In addition, when the value of the selector expression is null, a pattern switch's runtime semantics are more closely aligned with legacy switch semantics.

The plan's goals include allowing patterns to appear in the case of labels and increasing the expressiveness and applicability of switch expressions and statements. Other objectives include:

1. Allowing developers to relax the switch's historic null-hostility when desired.

2. Improving the safety of switch statements.

3. Ensuring existing switch expressions and opinions continue to compile and execute with identical semantics.

Pattern matching will eventually be supported throughout Java, adding it to places where expressions are used. This feature is also included in the Amber project.

A fourth vector API incubation would express vector computations that reliably compile at runtime to optimal vector instructions on supported CPU architectures, achieving performance superior to equivalent scalar computations. The API allows developers to write complex vector algorithms in Java, using the HotSpot auto-vectorizer but with a user model that makes vectorizations more predictable and robust. Previously, the vector API was incubated in JDK 16, JDK 17, and JDK 19.

JDK 19 API enhancements include loading and storing vectors to and from MemorySegments, as defined by the Foreign Function and Memory API preview. JDK 19 would also have two cross-lane vector operations, compress and expand, and a vector mask compress operation. The compress vector operation maps lanes from a source vector to a destination vector in lane order, whereas the grow vector operation does the opposite. The compress operation can be used to filter query results.

Another addition to the vector API would be the expansion of bitwise integral lanes operations, such as counting the number of one bit, reversing the order of bits, and compressing and expanding bits.

The API's goals included:

1. Being clear and concise, platform-agnostic.

2. Having reliable runtime and compilation performance on x64 and AArch64 architectures.

3. It allows for "graceful" degradation when a vector computation cannot be fully expressed as a sequence of vector operations at runtime.

The vector API is part of Project Panama, which aims to make communication between native and JVM code easier.

Conclusion

Java would gain support for a hardware instruction set already supported by a wide range of language toolchains with the Linux/RISC-V port. RISC-V is a group of related ISAs. The Linux/RISC-V port would only support the RISC-V RV64GV configuration, a general-purpose 64-bit ISA with vector instructions. In the future, Java developers may consider other RISC-V arrangements.

The port would support the template interpreter, C1 (client) JIT compiler, C2 (server) JIT compiler, and all current mainline garbage collectors, including ZGC and Shenandoah. The actual porting is nearly finished; the JDK Enhancement Proposal (JEP) is focused on integrating the port into the JDK mainline repository.

JDK 19 will, like JDK 18, be a limited-time release, with only six months of Premier support.

JDK 17 was a Long Term Support (LTS) release that received several years of support. It will arrive on September 14, 2021. JDK 21 will be released one year from now, followed by JDK 20, presumably in March 2023.