# Presentation: 943617

## JavaOneTM 2001 ConferenceJune 4th – 8th

- Darren Gemoets (AVATAR)
- darren.gemoets@commerceone.com
- Ken Wootton (IRC)
- ken.wootton@commerceone.com
- Babatunde O. Akinsanya (JOIN & JAS)
- babatunde.akinsanya@commerceone.com
- August 15th, 2001

## Agenda

**JavaOne 2001 Overview**
- Conference Topics
- Session List
- Keynote Addresses
**J2SE 1.4 (Merlin)**
- RAS, Assertions
- Logging and Printing API
- XML and JAXB
- Image I/O, Swing/Java 2D improvements
**Survey of Topics**
- Jini, Multimedia, Java 3D
- Macintosh OS X, J2EE versus .NET, Generics
**Looking Ahead**

## JavaOne 2001 Overview

- Over 20,000 Attendees
- Actually down from last year’s 25,000+
- 280 Technical Sessions, 244 Birds-of-a-Feather Sessions
- No more 6AM or 7AM BOFs, but they still ran until midnight
- Theoretical attendance maximum
- 27 sessions (9.6%), 19 BOFs (7.8%), and all five keynotes
- J2SE 1.4 was a topic of general interest
- J2ME was very popular!
- An entire keynote and one of seven conference Topics
- J2EE was also big, not surprisingly
- 40% J2EE, 25% J2SE, 20% J2ME, 15% General

## Conference Topics

- Seven Topics (280 sessions, 244 BOFs)
- Web, Services and Beyond (50 Sessions, 41 BOFs)
- Java Technologies for the Desktop: Web to PC
- 	(29 Sessions, 22 BOFs)
- New and Cool (30 Sessions, 40 BOFs)
- Smart Devices: The Modern Client (45 Sessions, 32 BOFs)
- Java Technology at Work (50 Sessions, 33 BOFs)
- Putting it to the Metal (49 Sessions, 47 BOFs)
- Exposing the Core (27 Sessions, 29 BOFs)
- Last Year: about 200 Sessions and 100 BOFs

## Session List (1 of 2)

**Technical Sessions:**
- Jini Network Technology and Service-based Architectures
- Java Platform Performance
- Technical Overview of the J2SE 1.4 Release
- Designing and Building Distributed Service-Based Architectures with Jini Network Technology
- Automatic Memory Management for Java
- Distributed Transactions with Jini Network Technology
- Managing Complexity with JFC/Swing and Java 2D APIs
- Assertiveness Training:  Getting the Most Out of the New Assertion Facility
- Writing High-Performance Apps w/ Swing
- Java Platform Printing

- Logging APIs for the Java Platform
- JAXB: XML Data Binding
- Taming Java Programming Language Threads
- Effective Layout Management
- EJB and Jini
- What's New in Java Client Technology?
- An Introduction to Multimedia on the Java Platform
- Introduction to JavaServer Pages Technology
- The Java Image I/O API
- High Performance Graphics
- Inside the Java 3D 1.3 API
- Performance Tuning for 'Big Iron‘
- J2ME Architecture Technical Overview
- Combining Scalable Vector Graphics and Java Technology to Manage Image Content on the Web

- Today’s presenters attended the following technical and Birds-of-a-Feather sessions.  Ask us for more information on these topics:

## Session List (2 of 2)

**Technical Sessions (continued):**
- The Evolution of the Performance of the Java Platform: a Panel Discussion
- Service Oriented Programming and Project 'Openwings'
- Improving Java Programming Language Code Using Static Analysis
- Distributed Computation with JavaSpaces Technology
- Security for the J2SE: Present and Future
- Building Installers for the Java Platform: The Results of JSR 38
- Creating JFC/Swing API-Based UIs Following Java L&F Guidelines
- Using Reference Patterns to Build Effective Pooling Solutions
- Adding Generics to the Java Programming Language
- Visible Human Image Display Program Using Java Technology
- Effective Programming with Java Technology
- Tutorial for J2EE: Build Your First Enterprise Application
- Performance Tuning with Java Technology
- Java Technology on Mac OS X: J2SE and much more!
- The Sun Open Net Environment vs. Microsoft .NET

