Enter Java 1.4 Merlin beta

Move over 1.3: 1.4 is on its way!

June 6, 2001— On May 23, Sun Microsystems released the first beta of Java 1.4 (aka Merlin), the next major release of the Java platform. The beta release came just in time for the 2001 JavaOne conference, where it is a hot topic. This week, there are a number of Java 1.4-dedicated sessions that outline its future direction and give insight into the new APIs and language features that the release brings.

On Monday, Graham Hamilton, distinguished engineer from Sun Microsystems, hosted the “Technical Overview of the Java 2 Platform, Standard Edition (J2SE) 1.4 Release (TS-693)” technical session. He offered some details on the new functionality found in J2SE 1.4. Hamilton started his session by providing context and background for the 1.4 release.

Java’s release cycles

Project Merlin complies with Sun’s goal of offering a major Java feature release every 18 months. According to Hamilton, Sun has found that this 18-month cycle affords the Java community with enough time to embrace and absorb each new release; anything quicker will not give developers and tool vendors enough time to learn and use new features. During these 18-month cycles, Sun does release incremental updates addressing bug and performance issues. However, major functional releases such as Merlin also add or augment existing APIs as well as make changes to the base language. While Merlin does make some small changes to the Java language, Hamilton says that the release limits most changes to performance and API enhancement.

Merlin: A community process

Sun did not design the new release behind closed doors. Instead, Merlin is the product of the Java Community Process (JCP). Through Java Specification Request (JSR) 059, the Java community had the opportunity to influence Merlin’s development directly.

Hamilton says that during the period that Merlin was under development, the JCP uncovered five factors that the community felt should shape the next release of the Java platform:

  1. Java is used heavily for client-side GUI development.
  2. Java is used extensively for large-scale server development.
  3. Quality is more important that new features.
  4. Performance and scalability are very important.
  5. Producing a solid, reliable release for both the client and server is paramount.

These five factors acted as the driving force behind decisions as to what to include — and what not to include — in J2SE 1.4. Just as Merlin’s specification has been developed under the JCP, so to has every new feature. Each major API and language change is being handled through its own expert group under a JSR. Smaller changes are handled through the JCP maintenance rules. (See Resources for a list of JSRs that make up Merlin.)

Hamilton summed up Merlin’s major functional goals as:

  • Reliability, availability, serviceability
  • Scalability
  • Performance
  • Deployment

Merlin meets these goals through new GUI features, connectivity enhancements, and changes to the VM and core libraries. Hamilton used the rest of his session to outline new functionality, point out what functionality didn’t make it into the release, and give the attendees a status on the beta.

New GUI features

Merlin makes a number of changes to the Java 2D, AWT, and JFC/Swing APIs. Most changes revolve around performance. Merlin represents a compelling release for client-side Java programming.

Java 2D

The Java 2D APIs have undergone a major performance rearchitecting that simplifies the drawing pipeline. In the past, these APIs were optimized for benchmarks; the rearchitecture changes the focus and optimizes the APIs for typical real-world use. While these new APIs may perform more poorly than their 1.3 counterparts in the benchmarks, real programs can expect to see a 40 percent speed improvement in Swing compared to 1.3 and a 100 percent improvement in comparison to 1.2.

Beyond the pipeline rearchitecting, 1.4 2D improvements also include:

  • Better support for remote use of the X Window System. Rather than sending bitmaps across the network, the newly redesigned APIs will send X commands, resulting in an enormous boost in performance — X should work 5-10 times faster!
  • Pluggable image I/O (JSR-015). The new pluggable image I/O framework will ship with support for GIF, JPEG, and PNG graphics.
  • Printing extensions (JSR-006). These new extensions provide for more page control, enumeration of printers and print capabilities, and improved performance.
  • Support for TrueType font hinting.

AWT

Merlin finally solves a historical problem with AWT focus management. Indeed, Sun has completely rewritten and redefined the focus management subsystem. While a complete rewrite is a risky move, it does raise the overall quality and provides a maintainable system.

Beyond focus management, Java 1.4 also adds:

  • Mouse wheel support.
  • Support for headless GUIs. Such support provides for the limited use of GUIs on servers.

JFC/Swing

Merlin also offers a number of functional and performance improvements for Swing.

Hamilton says that Merlin will finally solve the look-and-feel problems of the Windows FileChooser, long the bane of many programmers. The FileChooser should now support the full look and feel of the Windows native filechooser. Also of note is the fact that allSwing components will now support drag and drop.

On the API front, 1.4 adds a number of new components, including JSpinner, JProgressBar, and JTabbedPanel. JSR-057 adds the archiving JavaBeans components.

New connectivity functionality

Merlin also adds a number of new connectivity features to Java.

XML

Hamilton says that Sun had originally planned a lot of new XML support in Merlin. However, in the last year or so, it has become apparent that XML technologies are still maturing. It seemed better to just delay inclusion of new XML APIs and provide them as unbundled add-ons until the technology matures, he says.

That being said, Merlin does include the core JAXP APIs:

  • SAX 1.0 and DOM 1.0 (JSR-005)
  • SAX 2.0 and DOM 2.0 (JSR-063)
  • XSLT Support (JSR-063)

