JavaOne 2003 Notes
Summary/Highlights
- J2SE 1.5 will focus on "ease of use" for developers, targetting
development now being done in Visual Basic. Language will have useful new
features including metadata and generics. Concurrency package will be new
way to do multithreading. AWT on Linux/Solaris much improved.
- J2EE 1.4 delayed until December. J2EE 1.5 will use metadata to make deployment
and EJB development easier. Interaction with scripting laguages in the web
tier will be defined; PHP is the scripting language of choice.
- Sun "Desktop Java Initiative" major push to get Java successfully
onto desktop PCs.
- Server side UI component development will be focused on JavaServer Faces
(JSF), which will supercede Struts in 6-12 months.
- jvmstat tool for 1.4.1: "Visual GC" http://www.sun.com/developers/coolstuff.
- Jogl: Open source Java bindings for OpenGL. http://jogl.dev.java.net/
- Streaming API for XML: STaX = better SAX
Contents
Status and Release Schedule
J2SE
1.4.1 "Hopper" +2000 bug fixes, better GC
1.4.2 "Mantis" (June 2003) desktop client performance. Another 2000
bug fixes.Windows XP, Linux GTK Look and Feel improvements, Itanium CPU support,
server GC. Swing performance improvments about 50% over 1.3.1. performance increases
esp on Linux/X86. startup times 15-30% faster. Auto-update for JRE delayed until
1.4.2.x. PACK compression - reduce jar download time. Web Start fully integrated
into JRE. (1.2 release candidate now available at http://java.sun.com/j2se/1.4.2/index.html
is cobundled with NetBeans 3.5)
1.5 "Tiger" summer 2004. beta available end of 2003.
1.5.1 early 2005
1.6 "Mustang" early 2006
J2EE
J2EE 1.4 delayed for final Web Services Interoperability (WS-I) specification
2003 4Q
Mac OS X
- 1.3.1 (default) and 1.4.1 supported.. SDK bundled, not just JRE.
- 1.4.1 requires Mac OS X 10.2.3. Rewrote AWT in Cocoa for 1.4.1, Aqua L&F,
optimized for Mac OS, hardware acceleration ("quartz extreme"),
supports webstart 1.2, integrated security ("keychain"), native
accessibility features, applescript, shared system jars, core audio jar (mac
specific). Integrated browser ("safari") with Java plug-in.
- showed very cool video/audio over IP collaboration app from maratech.
- cross-platform coding: dont hardcode modifier keys, use Toolkit.getMenuShortcutKeyMask().
dont use MDI, use seperate JFrames. Use layout managers. Query UIManager,
Toolkit for colors/icons
- "no plans to support Java 3D".
J2SE 1.5 (Tiger) Summer 2004 release
Focus on "ease of development". Java is strong in enterprise (server)
and devices (cell phones), still dont have the desktop. Target smaller "departmental
applications" currently being written in Visual Basic."Got enough
power, now focus on simplicity". "We've been over focused on tools
- we need good clean platform APIs". There will still be new features,
performance, quality emphasis, but all are "under control". Focus
will be on developer productivity, ease of use.
Language Changes
First significant language changes since 1.1 (inner classes). All features
(except metadata) are available
in early access 1.5 compiler: http://developer.java.sun.com/developer/earlyAccess/adding_generics
-
Metadata
Key new language idea, allows decoration of classes/methods/field. Allows
simpler declarative programming, Will be used to simplify J2EE APIs
public @debug mymethod;
We already have "marker" conventions that cause special processing
from tools / runtime libraries, for example:
- get/setProperty javabean conventions.
- EJB naming conventions
- marker interfaces like serializable
- javadoc @param etc
We have already stretched the naming conventions too far. Metadata will
now be part of the Java language. A kind of declarative programming. "Eliminate
boilerplate"
- Annotations are a special kind of modifier, values are compile time
constants.
- Annotations are allowed on classes, members, even parameters and local
variables
- Annotations can contain named constant parameter values
@Secure
@Copyright(name = "Blake Stone")
public class BankAccount {
@NeedsTesting
@Security(level = 12)
public float getBalance() {
// etc.
}
}
- Annotations have no effect on the behavior of a class
- Annotations are visible only through new reflection API
- Annotations defined through an @interface:
public @interface Copyright {
String name();
}
- Annotation processors will be like "plug-ins" to the build
tools
- not allowed to modify the bytecodes of annotated class!!!
- can create auxiliary classes, deployment files, etc.
-
Generics
Modifies the type system - mostly transparent. Allows compiler to type
check, eliminate explicit type casts. Not templates, no code blowup.
ArrayList<String> // list of strings
add(Object) becomes add(String)
get(int) returns String values
toArray() returns a String[]
how to declare:
class Container<T> {
private T value;
public void set(T value) { this.value = value; }
public T get() { return value; }
}
some complications around "Variance" TBD
-
Collection Iterators "foreach"
expand meaning of "for" : (read ":" as "in" )
for (String s : c) { process (s); }
combine with generics:
void cancelAll(Collection<TimerTask> c) {
for (TimerTask task : c)
task.cancel();
}
works with arrays:
int sum(int[] a) {
int result = 0;
for (int e : a)
result += e;
return result;
}
-
Enumerated types
public enum Coin { head, tails }
equivilent to type-safe enum in Bloch's book, but compiler does the boilerplate
for you. can be used in switch statement. enum is now a keyword.
-
Autoboxing of primitives.
Integer x = 3; // x = new Integer(3);
int y = x; // y = x.value();
-
Varargs
Variable length arguments, needed for printf formating
public static String format(String pattern, Object... arguments), Object...
same as Object[], compiler gathers up arguments into an array.
allow C/C++ format string, fullly type safe at runtime.
out.printf(“%.4s %5d\n”, user,total);
-
Static import
import static org.iso.Physics.*;
Imports the static members from a class, rather than the classes from a package.
Can now use:
x = cos(PI * theta);
x = Math.cos(Math.PI * theta); // old way
Other features
- reduced footprint, faster startup
- adaptive self tuning eg GC
- JVM Monitoring and Management API (JSR-174) : SNMP based, JMX
- new Profiling API
- Direct support for OpenGL
- XAWT : X server AWT
- XML 1.1, SAX 2.0.1, DOM level 3, Namespaces, XML Schema
- Unicode 3.1: char stays at 16 bits, "extended chars" in 32 bits,
libraries will support.
- Standard API for calling javac compiler from code.
- Concurrency Utility Library (JSR-166) Doug Lea's work.
- Synth skinnable L&F
- Better integration on Linux/GNOME
- Java2D: OpenGL support; Increased use of HW acceleration
- Unicode 4.0 support
- Deployment
- Coalescing of Java Plug-in/Java Web Start
- Java Control Panel enhancements
- Java Web Start desktop integration enhancements
- Java PACK for applets/applications (JSR 200)
Component JSRs:
- 003 JMX™ Management API
- 013 Decimal Arithmetic
- 014 Generic Types
- 028 SASL
- 114 JDBC™ API Rowsets
- 133 New Memory Model
- 163 Profiling API
- 166 Concurrency Utilities
- 174 JVM™ Software Monitoring and Mgmt
- 175 Metadata
- 199 Compiler APIs
- 200 Pack Transfer Format
- 201 Four Language Updates
- 204 Unicode Surrogates
- 206 JAXP 1.3
J2EE
J2EE is a $2.1 Billion market in 2001. 31 Commercial Licensees (Spring 2003).
Main value vs .NET is portability
J2EE 1.4 Release
- J2EE 1.4 will have:
- JAX-RPC 1.1 (JSR-101)
- Implements WS-I Basic Profile 1.0
- SOAP and WSDL based interoperability
- Implements WSDL to Java mapping
- Servlet based endpoint
- Stateless session bean endpoint
- SAAJ 1.1
- Web Services (JSR-109) : Deployment descriptors
- Management (JSR-77)
- Deployment (JSR-88)
- Connectors 1.5
- Synchronous & asynchronous integration with EIS
- Bi-directional resource adapter
- JMS pluggability
- MDB invocation
- JMX 1.1
- JMS 1.1
- JTA 1.0
- Servlet 2.4
- JSP 2.0
- Simple Expression Language (EL)
- Simple Tag Extensions and Handlers
- Tag Files
- DD and TLD using XML Schema
- JSP Fragments and JSP Configuration
- JSTL 1.0
- Supports Expression Language
- Core, XML, SQL and Internationalization Tags
- EJB 2.1
- Web Service Endpoints
- Message Driven Bean generalization
- Corresponding support in Connectors 1.5
- EJB QL Enhancements
- Timer Service
- EJB 2.x has fixed EJB 1.0 problems
- EJB 3.0 will be made easy-to-develop for everyone
- JAXR 1.0 (JSR-93) : Implements UDDI Registry protocol
- JACC (JSR-115) Java Authorization Contract for Containers
- JAXP 1.2
- JavaMail 1.3
- JAF 1.0
J2EE 1.5
Focus on ease of development, esp using metadata.
- would like to create an EJ with, eg:
private @createEJB Foo myFoo;
- Use metadata to embed information into source so that deployment descriptors
can be automatically generated.
- JAX-RPC 2.0
- Proposed extension to JAX-RPC (JSR 224)
- will be the "center of web services" in Java.Will use SOAP 1.2,
WSDL 1.2, WS-I, JAXB integration.
- Major focus on Ease-of-Development, to simplify the most common development
scenarios for Web Services clients and servers.
- Build on J2SE Metadata facility (JSR 175)
- Align with JSR 181 (Metadata in WS)
- WSDL to Java binding migrates to JAXB 2.0
- Improvements in handler processing framework
- Choice of handler models
- Improve the declarative model for handlers
- EJB 3.0:
- Proposed extension to EJB (JSR 224)
- Focus on Ease-of-Development
- Define metadata attributes to annotate EJBs, so single Java class can
define an EJB.
- Target to simplify/eliminate EJB deploymen descriptors for developers
- Automatic generation of component and home interfaces
- Programmatic defaults for the common, expected behaviors of EJB container
- Introduce simplified EJB component that more closely resembles a plain
Java class.
- JAXB 2.0
- Proposed extension to JAXB (JSR 222)
- Full W3C XML Schema support
- allow partial mappings to extract selected fields from XML into Java
object.
- Will implement WSDL to JavaTM databinding for JAX-RPC 2.0
- Bi-directional XML Schema to Java mapping: Java to XML Schema mapping
will be added
- Ease-of-Development feature: Use of annotations and metadata in bindings
- JDBC 4.0
- Proposed extension to JDBC (JSR 221)
- Focus on Ease-of-Development
- Management of JDBC Drivers: provide utility classes to improve the
JDBC driver registration and unload mechanisms
- Standard set of tags to manipulate and manage active connections, using
metadata and annotations
- Align various persistence and update mechanisms
- remains focused on SQL processing. Java Data Objects (JDO), contained
managed persistence map into higher level abstrations like objects.
- Support of JDBC RowSet data model
- PHP Scripting and J2EE
- Will enable the development of portable Java classes that can be invoked
from a page written in an scripting language (JSR 223), including details
on security, resources and class loader contexts
- Will work with PHP, ECMAScript, others...
- Ease-of-Development features in a Servler container:
- Package scripting pages and Java classes, into a single WAR file
Misc
- Java Server Faces is JSP GUI toolkit to allow VB type GUI development.
- BluePrints team provides best practice guidelines and recommendations on
the use of various J2EE technologies : http://java.sun.com/blueprints
Scripting Language Support
JSR 223 will specify how scripting languages are used in web tier (J2EE apps),
how they interact with War / ear files. PHP will be key focus, refrence implementation
will use Tomcat and PHP. "Java is upgrade path from PHP". Others include
VBScript, Javascipt, perl, JPython.
Web Services Developer Pack (WSDP)
WSDP 1.2 shipped. based on Tomcat 4.1
- JAX-RPC, JAXP,JAXM, JAXR
- WS-I
- JAXB 1.01
- Java Server Faces EA4
Concurrency Utilities
This is Doug Lea's work refactored through JSR 166. java.util.concurrent.
"The java.util.concurrent package aims to do for concurrency what java.util.
collections did for data structures." Looks to me like you will want to
replace your multithreading code with these classes..
- Executor - standard interface for asynch invocation; cancellation and shutdown
support. use anExecutor.execute(aRunnable) instead of new Thread(aRunnable).start().
New interface Callable like Runnable but returns an
Object. Future holds result of asynchronous call. Use via Executors
utility class.
- Queue interface added to java.util. Fast thread-safe non-blocking
java.util.concurrent.LinkedQueue. BlockingQueue extends Queue,
common in producer-consumer designs, implementation is high throughput, concurrent
access.
- TimeUnit class provides high resolution timing support static
long nanoTime().
- Lock class replaces synchronized: more flexible but more
verbose. uses low level hardware instructions for fast, scalable locking,
doesnt use Java locks.. allow interrupts, allow lock/unlock in different places,
allow "try lock".
- ReadWriteLock provides a pair of locks for enforcing multiple-reader,
single-writer access. Concrete class ReentrantReadWriteLock usually
the best choice for apps.
- Condition is an abstraction of wait-and-notify, for classic concurrency
patterns.
- Synchronizers: common special-purpose synchronization problems: Semaphore,
FifoSemaphore, CountDownLatch, CyclicBarrier, Exchanger.
- Atomics: Essential for writing efficient code on MPs. Nonblocking data structures,
optimistic algorithms, reducing overhead and contention when updates center
on a single field. JVM implementation will use best construct available on
platform, eg: Compare-and-swap, Load-linked/StoreConditional, Locks.
- Concurrent Collection implementations: ConcurrentHashMap, CopyOnWriteArrayList.
- Improvements to existing thread-safe collections in part based on JSR-133
Memory Model rules
Desktop
Desktop Initiative
Desktop Java is booming. It’s a strategic priority for Sun."The
market is shifting: Desktop Java technology is the right answer for an increasing
number of development problems. Sun is betting on this trend and is committed
to leading development of the Java desktop platform."
- JRE downloads surging: now about 3 million per month
- New Sun business unit coordinating all desktop activities
- J2SE Distribution: get J2SE on every PC, auto-update
- End User Website : java.com : Marketplace
and directory for desktop/mobile applications; end-user support
- Developer Community : javadesktop.org
: find and create open source projects that build on the J2SE platform; discuss
desktop client issues, applications and technologies; technical articles,
client news, blogs and cool stuff to try; part of the new java.net; Sun is
funding, sun engineers will be involved
- Desktop Java Initiative/Platform Enhancements
- There will be further development on existing optional packages (JMF,
JavaHelp,...)
- New packages developed mostly as open source projects on javadesktop.org
- New add-on packages
- Desktop integration: Browser embedding; Automate file viewers,
mailer, browser; native installation mechanisms
- Java Desktop Network Components
• Highlevel, data-aware, easy to use components
• Configured through XML
• Usable as applets and in Swing application
- StarOffice Java SDK 6.1 (Fall 2003
- Now: Rich content view/edit beans for embedding in Java applications;
Automate StarOffice from Java (e.g., document transcoding)
- Planned: Automate office tasks using Java as macro language; Java based
calendaring client Glow
- OpenGL binding
- Mozilla web browser
- Mail/Calendar client
- GNOME desktop
- Sun Ray (rich clients on thin devices)
- Project Mad Hatter: Forthcoming Solaris /Linux Desktop (Fall 2003)
Swing Tips
- Using javax.swing.Timer is the preferred method of animation in
Swing
- Notifications come on the event thread; Don't need to worry about Swing
threading issues
- Two ways to use Timers for animation:
– Animation driven by Timer ticks (easy)
– Animation driven by time (better)
//Each Timer Tick is a New Frame
int currentFrame = 0;
ActionListener listener = new ActionListener() {
public void actionPerformed(ActionEvent ae) {
// increment frame
currentFrame++;
// repaint component
animComponent.repaint();
}
}
Timer timer = new Timer(1000, listener);
timer.start();
// Current Frame is Calculated Based on Time
int currentFrame = 0;
long start = System.currentTimeMillis();
ActionListener listener = new ActionListener() {
public void actionPerformed(ActionEvent ae) {
// figure out current frame from elapsed time
long elapsed = System.currentTimeMillis() - start;
currentFrame = elapsed / 1000;
animComponent.repaint();
}
}
Timer timer = new Timer(500, listener);
timer.start();
- Graphics Object
- can always be cast Graphics2D g2d = (Graphics2D)g;
- if you change, must save state and restore or create copy and dispose
- Scaling images:
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
int w = getWidth();
int h = getHeight();
g2d.setRenderingHint(
RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
// or VALUE_INTERPOLATION_NEAREST_NEIGHBOR
g2d.drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2,obs);
}
- Use translucency for Presenting multiple layers of information
- java.awt.AlphaComposite class: Interesting mode is “SRC_OVER”
- No hardware Acceleration (coming soon)
- Hickey’s article on custom painting: http://java.sun.com/products/jfc/tsc/articles/swing2d
Synth Skinnable L&F
- Finer granularity of properties than UIDefaults offers
- Delegate all painting
- Create new look and feel without writing code
- Swing's GTK+ Look and Feel extends Synth
XAWT (Tiger) for Linus and Solaris
- AWT on X11 is built on top of Motif (an obsolete toolkit with lots of problems)
: Motif is responsible for many AWT bugs
- Improve performance of lightweight toolkits built on top of AWT (Swing)
- Remove native code from the peers and rewrite with object-oriented Java
code
- Use the latest Java programming languag features: Collection classes, assertions,
logging
- Redesign will get rid of Motif and Xt, still use Xlib, DGA/OpenGL
- "We cannot change anything that breaks existing apps!"
- “Mediumweight” approach uses an X-Window, but components are
rendered in Java language
- currently have 40K lines of native code : get rid of all but about 1K
- Problem: We need to access Xlib native structures
- JDK™ 1.4 introduced an internal mechanism to access native memory
from Java™ code
- Used under the hood for NIO implementation
- Provides convenience methods for accessing data of different types
- Highly efficient, Hotspot inlines machine code to handle read/write
operations
- Allocate memory in the native heap using Native accessor class
- Use JNI stubs to call Xlib, passing in native memory: still use JNI
but only to call Xlib
- Extract results from native memory using Native accessor class
- Xlib wrapper classes generated automatically for a particular platform at
JDK™ build time
- Package Private Problem: Peers in sun.awt.X11 need to access java.awt package
private fields
- In the old AWT we use JNI, which allows you to modify private fields
without checks (this drove licensees crazy!
- Solution: Use reflection; access is slower but done rarely
- ComponentAccessor: a class that provides access to Component
private fields from Peer
- Widgets are rendered using Java™ 2D, take advantage of Java™
2D acceleration
- AWT Components are rendered to look like Motif, forbackward
compatibility
- If you want GTK Look and Feel, use Swing
- Java2D provides better Font rendering compared to X11 (especially on
Linux)
- FileDialog has been re-implemented on XAWT
- Performance is better than Motif-based AWT
- No more problems with variation in appearance AWT and Swing fonts
- No more X11 “Font not found” warnings!
- XAWT will support XDnD and Motif DnD; XDnD works with more GUI toolkits,
interops with Mozilla, OpenOffice, Motif, etc.
- EmbeddedFrame is the container for AWT within browser: now uses an X window
instead of a Xt/Motif widget, solves problem of Widget reparenting that caused
a lot of problems before
- AWT speedup 2x - 9x. remote display 3-8x better on text components. Swing
performance only increases 2 - 8 %
- will be deafult for Linux, need to turn on for Solaris
Advanced OpenGL for Java : Jogl
- "real-time 3D", focus on game development
- curent OpenGL bindings available:
- OpenGL for Java Technology (abbreviated “gl4java”) open
source, OpenGL 1.3, complex API
- LWJGL (Lightweight Java™ Game Library) open source, OpenGL 1.4,
destroys type safety
- Magician, good API, not open source, defunct
- Jungle
- Supports OpenGL 1.4 and vendor extensions
- Integrates with AWT and Swing
- Designed for New I/O
- Clean, minimalist API
- Supports composable pipeline (e.g., DebugGL)
- Open source
- Written almost entirely in Java programming language
- AWT Native Interface, WGL and GLX bound into Java programming language
using GlueGen
- GlueGen
- Parses C header files using ANTLR
- Generates intermediate representation expressing primitive types, function
prototypes,
structs, unions and function pointers
- Autogenerates Java programming language and JNI code
- Powerful enough to bind AWT Native Interface back into Java programming
language
- Enabled Jungle to be written in Java programming language instead of
C
- Open source; part of Jungle package
- Jungle
- Working in collaboration with Java Gaming Initiative
- Has been adopted as JGI’s OpenGL binding
- Now named “Jogl”
- Open source (modified BSD license)
- Available from http://jogl.dev.java.net/
- Summary
- All leading-edge 3D graphics effects going forward will be achieved
with hardware programmability
- OpenGL provides vendor-neutral, platformindependent access to the hardware
- Java™ programming language and Jungle OpenGL interface provide
easy-to-use, portable and powerful development environment
Java Server Faces (JSF)
Server side user interface component framework It appears that this will become
the main focus of Web UI frameworks in Java. Presenter (Craig McClanahan) was
the main developer of Struts, claims JSF will become the standard API for web-based
UI components, and that JSF will be more powerful and will supercede Struts
within 6-12 months. Announced tool support from Oracle, Borland, as well as
Sun's "Project Rave". can be used with/without JSP, with/without HTML.Allows
business/presentation logic to be decoupled from output format.
- Extensible UI component model
- Flexible rendering model
- Event handling model
- Validation framework
- Basic page navigation support
- Internationalization
- Accessibility
- Standard server side UI components: command, form, graphic, input, output,
panel, parameter, select boolean, select many, select one.
- "value reference expression" creates symbolic link to JavaBean
property
- event model following JavaBeans: Action, ValueChanged events.
- Custom components: write output converter (object to string) and input converter
(string to object), and a validator.
- Navigation handler - can plug your own NavigationHandler
- Rendering model: adapt components to a specific markup language.RenderKit
- linbrary of renderers. Reference implementation comes standard with BasicHTMLRendererKit.
- EA4 available now in WSDP 1.2, not production quality yet. Final 1.0 in
4Q.
- templates (common L&F) not until JSF 2.0
Another session presented JSF in conjuction with Scaleable Vector Graphics
(SVG).
Project Rave is a new Sun web development tool using JSF.
IO
NIO
- 1.5 will allow SSL sockets with NIO
- maybe BigMapBuffer (allow memory mapped files > 2 GB)
- JSR 203 (son of NIO) eg asynch I/O not in 1.5, have to wait for 1.6
- use direct buffers for "large and long-lived" situations.
Writing a Scaleable Server with NIO
- its hard to measure server performance; two useful microbenchmarks:
- 1. requests/sec (1 KB files), use httperf
- 2. simultaneous, slow clients (56 KB/sec) 1 MB files, use http_load
- test NIO server against 2 real servers; thttpd (single threaded, fast),
and apache 2.0.42
- showed various combinations of blocking/non blocking, single/multi/pooled
threads. Non-blocking 4 threads compared well with other servers, but server
memory use much higher
- for these kinds of servers, must set OS params like connection table, file
handle limit
- found some bugs, performance problems in NIO; fixed in 1.4.2
Advanced Network IO
2 levels of abstraction in java.net: High level: URLs; Low level: Sockets
- HTTP Handler : keep alive
- Tries to use keep-alive where possible
- System property (boolean): http.keepAlive
- Response from server can determine details of connection re-use
- Disconnect() method prevents reuse
- Application MUST call close() on stream
- HTTP Handler: Redirection
- Default policy set with setFollowRedirects()
- Per instance policy set with setInstanceFollowRedirects()
- Redirection between http and https never automatic
- POST can be converted to GET: http.strictPostRedirect
- HTTP Authentication
- Client to origin server, or proxy (or both)
- Supported schemes:
- Basic (older, not secure)
- Digest (most secure)
- NTLM (since 1.4.2, on Windows only)
- Supported protocols: http and https
- java.net.Authenticator abstract class: Needs to be subclassed
public class myAuth extends Authenticator {
PasswordAuthentication pw;
public PasswordAuthentication getPasswordAuthentication () {
// interact with user to get user, pass
pw = new PasswordAuthentication(user, pass.toCharArray());
return pw;
}
}
// In the application
Authenticator auth = new MyAuth();
Authenticator.setDefault(auth);
- FTP : the Forgotten Protocol
- J2SE™ 1.5 Specification Goals
- HttpURLConnection improvements
- Faster implementation (handler)
- Read and connect timeouts
- Cookie management
- Proxy management
- Pipelined requests
- Support for streaming
- IPv6 improvements
- Windows XP SP1 and Windows 2003 support
- Hides the 2 separate stacks
- Transparent and automatic
- Every Java™ application is already IPv6 ready
- Some QoS options
Combining Jini/Jxta
- Jini Technology Benefits
• Event-driven distribution model
• Plug-and-work
• Code mobility
• Protocol independence
• Reliable service infrastructure
• Object-oriented approach
• Support for distributed transactions
- Jini Limitations
• Planned for local networks
• Restricted by network boundaries
• Problems on Internet (firewalls, unicast discovery, latency …)
- Project JXTA Benefits
• Solves many Internet communication problems:
– Virtual addressing
– Solution to NAT, DHCP, firewall issues
– WAN discovery
– Publishing services over the wide network
– P2P service implementation
• Does not provide the same Jini benefits…
• It is a great communication infrastructure at the TCP/IP level
- Combining Jini + Project JXTA Goals:
- Export Jini services outside the local network
- Finding and connecting to internet located Jini services
– Higher availability of services
– Maintain protocol independence
- Strategies:
– JXTA Pipes: Internet friendly solution for Jini Proxy/Server communication
– JXTA Rendezvous Peer: large scale solution for Internet lookup
of Jini Services
- Solution 1: Proxy JXTA
- Jini Proxy/Server communication implemented using JXTA Pipes:
- Proxy/Server communication across firewalls and network boundaries
- Service registration requires an external Jini LUS (Lookup Service)
- Higher startup time for Jini Proxy (registering into JXTA network)
- Large download for Jini Proxy (JXTA classes)
- Partial solution: still depends on unicast
- Solution 2: Internet Lookup: How to solve large scale lookup on Internet?
- Possible approaches:
– JXTA/Jini Client: Client searching JXTA network to locate Jini
LUS
– JXTA-Jini Bridge Service: Jini client accessing Jini services
that performs JXTA discovery
– JXTA enabled Lookup Service: Jini LUS searching other LUS through
JXTA network
- Desired goals:
– Transparency for Jini Client
– Simplicity for Jini Proxy
- JXTA Enabled Lookup Service
• Preserves Jini semantics
• How it works:
– Jini Client accesses Jini LUS (as usual)
– Client side LUS queries JXTA network for the service
– Service side LUS is responsible for advertising his services to
the JXTA network
– Both LUS collaborate to send Jini Proxy to the client
– Jini Proxy uses JXTA pipes for service communication
- Jini Over Internet
• Edge Computing: Jini services distribution across Internet
• Grid Computing: Large distributed computers interconnected through
Internet
• Ubiquitous Computing: embedded devices implementing Jini services
• Internet JavaSpaces: exporting JavaSpaces into Internet (David Gelernter’s
“Mirror Worlds”)
- Project nWhere Open-source project for Jini/JXTA integration
• Current status:
– Solution 1—basic implementation: implementing a framework to
ease JXTA usage
– Solution 2—more complex: Needs changes on LUS
• Future work:
– Leasing and transaction support
– Security model (Davis and Membership Service)
– JavaSpaces
• nwhere.jini.org
Deployment
Install-on-demand & auto-update
- Compression: 1.4.2 JRE 25% smaller
- Java Pack API in Tiger
- Pack200 is hyper-compression technology to significantly reduce the
size of jar file (JSR 200)
- JRE broken into core and optional pieces
- web installer better for 1.4.2
- Web Bundle: useto minimize download
- Full Bundle: single executable when high bandwidth
- win32 JRE down to 6.4Mb
- Incremental update of JRE: eg only need 1.4.2_01 patch is 1.4.2 base already
present
- Auto-update:Delivers J2RE updates to end users regularly and automatically,
like Windows update
- configured using plug-in control panel
Java Webstart & Java Plug-in
- Unify common features of Java Web Start and Java Plug-in:
- Configuration
- Java Control Panel
- Security and certificate handling
- Networking, proxy, and cookie handling
- Tracing, logging, and console
- Resources and user interface
- Java Control Panel is the user interface for modifying Java preferences
- User preferences in unified configuration
- Management tools for: Certificates, Cache, JREs
- Administrator can provide system or enterprise configuration
- Customizable security settings:
- Sandbox security permissions
- Security permissions ceiling
- System level accepted, denied certificates
- Information shown on the dialogs
- Set of certificates the user may accept
- Enable/disable enhanced sandbox using the JNLP APIs
- Plug-in xupports HTTP compression, JarDiff
- Auto download for Netscape 6+ and Mozilla browsers using XPI installer
- Webstart new features
- associate extension with mime-type in JNLP <association extension=”ext”
mime-types=”mimeType” />
- JNLP tag "related content"
- shortcuts supported on GNOME, Windows
- Import JNLP component into JWS cache (user or system)
- Full HTTPS support in J2SE™ 1.4+ versions
- Auto-detect newly installed J2REs on the system during JWS startup
• Win32 support in J2SE™ 1.4.2 version
• Support all platforms in J2SE™ 1.5 version
Webstart Tips
- latest version is (JNLP 1.1, JWS 1.2) with 1.4.1, September 2002
- Real Java apps that run on the client machine
- Launched the first time through a web browser
- Deployed using an “application descriptor”
- Run in a secure sandbox : additional facilities that allow doing useful
things in a secure way
- Updates automatically fetched when available
- What applets should have been
- Most JNLP apps are clients that need to use network-based services
- The Weakness of Web Applications: for all its advantages, the web is not
a very good application development platform
- Constant client/server interaction introduces delays, makes web apps
feel slow and clunky to use
- You need easy installation and deployment to draw customers to try
your app
- Often you need responsiveness and richness to keep them happy
- The Sweet Spot: Intranets, or semi-controlled deployment environments
- If you had complete control, you could just deploy a Java app
- For the general public, you’re still probably better off with
a web app
- JNLP Configuration Tips
- Supply Icons and Descriptions
- Use Lazy downloading:
<resources>
<j2se version="1.2+"/>
<jar href="tnt.jar" version="1.2" main="true"/>
<jar href="sound.jar" part="sound" download="lazy"/>
<package name="com.foo.sound.*" recursive="true" part="sound"/>
</resources>
<resources os="SunOS">
<nativelib href="native-sound.so" part="sound" download="lazy"/>
</resources>
- Consider Multiple JNLP Files
- Always Allow Offline Operation : <offline-allowed/>
- Try to Get by Without Privileges
- JNLP Developers Pack: http://java.sun.com/products/javawebstart/download-jnlp.html
- Programming Tips
- Write JNLP applications that can also run as standalone applications
- Saving Data on the Client: You need client-side persistence: javax.jnlp.PersistenceService
• To begin, you don’t know whether you’ve eve rrun on
this client before
• If the persistent store already exists, you want to open and read
it, and possibly update it
• Otherwise, you want to create it
- javax.jnlp.BasicService public boolean isOffline() is unreliable. might
need to do it yourself (eg with a ping)
- Unit Test
- call public static void setServiceManagerStub (ServiceManagerStub
stub) supplying your own stub; It supplies all service objects
for ServiceManager
- Use the tools at www.mockobjects.com
to build test versions of the services
- Also check out the Apollo JNLP testing toolkit: http://luxor-xul.sourceforge.net/apollo/
- Packaging and Deployment Tips
- Package as a Web App
- Most JNLP applications are clients that use some service. It helps
to package the client with the server: Less to go wrong. easy way
for client to find the server
- JNLP makes it tricky to move a JNLP app from one server to another:
The JNLP file contains absolute URLs!
- Use the JNLPDownloadServlet : Provides additional server-side support
for the JNLP download protocol. Substitutes variables in JNLP files, supprts
JAR version, JarDiff.
<jnlp spec="1.0+" href="$$context$$name" codebase="$$codebase">
- JNLP Download Servlet Hazards
- Don’t forget the JAR versioning is going on: you may waste
time debugging things that are already fixed, consider disabling JAR
versioning during development
- Versioning your own JARs requires solid build management
- Runs afoul of bugs in some servlet engines. BEA provides a modified
servlet for some Weblogic versions
- Package the JRE with your web application: Include a link and instructions
on launch page
- Beware of HTTP Proxies
- Java Web Start tries to learn proxy settings from the web browser,
but it doesn’t always work
- Test a lot
– Different browsers (and major versions)
– Different operating systems
– From home
– Visit sites that connect via VPN software
– Any other variables likely in your environment
- Provide troubleshooting instructions
- Plan for somebody to support users during initial deployment phase
- Other JNLP Clients
- Useful Links
Applets
Web Services
Fast Web Services
- Goal: Cut overhead of XML processing
- Take advantage of Java Web Services stack
- Fast implementation in stack
- Stack will hide the details
- Performance Data
- loopback latency JAX-RPC 25 ms, RMI 2.5 ms
- message size JAX-RPC 5200 bytes, RMI 500 bytes
- Use Cases
- Web Services within the enterprise
- Time- and resource-sensitive systems
- Mobile phones
- Satellites
- High-performance computing
- Grid computing
- Scientific computing
- Three Layers of Opportunity
- Transport layer : compression Unit: bytes
- XML information set layer: binary XML representation
- Unit: DOM, SAX or Pull API
- Schema binding layer: binary data representation
- Unit: programmatic types
- "Fast infoset" 2x faster
- "Fast schema" 5–10x faster: JAX-RPC can get latency down
to 3 ms, size down to ~500 bytes.
- Abstract Syntax Notation One (ASN.1)
- Schema language for abstract type system
- Royalty-free set of standards at ITU-T/ISO
- In development for nearly 20 years
- Implementations in Java, C and C++ programming languages
- Extensively used in telecom industry
- standards activity at ITU-T/ISO:“ASN.1 Support for SOAP, Web Services
and the XML Information Set”
- Fast SOAP Binding
- Fast SOAP is a different protocol to SOAP, has different MIME type
- Dynamic negotiation
- No modification to WSDL
- cannot support schema drift
REST vs Web Services Architecture
There has been a lot of online debate concerning two ideas of how to do web
services. REST (representational state transfer) is based on Roy Fielding's
PhD thesis that essentially models the way HTTP was used in the early days of
the web, which is arguably responsible for the web's success. In REST, all services
are available only though a URI. There are many nouns (URIs) but only 4 verbs:
GET, PUT, POST, and DELETE. Clients only know the data representation of the
service, and clients manage their own sessions. All services are stateless,
all messages are self descriptive. So a web service is just the exchange of
XML documents using HTTP verbs: "document-centric". The simplicity
of the verbs makes interoperability easier. Down side: client must manage state,
so pushes complexity onto the client.
In contrast, the current Web Services Architecture (aka GXA) developed by Microsoft
and IBM, uses SOAP, WSDL, and UDDI. There is a SOAP message definition for every
service end point, and WSDL defines a collection of end points. UDDI is used
for finding services. WSA is trying to add a lot more functionality such as
security, authentication, and transactional processing. Its essentially trying
to enable RPC across the firewall. Currently WSA has center stage. Down side:
tight coupling between client and server : when the WSDL changes, you have to
synchronize software updates (think RPC). The alternative is dynamic code generation
and binding, which is still developing. May not scale to services with large
number of endpoints.
So REST is simpler data-centric, better for simple services. WSA provides a
framework for more capabilities like security, at the cost of more complexity,
loss of scaleability, difficulty in upgrading to new versions.
Orchestration
Web Services can be thought of as a "way to exploit port 80", ie
circumvent firewalls.
Working definitions:
- Coreography
- Collaboration
- Orchestration
Theoretical frameworks:
- pi-calculus (milner) "calculus of mobile proceses",
model of concurrent computation. named, typed channels. interacting named
agents, dynamic configuration of channels.
- Petri Nets model concurrent processes, graph of places
an transitions.
- State Machines: eg UML Activity diagram
In WSDL, services are unordered message exchanges. No coreography, no collaboration,
no orchestration. Too simple, everyone wants to fix.
- Web Services Flow Language
– XML language for description of Web Services orchestration
– Designed to fit naturally into the Web Services stack
• Layered on top of WSDL
- BPEL4WS
– Business Process Execution Language (WSFL + XLANG)
– Business processes and interactions
Grid Computing
- Open source technologies:
– Sun™ Grid Engine
– Condor
– Portable Batch Scheduling (PBS) system
- The Globus Toolkit
- Globus Toolkit defacto middleware standard (100+ man years work)
- Limited services using non-standard protocols
- Deployment in ‘production research’ grids
- Provides protocols to support three services:
– Job Submission and Monitoring (~HTTPS)
– Monitoring and Discovery Service (~LDAP)
– Data Transfer (~FTP)
- Infrastructure to federate distributed resources
– Support for access control
– Wide area security mechanisms (PKI)
- Current status of the Java CoG
- Open Grid Services Architecture (OGSA)
- Utilise standard Web services infrastructures XML, SOAP, WSDL, UDDI
- Building on current Globus Toolkit:
– Grid service: semantics for service interactions
– Management of transient instances (and state)
– Factory, Registry, Discovery, other services
– Reliable and secure transport
- Multiple hosting targets: J2EE, .NET, “C”, …
- Service orientated architecture enables resource virtualization
- Open Grid Services Infrastructure (OGSI)
- Global Grid Forum
– Grid Standards Organisation, mdelled on the IETF
– Mixture of Research and Working Groups
– Further details www.gridforum.org
- OGSI Specification (v1.0) Just completed 60 day comment period
More Grid Computing
- Three types:
- Compute grid
- Data grid
- Access grid
- Grid Concepts
• Resource Virtualization
• Job Submission
• Shared Data
- Open Grid Services Architecture (OGSA-WG)
- Aspires to be THE grid standard
- Defines Grids via Grid Services
- Open Grid Services Infrastructure (OGSI-WG)
- Grid Service Specification (GSS)
• Defines Grid Services
• Based on Web Services
- Globus Toolkit 3
• First implementation of OGSA
• Toolkit services are grid services
• Written in Java™ language
• 4 Java™ hosting environments
- J2SE platform—embedded and standalone
- EJB architecture
- Servlet
- Sun ONE Grid Engine (SGE)
• Open source compute grid product
- Avaki Data Grid (J2EE)
- Why Do Compute Grids Need Java™ Technology?
• Grids are heterogeneous
- Apps should be platform independent
• Grids can be very distributed
- Network-centric platform
- Code mobility
• Grids must be secure
- Bytecode verification, JCE, JSSE, etc.
- Java™ 2 Platform, Enterprise
Edition (J2EE™) Platform
• Globus Toolkit 3
- OGSA
- Expose servlet and EJB architecture as grid services
• Based on JAX-RPC
- Similar to JSR 109
• CORBA interfaces
- Java™ 2 Platform, Standard
Edition (J2SE™) Platform
• Globus Toolkit 3
• Globus Java Commodity Grid Kit (Java CoG)
• JNI
- Ugly and painful
• Other APIs
- JGrid Java interface to Sun ONE Grid Engine
Performance
Platform Performance
- Set performance goals
- Create benchmarks for your own code, run them regularly, track your progress
- Beware of “synthetic” and “micro”benchmarks
- Default JVM settings are for fast startup and small footprint; J2SE 1.5
will do adaptive tuning of the JVM.
- GC option: -XX:+AggressiveHeap
- Inspects system resources
- Sets various parameters to be optimal for long-running, memory allocation
intensive jobs
- Size of initial heap based on system memory
- Automatically sizes generations
- Turns on throughput collector
- "Scaling" models (mostly for J2EE)
- Vertical Scaling—running a single instance of an application (JVM™
software) across many processors. Eg database. Best for raw throughput.
Difficult to scale, but concurrent GC will help.
- Horizontal Scaling—running multiple instances of an application
(JVM™ software), each instance executing on their own physical machine
or blade. Eg web server. Best latency, but load balancing may be complex.
- Hybrid Scaling—running multiple instances of an application (JVM™
software) on one or more multi-processor machine. Eg application server.
Best of both worlds, but increased complexity.
- "Sun is commited to provide top-notch JVM™ software implementations
for Intel-based platforms (especially Solaris x86 and Linux)". J2SE™
1.4.2 specification contains several key performance enhancements for
these platforms
- see ~java/docs/performance
"Smart Tuning for HotSpot" recently unpdated for 1.4.2
Benchmarking
- HotSpot with default settings does badly on microbenchmarks; also changes
in HotSpot make benchmarks obsolete
- Careful:
- GC usage use -verbose:GC to see what GC is doing
- warm up the code: -XX:+PrintCompilation to check JIT
- datasets should not blow out cache unless app does
- dont do self-calibrating benchmarks
- Use statistics to increase confidence in your conclusions : high variability
implies mean may be misleading.
- Profiling
- -Xprof, a basic per-thread CPU profiler
- -Xaprof for object allocation statistics
- -Xrunhprof, JVMPI based for profiling cpu, heap and monitor
- For GC, -verbose:gc, -XX:+PrintGCDetails, -XX:+PrintHeapAtGC
- For Hotspot Java™ Virtual Machine (JVM™) compilers, -XX:+PrintCompilation
traces methods as compiled
- For classload, -verbose:class
- Monitoring tools
- jvmstat —always on, very lightweight performance and configuration
instrumentation tools for the HotSpot VM .4.1 and beyond."Visual
GC" http://www.sun.com/developers/coolstuff.
Currently works only with 1.4.1, will have a 1.4.2 version by end of July.
- Borland—Optimize It: www.borland.com/optimizeit
- Borland—Server Trace: www.borland.com/opt_servertrace
- Wily Technology—Introscope: www.wilytech.com/solutions/Introscope4.html
- Quest Software (Sitraka)—JProbe: www.sitraka.com/jprobe/jprobe.shtml
- Quest Software (Sitraka)—Performasure: www.sitraka.com/performasure/performasure.shtml
- OC Systems—Root Cause: www.ocsystems.com/prod_rootcause.html
- Sun—SunONE Studio: Performance Analyzer www.sun.com/software/sundev/solde/features.html
- We need a benchmarking harness
Performance Myths
Cliff Click, HotSpot server compiler architect. Generally these are performance
"tricks", that may have once been useful, but now the JIT compiiler
can do a better job.
- dont use exceptions to detect end of loop, or list traversal
- dont use final everywhere, to allow inlining (happens anyway)
- try/catch blocks do defeat bounds-checking optimization on some compilers,
otherwise free
for( int i=0; i<A.length; i++ ) {
try { sum += A[i]; }
catch( Error e ){}
}
- dont replace virtual calls with run time type check
- synchronization costs 30-50 cycles for uncontested lock/unlock : not free
but not that expensive compared to runtime race conditions.
- dont reuse objects with object pools, unless objects are very big and complex
: GC works
Future:
- Escape analysis: Short lived local objects will be cheaper
- GC – Concurrent, parallel, pause-less
- Locks, concurrency: big improvements in javax.concurrent
Tips from Blake Stone (Borland)
- delayed object creation / processing. "be lazy - avoiding work is a
huge win".
- eliminate redundancy - often UI event processing gets 2 events. need profiling
to detect. event coalescing - always use deferred repainting. combine network
round trips. cache font metrics, etc.
- code reuse: use collections, StringBuffer. HashMap is overkill for a handful
of values.
- watch your heap - GC does not eliminate memory leaks.Full GC scales linearly
with heap size, user perception is exponential. Java VM grinds to a halt when
swapping. dont worry about short lived object, dont need object pools very
often.
- Caches are a pain. memory leaks, out of date data.Only useful when content
requires network IO or extensive disk IO. Check hashcode key distribution,
avoid keys with external object references. Weak references and timestamps
are useful.
- progress requires measurement
Swing/2D Graphics performance
- lazy loading - fast startup
- load just enough to show app; use -verbose to see what classes are getting
loaded
- if you have statics, they load before you can change L&F, so Metal
L&F gets loaded
- to find what is causing loading class X, remove from rt.jar and rerun:
jar xf jre/lib/rt.jar
rm javax/swing/plaf/metal/MetalLookAndFeel.class
java -Xbootclasspath:. Main
- lazy populate JTabbedPane, JMenu, JInternalFrame
- threads - responsive UI
- keep Renderer processing to minimum (see DefaultTableCellRenderer)
- create your own data models
- construct and populate model, then create widget
- Know the differences in image types to enable hardware acceleration : VolatileImage
- APIs for creating Managed Images
- Component.createImage()
- GC.createCompatibleImage()
- Toolkit.getImage()
- Not managed until release 1.5+:
- new BufferedImage()
- ImageIO images
- Additional benefit: regardless of acceleration, createCompatibleImage
will return the most efficient image format for copying to the screen
- Opaque and transparent Managed Image support now, translucent in future
release
public void paint(Graphics g) {
Image img = component.createImage(...);
Graphics gImg = img.getGraphics();
gImg.drawLine(...); // render into image
// Copy image into current Graphics
g.drawImage(img, x, y, null);
// ...
// Draw again
g.drawImage(img, x1, y1, null);
}
The last is where we create an accelerated
version and copy from there if possible;
2nd copy from image without intervening
rendering to image
- - http://javadesktop.org
- http://java.sun.com/blueprints/performance
- http://www.theswingconnection.com
- http://java.sun.com/products/java-media/2D/index.html
Monitoring and Management
JMX Java Management Extension
- monitor bean objects (MBeans) kept in an "MBean Server", read/change
configuration, provide statistics, event notification
- can map existing management protocols like SNMP
- JMX 1.2 in J2EE 1.4 and J2SE 1.5; part of JSR 174: Monitoring and Management
for
the JVM™ machine
- Open MBeans alloes access from non-Java apps
- JMX Remote API (JSR 160) using Service Location protocol (RFC 2608) service:jmx:rmi://host/...,
or JNDI/LDAP, or Jini
- future: use metadata to specify; persistence; reliable events
- http://java.sun.com/products/JavaManagement
Performance Monitoring
Monitoring: observe production application with minimally intrusive tools.
"Visual GC" jvmstat tool, you can get it via: http://www.sun.com/developers/coolstuff.
Currently works only with 1.4.1, will have a 1.4.2 version by end of July.
XML
XML Parsing
- DOM
- Pros:
- Provides detailed APIs to navigate and randomly access the tree
- Provides APIs to manipulate the DOM tree
- Platform and language neutral interface
- Cons:
- Loads entire document into memory; Strains memory resources when
the XML document is large, causing poor performance
- Generic DOM node types not suitable for applications that require
strong typing
- Entire document needs to be parsed at one time, partial parsing
not possible
- Application Requirements:
- Need fine-grained access to XML document
- Need to update or modify XML structure
- Needed for most XSLT processors
- SAX
- Pros
- Efficient, flexible, and lower-level access to the document
- Event-based API with no built-in tree representation
- Reduces the use of resources
- Can parse documents larger than the system memory
- Cons:
- Application needs to implement handlers to receive events; must
explicitly keep track of the current parsing state in the code
- Difficult to program especially when XML document structure is
complex
- Entire document needs to be parsed at one time, partial parsing
not possible
- No navigation support
- Manipulate the XML document not possible
- Application Requirements:
- Document streaming for XML
- Full data retrieval from XML documents
- Entire XML Document filtering
- XML document DTD or XSD validation
- Streaming API for XML (StAX); JSR-173 will have the final draft soon http://www.jcp.org/en/jsr/detail?id=173
- Event based Java pull parsing API for XML
- Supports Java-friendly read-in/write-out streaming
- Pros
- Pull model—application takes control
- Provides two styles of access:
– Cursor-style API providing low-level direct data access for
efficiency
– Iterator-style object API for ease of use and pipelining
- Built-in state management
- Filter stream events while parsing
- Cons
- Backward navigation not possible
- Difficult to manipulate XML document
- Application Requirements
- Satisfies all SAX application requirements
- Need access to in-scope Namespaces
- Need support for multiple XML data sources
- more natural fit to JAX-RPC than SAX
- Same benefits of SAX plus better parsing control, easy forward navigation,
less application code, easily maintainable
JAX-RPC
- Java API for XML-Based RPC
- Key technology for Web Services in the upcoming J2EE™ 1.4 platform
- Easy-to-use programming model, Hides all the plumbing
- SOAP- and WSDL-based interoperability
- Developed as JSR-101 in the Java Community ProcessSM program
- New in JAX-RPC 1.1
- Extensive support for XML Schema when starting from WSDL:
- Nearly all predefined simple types
- Simple types derived by restriction
- List types
- Attributes
- Complex types with simple content
- Wildcards
- WS-I Basic Profile 1.0 support:
- rpc/literal in WSDL
- One-way operations
- Required part of the J2EE 1.4 platform:
- JAX-RPC provides the core web service support in the J2EE™ platform
- Servlet-based service endpoint model
- EJB model for JAX-RPC service endpoints
- J2EE programming model for web service clients
- Deployment and packaging model
- Extended security support
- JAX-RPC Programming Model
- RMI-like conventions for service definition interfaces
- No Remote references allowed
- All objects are passed by copy
- Built-in types:
- All primitive and wrapper types
- String, Date, Calendar, BigInteger, BigDecimal, QName, URI
- Arrays of all supported types
- User classes (JAX-RPC value types):
- JavaBeans™ components with extensions
- User-defined types for which a pluggable serializer is available
- JAX-RPC service endpoint realized as either:
- Servlet-based endpoint
- Stateless session bean
- JSR 109 Deployment Descriptor used to deploy JAX-RPC module to J2EE™
container
- Inside a Web Application
- 1 web application has many servlets
- 1 servlet has 1 WSDL document, many ports
- 1 port has1 implementation class
- JAXRPCServlet gateway for all requests
- Generated code does all the marshalling work
- Web Service Clients
- Clients must conform to the contract for the Web Service (a WSDL document)
- Four different client programming models
- Dynamic Invocation Interface (DII) without WSDL
- DII with WSDL
- Stubs (statically generated from WSDL)
- Dynamic Proxies (on-the-fly stubs)
- Dynamic Invocation Interface
• Gives complete control to client developer
• Drawback is its complexity
• Good for very dynamic applications, discovering and contacting
new services
• Optionally, specify a WSDL and have the DII Call object initialize
itself
- Stubs
• Stubs are generated from WSDL
• All needed value types are generated too!
• Instantiated using a generated service class
• Preconfigured with the correct address and binding information
• Static compilation gives customizability and maximum performance
- Dynamic Proxies
- Essentially, stubs generated on the fly by the JAX-RPC client runtime
- The application provides the interface a dynamic proxy must conform
to
- Simplest programming model
- Tradeoff: performance vs. convenience
- Roadmap for JAX-RPC 2.0
• JSR-224
• Next-generation Web Services API for Java™
• Ease-of-development features
• Java™ WSDL metadata (JSR-175)
• Full alignment and integration with JAXB 2.0
• SOAP 1.2 and WSDL 1.2 support
• Support for asynchrony and transports other than HTTP
UBL
- XML is just a metalanguage
- Tag soup doesn't give you interoperability
- Seamless communication requires shared meaning
- Shared meaning requires semantic standardization across whole industries
- The Universal Business Language
- An XML-based business language standard-in-progress
- Leverages existing EDI and XML B2B
- Non-proprietary and committed to freedom from royalties
- The ebXML Initiative
- A joint 18-month effort, concluding in May 2001, of:
- OASIS (Organization for the Advancement of Structured Information Standards)
- UN/CEFACT (United Nations Centre for Trade Facilitation and Electronic
Business)
- Over 1000 international participants
- Conduct business by exchanging XML messages
- work continues in several venues
- V0.7 released in January 2003; V0.8 expected soon; V1.0 expected by October
2003
Miscellaneous