**Birds of a Feather Sessions:**
- Java Technology in Astronomy
- Decentralized Security for Jini Network Technology
- The Java API for XML Binding ('JAXB'): Q&A
- Java Technology Game Development Roundtable
- A Jini Network Technology-enabled Home Gateway
- User Interface Design and the J2SE
- Java Technology on Mac OS X

## Keynote Addresses

- Speakers
- Sun: Ed Zander (COO), James Gosling (VP), Patricia Sueltz (EVP), Bill Joy (Chief Scientist), others
- Pekka Ala-Pietilä (President/Nokia), Bill Coleman (CEO/BEA Systems), Larry Ellison (CEO, Oracle)
- Demos
- J-Phone: take photos and attach them to emails
- Java-enabled PlayStation 2
- Several Java-based cell phones
- Digital camera transmits photos to any wireless device
- Java Games
- All the demos [seemingly] worked!

## J2SE 1.4 (Merlin)

- Beta available now for Solaris, Windows, Linux
- FCS release scheduled for Q4 2001
- RAS:  Reliability, Availability, Serviceability
- Scalability, Performance, Deployment
- New Features
- A “carefully budgeted set”
- GUI Features:  some new, some improved
- Connectivity:  XML, networking, security, and more
- VM and core libraries: GC, performance, new stuff
- The JCP (and JSRs) were mentioned quite often

## RAS

- General performance work
- Better GC Performance (esp. large heaps)
- Handling of low-resource conditions
- HotSwap debugging API
- On-the-fly class replacement
- Chaining of Exceptions
- 64-bit support (SPARC)
- Assertions
- Backward compatibility is supreme

## Assertions (1 of 2)

- Two forms:
**assert** speed <= SPEED_OF_LIGHT
**assert** speed <= SPEED_OF_LIGHT : speed;
- If assertions are enabled, VM throws AssertionError if expression is false
- Advantages
- Document code, validate assumptions, uncover bugs
- Enable at runtime in user code and/or JRE
- Always in class file, unlike C/C++
- Can enable at class/package level

## Assertions (2 of 2)

- Assertive comments
**else** // not found  **assert** found == false;
- // not reached  **assert** false;
- Switch with no default
- Preconditions of non-public methods
- Public preconditions should throw exceptions such as IllegalArgumentException
- Postconditions
**assert** numElements > 0; // at least one was added
- Don’t use for side-effects:  **assert** set.remove(elt);
- Infinite recursion:  assert sin2 + cos2 == 1

## Logging API (1 of 4)

- Attempts to unify different logging APIs
- Very similar to Apache’s Log4J and IBM’s JLog
- Log messages are sent to **Logger**s
- Loggers send the messages to **Handler**s
- Handlers write the actual log file or optionally pass it through a **Formatter**
- More information and examples at
- http://java.sun.com/j2se/1.4/docs/guide/util/logging/overview.html

## Logging API (2 of 4)

## Logging API (3 of 4)

- Each class can have its own logger
- Loggers should be named in a hierarchical manner
- i.e. gov.nasa.gsfc.projectH.MainClass
- Each logger has a level
- Calls below a logger’s level are discarded
- About 9 levels defined: ALL, SEVERE, WARNING, INFO, etc.
- Several handlers and formatters come with JDK 1.4
- ConsoleHandler
- FileHandler, supports rotating log files
- SocketHandler
- XMLFormatter, writes XML info
- Beware of crashes...

## Logging API (4 of 4)

- Get a reference to a logger
**static** Logger log = Logger.getLogger(“gov.nasa.gsfc.projectH.MyClass”);
- Check if logger is enabled for that level
**if** (log.isLogging(Level.FINER)) { log.finest(“Hello World!”); }
- Saves time if level is not enabled
**Filters** can also be used to log messages selectively
- Can be attached to either Handlers or Loggers

## Printing API (1 of 4)