Future releases will include more XML APIs as they mature and stabilize.

IPv6

1.4 adds support for IPv6 on host operating systems (such as Solaris 8 and Windows 2000) that support the protocol.

URI

Hamilton says that experience has shown that the java.net.URLclass is connection oriented — an excellent feature if you want to connect to a URL, but a problem if you only want to syntactically manipulate one.

To overcome this shortcoming, 1.4 adds a new URI class that adds full support for W3C URIs. The new class allows for the syntactic manipulation of the URI. When you are ready to connect, you can use the old URL class.

Security

US export restrictions have prevented inclusion of the JSSE, JAAS, and JCE security extensions in past core J2SE releases. Fortunately, the US government has reviewed these rules and 1.4 will now include these API.

Java 1.4 also adds Kerberos support through the GSS API (JSR-072). Kerberos will allow support for single sign-on using OS credentials when they are available. If OS credentials are not available, it will obtain them directly.

JDBC

All JDBC 3.0 APIs will become part of the core Java platform. You will no longer need to download and install separate packages.

For dependency reasons, some APIs from the JTA specification will find their way into the core APIs. However, Hamilton says that Sun will limit inclusion to those parts of the APIs critical for getting JDBC 3.0 to work.

JNDI

Java 1.4 adds DNS service provider support to JNDI. Java 1.4 also allows access to Microsoft’s Active Directory.

CORBA

Hamilton says that Sun’s approach to CORBA has been to provide basic interoperability support. Java 1.4 meets these goals and adds full portable object adaptor (POA) support. Merlin also adds improved CosNaming support and a persistent CosNaming implementation.

Hamilton again cautions that if you need further support you should consider one of the commercial CORBA ORBs, such as IONA or VisiBroker.

Java Plug-in and Java Web Start

In Java 1.4, the Java Plug-in now allows applet access to the browser DOM. Java 1.4 also improves the user experience through various usability improvements. For example, applets will now provide feedback to the user at all times. Users will no longer be faced with a blank gray box as an applet loads.

Finally, 1.4 adds support for the Java Web Start software (JSR-056) directly to the core platform.

VM and core libraries

Java 1.4 will also include changes to the VM and core libraries.

VM changes

Merlin now adds support for 64-bit chip architectures. Initially, this support will appear for the SPARC architecture; however, ports to Intel’s IA-64 are planned.

Beyond support for 64-bit address spaces, Merlin also enhances the general performance of the VM through HotSpot optimizations and improved garbage collection (GC) performance. Hamilton says that Sun has tuned the GC for very large heaps and has been testing on 10- and 11-GB heaps.

Core library changes

Merlin adds a number of new APIs to the core library:

  • A JPDA debugging API that allows class replacement on the fly
  • I/O APIs for scalable I/O, fast buffered I/O, and regular expressions (JSR-051)
  • Preference API (JSR-010)
  • Simple assertion support (JSR-041) (the only language change)
  • Logging APIs (JSR-047)

Merlin also augments the exception hierarchy to allow exception chaining. With such support, you should be able to get to the source of a thrown exception easily.

Finally, Merlin adds full Unicode 3.0 support, as well as support for Thai and Hindi scripts. With those additions, Java now supports all major locales around the world.

What didn’t make it

For various reasons, Merlin will not contain support for Java RMI Security (JSR-076) or Custom Remote References (JSR-078). These extensions were voted down by the JCP because the community felt that they were too Jini-specific and didn’t offer functionality that would be useful to all Java developers. However, these proposals will be revisited for the next major release after Merlin, known as Tiger.

Furthermore, Merlin will not add support for Generics. Such an addition would require changes to the core language beyond Merlin’s scope. Generics are another of the features proposed for Tiger.

Moreover, Merlin will not add support for XML data binding.

Finally, Merlin will not add support for printf/scanf-like printing and formatting. Hamilton says that developing such functionality would have detracted from the need to focus the I/O work on scalability. The good news: the regular expression framework needed for printf/scanf functionality will still make it into the release as part of the new I/O APIs. (For more on the new I/O APIs, see the sidebar below. )

Status

Hamilton says that Sun is planning on a beta refresh sometime this summer, followed by a late summer or early fall release of 1.4. As exciting as the feature list sounds, Hamilton does caution that nothing is final until the product ships. Sun is absolutely dedicated to producing a high-quality release, he notes; anything that doesn’t live up to those goals will be cut. A few JSR proposals still need to go through some JCP reviews.

In the meantime, Hamilton says, Sun wants your feedback. He suggests downloading the beta and seeing if your old Java code works with it. He also wants to know if the new APIs meet your needs. A beta is a call for feedback and a time when you can tell Sun what you think.

Tiger: Java 1.5

Tiger is the project name of the next feature release after Merlin. While Hamilton doesn’t provide many details, Sun has begun gathering initial data, with Tiger expected to enter the JCP process later this summer. If you are interested in filling out a developer’s survey, write to [email protected]. The survey is your chance to influence the next major release after Merlin.

Tony Sintesis a principal consultant at BroadVision. Tony, a
Sun-certified Java 1.1 programmer and Java 2 developer, has worked
with Java since 1997.

Source: www.infoworld.com