JDK 1.2 is a major Java API release of the Java Development Kit, with these new
features taking it beyond JDK 1.1.x.
Not all of these features are fully implemented in this beta release. These
features are divided into Core Platform and Standard Extensions.
Core Platform
The Core Platform will be available on all Java Compatible systems supporting 1.2.
- Security Enhancements
- Policy-based, Easily-configurable, Fine-grained Access Control
introduces the concepts of "permission" and "policy."
When code is loaded, it is assigned "permissions" based on the
security policy currently in effect. Each permission specifies
a permitted access to a particular resource (such as "read" and
"write" access to a specified file or directory, "connect" access
to a given host and port, etc.). The policy, specifying which permissions
are available for code from various signers/locations, can be initialized
from an external configurable policy file. Unless
a permission is explicitly granted to code, it cannot access the resource
that is guarded by that permission.
These new concepts of permission and policy enable the
JDK to offer fine-grain, highly configurable, flexible, and extensible
access control. Such access control can now not only be specified for
applets, but also for all Java code, including applications, beans, and
servlets.
- Certificate interfaces enable developers to build
tools for parsing certificates, enforcing their own
site-specific certificate policies, and managing local databases
of certificates.
- X.509 v3 implementation of the new, supported
certificate interfaces.
- The keytool, jar, jarsigner, and policytool security tools -
keytool creates key pairs and self-signed X.509 v1 certificates,
and manages keystores. Keys and certificates are used to digitally
sign your Java applications and applets. A keystore is
a protected database that holds keys and certificates.
jarsigner signs JAR (Java Archive Format) files,
and verifies the signature(s) of signed JAR files.
It accesses the keystore when
it needs to find the key when signing a JAR file. keytool and
jarsigner replace javakey. policytool creates and modifies
the external policy configuration files that define your installation's
Java security policy.
- Swing (JFC)
- Swing is a new set of GUI components with a "Pluggable Look and
Feel" that are implemented in 100% Pure Java, and based on the JDK 1.1
Lightweight UI Framework.
- Pluggable Look and Feel lets you easily design a single set
of GUI components that can automatically have the look and feel
of any OS platform (Windows, Solaris, Macintosh).
- Swing Components include both 100% Pure Java
versions of the 1.1 AWT component set, plus a rich set
of higher level components. The complete set includes borders,
buttons, checkboxes, combo boxes, icons, labels, lists,
list boxes, menus, menubars, menu items, popup menus,
radio buttons, progress bars, scroll panes & viewports,
scrollbars, tabbed panes, tables, text areas, text
components, text fields, trees and HTML viewers.
- Java 2D (JFC)
- Java 2D API is a set of classes for advanced 2D graphics
and imaging. It encompasses line art, text, and images in a
single comprehensive model. The API provides extensive
support for image compositing and alpha channel images, a set
of classes to provide accurate color space definition and
conversion, and a rich set of display-oriented imaging
operators. These classes are provided as additions to the
java.awt and java.awt.image packages (rather than as a separate
package).
- Accessibility (JFC)
- Accessibility API provides a clean interface which allows
assistive technologies to interact and communicate with JFC and
AWT components. Assistive technologies are used by people
with and without disabilities and include screen readers, screen
magnifiers, and speech recognition.
- Drag & Drop (JFC)
- Application Services (JFC)
- Keyboard Navigation makes it possible to substitute the
pressing of predetermined key combinations for mouse-driven events such as
the selection of a menu item or a dialog-box button.
- Multithreaded Event Queue is an enhanced event queue
that makes it easier for developers to synchronize events from
multiple sources. This simplifies thread management by making
use of new methods such as invokeLater(), which makes it possible
for an application to access the user interface from a
separate thread.
- Undo makes it possible to reverse the effects of a
previously executed command.
- Bounded Range Model sets limits on the values
that can vary with a bounded range, such as with sliders,
progress bars and scroll bars. It also corrects some shortcomings
of the AWT Adjustable interface.
- Custom Cursors allow programs to create their own
custom mouse cursors using arbitrary images. The hotspot can
also be defined.
- Debug Graphics Utility is a design tool that you can
use to test whether your Swing components are being drawn correctly.
With DebugGraphics, you can highlight component parts in bright
red as they are being drawn. Then you can monitor them as they
are being created and observe exactly how all drawing operations
are taking place.
- Repaint Batching is a mechanism that provides ways to
optimize the repainting of screen regions. It lets you mark a
component region as out-of-date, and compute the intersection of all
out-of-date regions and repaint what is appropriate. It also
provides a way for objects to be aware of all out-of-date
regions in a component hierarchy at a given time so advanced
optimization will be possible. Lastly, it allows you to plug
in a custom repaint batching system for special applications.
- Target Manager allows actions to dynamically affect
different targets. Objects can register with target managers,
specifying the actions that they are capable of supporting.
Subsequently, an action can query a target manager to find
out what its current target is.
- Collections
- Java Collections API is a unified framework for representing
and manipulating collections, allowing them to be manipulated independent of
the details of their representation. It allows for interoperability among
unrelated APIs, reduces the effort in designing and learning new APIs that
would otherwise have their own collection interfaces, and fosters software
reuse. The API includes interfaces, concrete implementations,
abstract implementations, and a few polymorphic algorithms.
- Extensions Framework
- Extension Framework supports the dynamic downloading and
installation of extensions as JAR files onto the Java Platform. An
extension is a group of Java packages that implement an API that extends
the Java platform. Extensions are identified by the package name "javax"
and are usable by both applications and applets. Extension will be
available from both Sun's JavaSoft and from third parties.
- JavaBeansTM Enhancements
- Interaction with Applet Semantics
fixes the limitations in the specification and
implementation of JavaBeans that implement Applet semantics.
These shortcomings made it difficult to implement
some Applet and Bean behaviors in the same object.
- Better Design-Time Support adds infrastructure during
the JavaBeans design time to enable a more sophisticatated
builder environment.
- Beans Runtime Containment and Services Protocol
adds additional context to the execution lifetime of JavaBeans
including but not limited to AppletContext and the ability to
parent into an AWT presentation hierarchy.
- Input Method Framework
- Input Method Framework enables all text editing
components to receive Japanese, Chinese, or Korean text input
through input methods. An input method lets users enter
thousands of different characters using keyboards with far fewer
keys. Typically a sequence of several characters needs to be
typed and then converted to create one or more characters.
Components can actively use the API to support the on-the-spot
input style; otherwise the framework provides root-window style
input as a fallback.
- Version Identification
- Version Identification introduces package level version control
where applications and applets can identify at runtime the
version of a specific Java Runtime Environment, VM, and class
package.
- RMI Enhancements
- Remote Object Activation introduces support for
persistent references to remote objects and automatic object
activation via these references.
- Custom Socket Types allow a remote object to specify the
custom socket type that RMI will use for remote calls to that
object. RMI over a secure transport (such as SSL) can be
supported using custom socket types.
- Minor API Enhancements allow the following: unexporting a
remote object, obtaining the stub for an object implementation,
obtaining a local object implementation from a stub, and
exporting an object on a specific port.
- Serialization Enhancements
- Persistent Field API allows the persistent data of an object
to be specified independently of the fields of the class and allows
those persistent data fields to be written to and read from the
stream using the existing protocol.
This ensures compatibility with the default writing and reading mechanisms.
- Reference Objects
- Reference objects reify references in much the same way that Class objects
reify Java classes. That is, a reference object encapsulates a reference to
some other object so that the reference itself may be examined and manipulated
like any other object.
Reference objects allow a program to maintain a reference to an object that
does not prevent the object from being considered for reclamation by the
garbage collector. They also allow a program to be notified some time after
the collector has determined that an object has become eligible for
reclamation. Reference objects are therefore useful for building simple caches
as well as caches that are flushed only when memory is low, for implementing
mappings that do not prevent their keys (or values) from being reclaimed, and
for scheduling post-mortem cleanup actions in a more flexible way than is
possible with the Java finalization mechanism.
- Audio Enhancements
- Java Sound replaces the existing sound engine with a new
sound engine that provides playback for MIDI files and the
full range of .wav, aiff and .au files. It also provides
much higher sound quality. It introduces no new API.
- getNewAudioClip is a new static method in java.Applet to get
an audio clip. This enables applications to create audio clips without
requiring an AppletContext.
- Java IDL
- Java IDL adds CORBA (Common Object Request Broker Architecture)
capability to Java, providing standards-based interoperability and
connectivity. Java IDL enables distributed Web-enabled Java
applications to transparently invoke operations on remote
network services using the industry standard OMG IDL (Object
Management Group Interface Definition Language) and IIOP (Internet
Inter-ORB Protocol) defined by the Object Management Group.
Runtime components include a fully-compliant Java ORB for distributed
computing using IIOP communication. The
idltojava
compiler generates portable client stubs and server skeletons that
work with any CORBA-compliant ORB implementation.
- Performance Enhancements
- Solaris Native Thread Support can provide
several advantages over the default threads package.
In a multi-processor environment, the Solaris kernel
can schedule native threads on the parallel processors
for increased performance.
The native threads VM can call into C libraries that use
Solaris native threads.
The VM can avoid some inefficient remapping of I/O system
calls that are otherwise necessary.
- Memory Compression for Loaded Classes
Constant strings are shared among different classes, resulting
in reduced memory consumption for Java applications.
- Faster Memory Allocation and Garbage Collection
The thread-local heap cache eliminates the need of locking for
majority of heap allocations. Memory allocation speed is
drastically increased.
Garbage collection pauses are shorter. The garbage collector
no longer excessively consumes the C stack.
- Monitor Speedups
The thread-local monitor cache enables synchronized methods
to run closer to the speed of normal methods.
- Native Library JNI Port
Native libraries supporting core Java classes (e.g., AWT) have
been rewritten using the Java Native Interface (JNI). The
resulting code is more efficient and can run unmodified on
different Java Virtual Machines.
- Just In Time (JIT) Compilers
JIT compilers are being included with the JDK. The Solaris
JIT compiler is available with Beta 2. The Win32 JIT compiler
will be available with the final release.
- JAR Enhancements
- JAR Enhancements
extend the utility of the Java Archive format. Improvements
to the command-line JAR tool for creating and updating
signed JAR files. New standard APIs for reading and writing JAR files.
Policy and mechanism for handling dependencies on standard extensions
and other third-party libraries packaged as JAR files.
- JNI Enhancements
- JNI Enhancements extend
the Java Native Interface (JNI) to
incorporate new features in the Java platform. The
changes are driven by licensee and user comments.
- Reflection Enhancements
- Reflection Enhancements
enables a field, method or constructor object to be explicitly flagged
as suppressing default Java language access control.
- Java Virtual Machine Debugger Interface
- The Java Virtual Machine now provides low level services for
debugging, the Java Virtual Machine Debugger Interface (JVMDI).
- JDBC Enhancements
- JDBC Enhancements
include an improved version of the JDBC-ODBC Bridge.
Standard Extensions
Standard Extensions extend the Java Platform with capabilities beyond
what is provided within the Java core platform. The Java Servlet API (described
below), is one of many planned Standard Extensions that will be available from
Sun's JavaSoft. Standard extensions must conform to the
Extension Architecture.
- Java Servlet API enables the creation of Java Servlets.
Servlets are a means of extending the functionality of servers.
For example, servlets can extend a web server's functionality in
the same way that CGI scripts do. Servlets, however, are much
less resource intensive than CGI scripts. Because servlets are
written entirely in Java, again unlike CGI scripts, they are
cross-platform as well.
Tools
Several of the JDK tools have improvements; the one listed here has a
substantial design change and corresponding documentation.
- Javadoc Doclets can be used to customize the content
and format of the output of the JDK javadoc tool.