- Totally revamped from the 1.3 version
- Uses some of the Jini concepts such as services
- Five steps for printing
- Describe the print data
- Specify how data is to be printed
- Locate suitable printer services
- Create print job and specify print data
- Submit print job
- For more information, examples and user guide, see
- http://java.sun.com/j2se/1.4/docs/guide/jps/index.html

## Printing API (2 of 4)

- Describe the data
- Use the DocFlavor class
- Lots of pre-defined flavors: html, text, images, etc.
- DocFlavor htmlFlavor = DocFlavor.URL.TEXT_HTML_US_ASCII;
- Specify how to print data
- Printers have service (name, location) and request (paper size) attributes
- Copies, Sides, MediaSizeName are pre-defined in JDK 1.4

## Printing API (3 of 4)

- Locating a suitable printer
**PrintServiceLookup** takes a set of attributes and a document flavor
- Returns array of **PrintService** objects
- Choose one of the PrintServices or allow user to choose
- Create print job
- Get a **DocPrintJob** from the selected PrintService
- Submit print job
- Create print data using **Doc** interface
- Submit job using DocPrintJob.print(...) method

## Printing API (4 of 4)

**PrintRequestAttributeSet attrSet = new****	****HashPrintRequestAttributeSet();****attrSet.add(MediaSizeName.ISO_A4); ****attrSet.add(Sides.TWO_SIDED_LONG_EDGE); ****attrSet.add(new Copies(2));****DocFlavor pFlavor = DocFlavor.URL.TEXT_HTML_US_ASCII;****URL url = new URL(“**_[http://](http://www.commerceone.com/)__[a](http://www.commerceone.com/)__**aa.gsfc.nasa.gov**_**”);****PrintService[] services =****	****	****PrintServiceLookup(pFlavor, attrSet);****DocPrintJob pJob = services[0].createPrintJob();****SimpleDoc doc = new SimpleDoc(url, pFlavor, attrSet);****pJob.print(doc, attrSet);**

## XML/JAXB (1 of 4)

- Started out as Project Adelard (JSR-31)
- XML Data Binding
- Compile XML schema into Java classes
- These classes hide the complexity of XML parsing
- Write Java code to work directly with these objects
- Key components
- Schema Compiler
- Marshaller
- Unmarshaller
- http://java.sun.com/xml/jaxb/index.html

## XML/JAXB (2 of 4)

- Schema Compiler
- Need a binding schema and an XML schema
- The binding schema tells the compiler how to map XML elements to Java classes
- Currently, JAXB supports only XML DTD
- Final JDK 1.4 might include support for a subset of XML Schema
- Unmarshalling
- Process of converting XML instance documents to Java objects
- Simply call the *unmarshal* method in the generated classes
- Pass in a valid XML document

## XML/JAXB (3 of 4)

- Marshalling
- Process of saving Java objects to XML instance documents
- Call the *marshal* method on the “root” node
- It validates the object before writing XML
- Subclassing generated classes
- More complex but can be done

## XML/JAXB (4 of 4)

- Competing technologies
- Borland JBuilder 5 has data binding tools
- Supports XML Schema (JAXB does not)
- Breeze Factor’s Breeze XML Studio
- Also supports XML Schema
- Home grown version
- JAS has a schema compiler, marshaller and unmarshaller
- Examples using JAXB
- http://java.sun.com/xml/jaxb/index.html

## Improvements in the Client Architecture

- Improvements and additions
- AWT
- Swing
- Java2D
- Image I/O
- Graphics Performance

## Putting Things In Focus

- java.awt.KeyboardFocusManager
- Replaces the javax.swing.FocusManager
- Allows user to query the focus owner
- Centralizes all focus activity
- java.awt.FocusTraversalPolicy
- Lighter-weight than javax.swing.DefaultFocusManager
- Specify an initial component
- Easily reuse the traversal algorithm between components
- Window/JWindow focus problems fixed

## All or None

- Full screen mode
- Direct control of the screen
- Good for games, slide shows, etc.
- Headless mode
- Printing, 2D, and images still enabled
- Turn on with runtime flag (java.awt.headless=true)
- java.awt.HeadlessException thrown when improper methods are called
- Undecorated/Client Decorated Frames
- Frames/Dialogs now have set/isUndecorated() methods
- Client can decorate frame to their choosing

## Mouse Wheel Support

- AWT and JFC/Swing
- Works with existing applications without any modifications
- Scrolling is the default behavior
- java.awt.event.MouseWheelListener allows custom behavior

## What a Drag (and Drop)

- Drag support for JTree, JList, JTable, JColorChooser, JFileChooser, JTextComponent
- Drop support for JTextComponent
- Custom TransferHandler set via JComponent.setTransferHandler(...)
- This handler maps model data to a Transferable

## Window Cleaning

- Windows Look and Feel has been cleaned up
- Fonts picked up from Desktop
- Better spacing, layout
- Rollover toolbars
- At the moment at least, this must be requested
- Takes advantage of windows sounds

## New Components (1 of 2)

- JFileChooser
- Support for network browsing and the Windows virtual desktop
- Detailed list now works
- JProgressBar
- Indeterminate mode
- Scrollable tabs
- JTabbedPane.setTabLayoutPolicy(...)
- JSpinner
- Can spin numbers, dates, sets of objects
- JFormattedTextField
- Can format numbers, dates, arbitrary values (e.g. phone numbers)

## New Components (2 of 2)

## A Clearer Image (1 of 2)

- New Core Image API (javax.ImageIO)
- JPEG, PNG, and GIF (read-only) are supported “out of the box”
- Access and produce image metadata using a XML DOM tree
- Simple API for casual use
- Example: ImageIO.read(:URL) : BufferedImage
- Automatically recognizes the format and loads proper reader plug-in
- Uses either the file name or image data

## A Clearer Image (2 of 2)

- Pluggable Architecture
- Most image formats not supported
- Developers create readers and/or writers based on the provided interface
- New readers/writers are automatically discovered by the API

## Volatile Graphics

- VolatileImage interface
- Created in accelerated memory
- Great for highly reused, infrequently updated images (e.g. back buffers)
- Automatically accelerates existing applications
- Component.createImage(), Toolkit.getImage()
- Internal re-architecture and much better X Windows support

## Jini

- More of show-and-tell than new features
- Chrysler used Jini in *IT*Cruiser concept car
- Ford used Jini in 2000 Lincoln Demonstrator
- F.E.T.I.S.H.
- Federated European Tourist Information Service Harmonization
- Decentralized Jini Security
- Research in progress
- www.tml.hut.fi/~pnr/publications/eronen_nikander_ndss2001_final.pdf
- Distributed transaction management
- Built-in into Jini

## Multimedia (1 of 3)

- “Flexible, portable, scalable, high-performance” secure media APIs
- Solaris, Linux, Macintosh, Windows **////**
- Multiple deployment options
- Application, locally run applet, streamable applet (Netscape/IE)
- Four sessions, seven BOFs
- Java Media Framework (JMF)
- Streaming audio/video, A/V capture
- Pluggable media formats and transmission protocols
- “Performance packs” for Solaris, Linux, Windows
- JMF 2.2 (Q401):  MPEG-2

## Multimedia (2 of 3)

- Java Sound API
- Extensible Web-based Audio and MIDI support
- WAV, AIFF, AU, MIDI, RMF
- Mixing and rendering via Beatnik Audio Engine
- Core in J2SE 1.3 for Solaris, Windows, Linux
- MIDI input and MP3 support on the horizon
- Java Advanced Imaging (JAI) API
- Java-based image processing with native acceleration
- Optional package for Solaris, Windows, Linux
- JAI V1.2 (late ’01/early 02)
- Volumetric imaging; interoperable with Java3D

## Multimedia (3 of 3)

- Java Speech API (JSAPI)
- Java-based speech recognition and synthesis
- Solaris, Windows, Linux (surprise)
- JSAPI 2.0 specification ongoing
- Embedded devices, J2ME, W3C Speech Interface Framework
- Scalable Vector Graphics (SVG/Batik)
- XML-based portable, scripted 3D graphics
- Apache’s Batik:  open source Java toolkit
- http://xml.apache.org/batik
- Batik 1.0:  static SVG, some scripting
- Batik 2.0 (no date): complete animation and scripting
- SVG  MPEG via JMF

## Java 3D (1 of 2)

- High-level, vendor-neutral, platform-independent, Java-based graphics API
- You focus on content, Java 3D focuses on rendering
- 95% Java, 5% native graphics (OpenGL or Direct3D)
- Solaris, Windows, HP, IBM, Linux, SGI, Netscape/IE
- Roadmap
- Version 1.2.1_01 (current)
- Version 1.3 Beta (Q301)
- Version 1.3 Final (Q102)
- Version 1.4 call for experts (Q301)
- “a major release”:  extensibility, programmable shaders, shadows

## Java 3D (2 of 2)

- Java 3D Version 1.3
- Depth-sorted transparency
- Support for per-view objects (Shape3D, etc.)
- GeometryArray enhancements (four slides’ worth)
- Texture enhancements (six slides’ worth)
- Raster destination pixel offset
- Behavior synchronization
- Ability to pause alpha-based interpolators
- Audio reverb **/** environmental parameters
- Performance improvements
- Performance tips provided

## Macintosh OS X (1 of 2)

- Apple’s First Java Goal:
- #1 desktop for deploying Java technology-based apps
- Macintosh OS X ships with J2SE 1.3 out-of-the-box
- “No more excuses”  approach
- Sun ships J2SE 1.3.1 May 17
- Apple update to 1.3.1 in July
- Two-month delta
- Shared, hardware-accelerated Swing
- Java threads directly call native OS X threads

## Macintosh OS X (2 of 2)

- Apple’s Second Java Goal:
- #1 desktop for developing Java technology-based apps
- Borland’s JBuilder 5:  Q301
- Demos at JavaOne Pavillion
- Tailored for Mac OS X
- Development tools
- CodeWarrior Pro 7 EA
- InstallAnywhere
- OptimizeIt!
- Mac OS X BOF: very well-attended

## J2EE vs. .NET (1 of 2)

- Ed Roman, CEO The Middleware Company
- TheServerSide.com
- Web services fundamentals:  great primer
- Overview of J2EE and .NET
- Comparison of J2EE and .NET
- RAD features:  comparable
- Performance:  J2EE’s better performance services require experience
- Single-vendor solution:  .NET strong, J2EE also strong for major vendors (Oracle, BEA, IBM)
- Legacy integration:  J2EE will surpass .NET via JCA
- Marketing:  .NET has better perception as a web services platform

## J2EE vs. .NET (2 of 2)

- Comparison of J2EE and .NET (continued)
- Maturity:  J2EE mature, but not for web services
- .NET is first-generation
- Language support:  .NET better on surface (no bridges)
- Portability:  J2EE wins, but that’s not always useful
- Web services support:  J2EE can be deployed today
- But Visual Studio.NET is an “awesome tool” for RAD development
- Cost:  both can be low cost but .NET comes with OS
- with J2EE you choose your service level
- “Both will win in their own markets.”
- J2EE platform versus .NET whitepaper
- _[http://www.theserverside.com/resources/pdf/J2EE-vs-DotNET.pdf](http://www.theserverside.com/resources/pdf/J2EE-vs-DotNET.pdf)_
- Prepared for Sun Microsystems

## Generics

- Generics abstract over types
- Classes, interfaces, and methods can be generic
- Generics are **not** templates
- Generic **declarations** are type-checked (unlike C++)
- Generics are compiled once and for all
- No code bloat
- Non-generic code can use generic libraries
- Retrofitting mode in compiler
- Make the API generic before converting the implementation
- Should make it into J2SE 1.5 (Tiger)
- Early adopters can use prototype implementation
- http://java.sun.com/people/gbracha/generics-update.html

## Looking Ahead

- J2SE 1.4 Beta available now
- J2SE 1.4.0 Q401
- J2SE 1.4.1 Q202
- bug fixes, performance work, no API changes
- J2SE 1.5 (“Tiger”) Q203
- Already starting to plan for it
- Developer’s survey:  tiger@sun.com
- San Francisco, California March 25-29, 2002
- J2EE 1.3 going final Q301