2006 JavaOne SM Conference | TK 2006 | Java TM Platform Roadmaps The Big Stuff, Today & Tomorrow Graham Hamilton VP & Fellow, Sun Microsystems Bill Shannon Distinguished Engineer, Sun Microsystems
Apr 01, 2015
2006 JavaOneSM Conference | TK 2006 |
JavaTM Platform RoadmapsThe Big Stuff, Today & Tomorrow
Graham Hamilton VP & Fellow, Sun Microsystems
Bill Shannon Distinguished Engineer, Sun Microsystems
2006 JavaOneSM Conference | TK 2006 | 2
Agenda
● JavaTM SE 6 - MustangQualities & features
● JavaTM EE 5Now and How
● FuturesDolphinNew languages
JavaTM ME Platform Advances
• Mobile Service Architecture > Delivering richer features and functionality
• Next generation UI technologies > Expanding the capabilities of the platform
• Converged services > Enabling content to be shared across multiple device types
Mobility General SessionAlan Brenner, VP Client Systems Group, Sun Microsystems2:00-4:00pm in Esplanade 303/305
2006 JavaOneSM Conference | TK 2006 | 4
Agenda
JavaTM SE 6 - Mustang
2006 JavaOneSM Conference | TK 2006 | 5
JavaTM SE Schedule
● JavaTM SE 5.0 “Tiger” shipped fall 2004
● JavaTM SE 6 “Mustang” ships this October
● JavaTM SE 7 “Dolphin” targets second half 2008
● Plus small bugfix updates every 8-16 weeks● But no 5.1 or 6.1
2006 JavaOneSM Conference | TK 2006 | 6
mustang.dev.java.net
● Goal: Become More Open● with both sources & binaries
● Delivers weekly snapshot releases● Snapshot feedback has been great● Allows fast responses to new features & fixes● This is changing our whole approach to betas
● Enables community contributions● From bug fixes to features
● Successful experiment!● Expect even more with Dolphin Party
Argent HotelTu. 8:30 pm
BOF-178W. 10:30pm
2006 JavaOneSM Conference | TK 2006 | 7
Agenda
● JavaTM SE 6 - MustangSystemic properties
New features● JavaTM EE 5● Futures
2006 JavaOneSM Conference | TK 2006 | 8
Compatibility, Stability, Quality
● Improve quality, but keep old programs working!● Single most important focus for team
● Many new compatibility/quality initiatives● continual internal process improvements● weekly binary snapshots at mustang.dev.java.net● “regression challenge” contest● “crack the verifier” contest
● We tend to be paranoid during bug fixing● one person's fix may be another's regression● but we still managed to fix many bugs!
2006 JavaOneSM Conference | TK 2006 | 9
Performance
● Mustang continues to improve Java performance:● on both client and server● upgrades to core JVM execution● GC scaling and parallelism● library tuning● upgrades to Java2D graphics rendering● improvements in startup
2006 JavaOneSM Conference | TK 2006 | 10
0
50
100
150
200
250
1.4.21.5Mustang
JDK Release
Tim
e to
Val
idat
e (m
s)Swing "Gray Rect" (Exposure) Performance
● Time to repaint exposed region in big Swing app. Smaller is better!
2006 JavaOneSM Conference | TK 2006 | 11
SpecJBB from 1.3.1 to 6
J2SE 1.3.1 J2SE 1.4.2 J2SE 5.0 Java SE 60
50
100
150
200
250
300
350
400
Nor
mal
ized
to J
2SE
1.2
.2 P
er-
form
ance
Server benchmark: SPECjbb2000
Source: Sun Microsystems, Inc.
2006 JavaOneSM Conference | TK 2006 | 12
Monitoring & Management
● Monitoring & Management was key value in Tiger
● Mustang adds:● Even more JVM level diagnostics
● e.g. improved OutOfMemoryError handling● JMX upgrades● Improved Solaris DTrace integration● Attach-on-Demand for monitoring● JConsole upgrades
2006 JavaOneSM Conference | TK 2006 | 13
JConsole
2006 JavaOneSM Conference | TK 2006 | 14
Agenda
● JavaTM SE 6 - MustangSystemic properties
New features● JavaTM EE 5● Futures
2006 JavaOneSM Conference | TK 2006 | 15
Scripting
● JSR-223 defines framework for scripting engines● lets people plug-in new languages● and call into the JavaTM platform
● Sun is co-pckaging JavaScriptTM language support● using the Rhino engine from Mozilla
● Scripting project on java.net adds many others● currently has 12+ plug-ins
● for Groovy,Jelly, Python, Ruby, Scheme, Tcl, ...● plus links to BeanShell and PHP plug-ins
● all available for use with Mustang● see scripting.dev.java.net
TS-1382Fr. 10:45
2006 JavaOneSM Conference | TK 2006 | 16
Example: Application configuration
● import java.io.*;● import javax.script.*;●
● public class MyApp {●
● public static void main(String[] args) {● //...● ScriptEngineManager sem = new ScriptEngineManager();● ScriptEngine e = sem.getEngineByName("JavaScript");● FileReader fin = new FileReader("MyApp.config.js");● e.eval(fin);● // ...● } ● }
2006 JavaOneSM Conference | TK 2006 | 17
Scripting: JavaScript to JavaTM APIs
● // JavaScript configuration file for MyApp
● importPackage(java.lang)● importPackage(Packages.com.kgh.myapp);
● System.out.println("Running Graham's config script")● MyApp.setFavoriteMammal("lemur")
2006 JavaOneSM Conference | TK 2006 | 18
Desktop Foci● Look-and-Feels
● significant upgrades for Windows and Gnome● including support for Vista● antialiased LCD fronts, Grey Rect fix, ...
● Performance● boosts for Java2D pipelines (and Swing generally)
● Assorted API upgrades● SwingWorker, JTable sorting, GroupLayout
● Desktop Integration● icons in system tray, splash screen support● ability to launch native tools
2006 JavaOneSM Conference | Session 1076 | 19
DEMODesktop Integration
2006 JavaOneSM Conference | TK 2006 | 20
Windows Vista Status● Windows Vista is a key target platform
● We're tracking it closely● Mustang will include core Vista support
● Including IE7 plug-in, Vista look-and-feel, etc● All available when Vista ships in November● Key updates will go into Mustang Beta2 in June● Please help test your applets on Vista + Mustang β2!
● 1.4.2 and 5.0 will also support Vista in Nov.● But with older UI and more limited plug-in support● Extra support in updates (if needed)● Mustang will be primary focus for Vista integration
2006 JavaOneSM Conference | TK 2006 | 21
Web Services: JAX-WS● Goal: heterogeneous distributed programming
● successor to CORBA, RMI, DCOM, ...● easy-to-use, with rich types and flexible semantics● finally everyone is using the same core protocols
● including Microsoft!
● Mustang delivers full JAX-WS client ● and lightweight server (for callbacks)● JavaTM EE 5 adds richer server support
TS-1194We. 11:00
2006 JavaOneSM Conference | TK 2006 | 22
Web Services: Java and .NET
2006 JavaOneSM Conference | TK 2006 | 23
JAX-WS and Project Tango
● JAX-WS 2.0 delivers WS-I basic interop● adequate for basic scenarios● with simple security model
● Project Tango adds richer protocol support● With richer security models, better quality-of-service , etc.● WS-Security, WS-Trust, WS-ReliableMessaging, ...● Without changing the JAX-WS APIs.
● your existing apps will benefit without changes!● Sun JavaTM team is working closely with Microsoft
● Will be delivered on top of Mustang and Java EE 5 in 2007 TS-4661 Tu. 2:00
2006 JavaOneSM Conference | TK 2006 | 24
Many Mustang Features....
(And much, much more!)
JSR-199 Compiler API
APT Pluggability API
JVM & CLR Co-Existence
Improved Native L&Fs
Vista Look & FeelSplit Verifier
Web Services StackJDBC 4.0
Scripting Language Support
Core JVM performance
Windows system tray
JVMTI: attach on demand
LCD font support
chmod
free disk space API
password prompting
Rhino JavaScript engine
FireFox support
improved OOM diagnosability
parallel old-space GCJVM DTrace
More GC Ergonomics
Pluggable Localesimproved text
rendering
XAWT
Docs inChinese
JTable upgrades
JConsole upgradesParallelize Concurrent GC
improve JNI speed
splash screen support more gfx
acceleration
more desktop integration
Unicode Normalizer
SwingWorker Services API
XML digital signatures
http cookie manager
JAXB 2.0
MBeans metadata
TS-3439 Tu. 2:00
2006 JavaOneSM Conference | TK 2006 | 25
Summary: Why to Leap onto Mustang!
● Systemic Enhancements:● Enhanced Robustness, Compatibility, Stability● Even more RAS, Monitoring & Management● Performance boosts on both client & server
● New developer features:● Scripting: JavaScriptTM and more● Desktop integration + great Vista support● Easy-to-use Web Services + XML● ... and much, much more
● Coming in October: Get Ready Now!
2006 JavaOneSM Conference | TK 2006 | 26
JavaTM EE 5 Overview
2006 JavaOneSM Conference | TK 2006 | 27
Java EE 5 is Done!
2006 JavaOneSM Conference | TK 2006 | 28
JavaTM EE 5 Platform Vendors
2006 JavaOneSM Conference | TK 2006 | 29
JavaTM EE 5 IDE Vendors
2006 JavaOneSM Conference | TK 2006 | 30
JavaTM EE 5 Goal
Make it easier to develop Java EE applications
Especially when first getting started with Java EE
2006 JavaOneSM Conference | TK 2006 | 31
How did we make it easier?● Declarative programming
● Originally - deployment descriptors● Now - Java language annotations
● Remove requirements● Plain Old Java Objects (POJOs)● More and better defaults
● More powerful frameworks● Less work for you to do
● Easier to learn and more productive!
2006 JavaOneSM Conference | TK 2006 | 32
Annotations in JavaTM EE 5● Made extensive use of annotations
● For defining and using web services● To map Java classes to XML● To greatly simplify EJB development● To map Java classes to databases● To specify external dependencies● To reduce need for deployment descriptors
● Just starting to scratch the surface of what's possible
2006 JavaOneSM Conference | TK 2006 | 33
JavaTM EE 5 Major Features● Simplified web services support● More web service standards support● Dependency injection● Greatly simplified EJBTM development● New JavaTM Persistence API● Easy web applications with JavaServerTM Faces
● And fully compatible with J2EE 1.4
2006 JavaOneSM Conference | TK 2006 | 34
J2EETM 1.4 Web Service<?xml version='1.0' encoding='UTF-8' ?><webservices xmlns='http://java.sun.com/xml/ns/j2ee' version='1.1'> <webservice-description> <webservice-description-name> HelloService</webservice-description-name> <wsdl-file> WEB-INF/wsdl/HelloService.wsdl</wsdl-file> <jaxrpc-mapping-file> WEB-INF/HelloService-mapping.xml </jaxrpc-mapping-file> <port-component xmlns:wsdl-port_ns='urn:HelloService/wsdl'> <port-component-name>HelloService</port-component-name> <wsdl-port>wsdl-port_ns:HelloServiceSEIPort</wsdl-port> <service-endpoint-interface> endpoint.HelloServiceSEI</service-endpoint-interface> <service-impl-bean> <servlet-link>WSServlet_HelloService</servlet-link> </service-impl-bean> </port-component> </webservice-description></webservices>
<?xml version='1.0' encoding='UTF-8' ?><configuration xmlns='http://java.sun.com/xml/ns/jax-rpc/ri/config'> <service name='HelloService' targetNamespace='urn:HelloService/wsdl' typeNamespace='urn:HelloService/types' packageName='endpoint'> <interface name='endpoint.HelloServiceSEI' servantName='endpoint.HelloServiceImpl'> </interface> </service></configuration>
package endpoint;
import java.rmi.*;
public class HelloServiceImplimplements HelloServiceSEI {
public String sayHello(String param)throws java.rmi.RemoteException {return “Hello “ + param;
}}
package endpoint;
import java.rmi.*;
public interface HelloServiceSEIextends java.rmi.Remote {
public String sayHello(String param)throws java.rmi.RemoteException;
}
2006 JavaOneSM Conference | TK 2006 | 35
JavaTM EE 5 Web Service
package endpoint;
import javax.jws.WebService;
@WebServicepublic class Hello {
public String sayHello(String param) {return “Hello “ + param;
}}
2006 JavaOneSM Conference | TK 2006 | 36
JavaTM EE 5 Web Service
$ mkdir -p WEB-INF/classes$ javac -d WEB-INF/classes endpoint/Hello.java$ jar cf webservicedemo.war WEB-INF$ asadmin deploy webservicedemo.warCommand deploy executed successfully.
2006 JavaOneSM Conference | Session 1076 | 37
DEMOJava EE 5 web service
2006 JavaOneSM Conference | TK 2006 | 38
JavaTM EE 5 Web Service Client
package client;
import endpoint.*;import javax.xml.ws.WebServiceRef;
public class HelloClient {
@WebServiceRef(HelloService.class)private static Hello svc;
public static void main(String[] argv) {System.out.println(svc.sayHello(argv[0]);
}}
2006 JavaOneSM Conference | TK 2006 | 39
JavaTM EE 5 Web Service Client
$ mkdir classes$ wsimport -d classes \
http://localhost:8080/webservicedemo/HelloService?wsdl$ javac -d classes client/HelloClient.java$ cd classes$ jar cfm ../webserviceclient.jar ../manifest.mf *$ cd ..$ asadmin deploy –-retrieve . webserviceclient.jarCommand deploy executed successfully.$ appclient -client webserviceclientClient.jar JoeHello Joe
2006 JavaOneSM Conference | TK 2006 | 40
Web Services in JavaTM EE 5● JAX-WS (follow-on to JAX-RPC) and JAXB is our web
services stack● Supports latest W3C standards
● SOAP 1.2, MTOM/XOP, XML Schema 1.0● Supports latest WS-I standards
● Basic Profile 1.1, Attachment Profile 1.0● Implementation starting to support WS-* specs
● WS-Security● More WS-* in future specs
● WS-Addressing (JSR-261), WS-Policy (JSR-265)
TS-1194Wed. 11:00
2006 JavaOneSM Conference | TK 2006 | 41
JAXB 2.0● Bind Java classes to XML Schema● 100% XML Schema support● Portable annotation driven architecture● Databinding for JAX-WS 2.0
TS-1607Thu. 11:00
2006 JavaOneSM Conference | TK 2006 | 42
JAXB 1.0● JAXB 1.0 generated: ● 308 lines for
● <point><x>1</x><y>2</y></point>
● 38 files● 219KB of code total
//// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v@@BUILD_VERSION@@// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>// Any modifications to this file will be lost upon recompilation of the source schema.// Generated on: 2005.04.21 ?? 10:37:56 PDT//
package generated.impl;
public class PointTypeImpl implements generated.PointType, com.sun.xml.bind.JAXBObject, generated.impl.runtime.UnmarshallableObject, generated.impl.runtime.XMLSerializable, generated.impl.runtime.ValidatableObject{
protected boolean has_Y; protected float _Y; protected boolean has_X; protected float _X; public final static java.lang.Class version = (generated.impl.JAXBVersion.class); private static com.sun.msv.grammar.Grammar schemaFragment;
private final static java.lang.Class PRIMARY_INTERFACE_CLASS() { return (generated.PointType.class); }
public float getY() { return _Y; }
public void setY(float value) { _Y = value; has_Y = true; }
public float getX() { return _X; }
public void setX(float value) { _X = value; has_X = true; }
public generated.impl.runtime.UnmarshallingEventHandler createUnmarshaller(generated.impl.runtime.UnmarshallingContext context) { return new generated.impl.PointTypeImpl.Unmarshaller(context); }
public void serializeBody(generated.impl.runtime.XMLSerializer context) throws org.xml.sax.SAXException { if (!has_Y) { context.reportError(com.sun.xml.bind.serializer.Util.createMissingObjectError(this, "Y")); } if (!has_X) { context.reportError(com.sun.xml.bind.serializer.Util.createMissingObjectError(this, "X")); } context.startElement("", "x"); context.endNamespaceDecls(); context.endAttributes(); try { context.text(javax.xml.bind.DatatypeConverter.printFloat(((float) _X)), "X"); } catch (java.lang.Exception e) { generated.impl.runtime.Util.handlePrintConversionException(this, e,context); } context.endElement(); context.startElement("", "y"); context.endNamespaceDecls(); context.endAttributes(); try { context.text(javax.xml.bind.DatatypeConverter.printFloat(((float) _Y)), "Y"); } catch (java.lang.Exception e) { generated.impl.runtime.Util.handlePrintConversionException(this, e,context); } context.endElement(); }
public void serializeAttributes(generated.impl.runtime.XMLSerializer context) throws org.xml.sax.SAXException { if (!has_Y) { context.reportError(com.sun.xml.bind.serializer.Util.createMissingObjectError(this, "Y")); } if (!has_X) { context.reportError(com.sun.xml.bind.serializer.Util.createMissingObjectError(this, "X")); } }
public void serializeURIs(generated.impl.runtime.XMLSerializer context) throws org.xml.sax.SAXException { if (!has_Y) { context.reportError(com.sun.xml.bind.serializer.Util.createMissingObjectError(this, "Y")); } if (!has_X) { context.reportError(com.sun.xml.bind.serializer.Util.createMissingObjectError(this, "X")); } }
public java.lang.Class getPrimaryInterface() { return (generated.PointType.class); }
public com.sun.msv.verifier.DocumentDeclaration createRawValidator() { if (schemaFragment == null) { schemaFragment = com.sun.xml.bind.validator.SchemaDeserializer.deserialize(( "\u00ac\u00ed\u0000\u0005sr\u0000\u001fcom.sun.msv.grammar.SequenceExp\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xr\u0000\u001dcom.su"+"n.msv.grammar.BinaryExp\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0002L\u0000\u0004exp1t\u0000 Lcom/sun/msv/gra"+"mmar/Expression;L\u0000\u0004exp2q\u0000~\u0000\u0002xr\u0000\u001ecom.sun.msv.grammar.Expressi"+"on\u00f8\u0018\u0082\u00e8N5~O\u0002\u0000\u0002L\u0000\u0013epsilonReducibilityt\u0000\u0013Ljava/lang/Boolean;L\u0000\u000b"+"expandedExpq\u0000~\u0000\u0002xpppsr\u0000\'com.sun.msv.grammar.trex.ElementPatt"+"ern\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0001L\u0000\tnameClasst\u0000\u001fLcom/sun/msv/grammar/NameClass;"+"xr\u0000\u001ecom.sun.msv.grammar.ElementExp\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0002Z\u0000\u001aignoreUndecl"+"aredAttributesL\u0000\fcontentModelq\u0000~\u0000\u0002xq\u0000~\u0000\u0003pp\u0000sq\u0000~\u0000\u0000ppsr\u0000\u001bcom.s"+"un.msv.grammar.DataExp\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0003L\u0000\u0002dtt\u0000\u001fLorg/relaxng/dataty"+"pe/Datatype;L\u0000\u0006exceptq\u0000~\u0000\u0002L\u0000\u0004namet\u0000\u001dLcom/sun/msv/util/String"+"Pair;xq\u0000~\u0000\u0003ppsr\u0000\"com.sun.msv.datatype.xsd.FloatType\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002"+"\u0000\u0000xr\u0000+com.sun.msv.datatype.xsd.FloatingNumberType\u00fc\u00e3\u00b6\u0087\u008c\u00a8|\u00e0\u0002\u0000\u0000"+"xr\u0000*com.sun.msv.datatype.xsd.BuiltinAtomicType\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xr\u0000"+"%com.sun.msv.datatype.xsd.ConcreteType\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xr\u0000\'com.sun"+".msv.datatype.xsd.XSDatatypeImpl\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0003L\u0000\fnamespaceUrit\u0000"+"\u0012Ljava/lang/String;L\u0000\btypeNameq\u0000~\u0000\u0014L\u0000\nwhiteSpacet\u0000.Lcom/sun/"+"msv/datatype/xsd/WhiteSpaceProcessor;xpt\u0000 http://www.w3.org/"+"2001/XMLSchemat\u0000\u0005floatsr\u00005com.sun.msv.datatype.xsd.WhiteSpac"+"eProcessor$Collapse\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xr\u0000,com.sun.msv.datatype.xsd.W"+"hiteSpaceProcessor\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xpsr\u00000com.sun.msv.grammar.Expre"+"ssion$NullSetExpression\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xq\u0000~\u0000\u0003ppsr\u0000\u001bcom.sun.msv.ut"+"il.StringPair\u00d0t\u001ejB\u008f\u008d\u00a0\u0002\u0000\u0002L\u0000\tlocalNameq\u0000~\u0000\u0014L\u0000\fnamespaceURIq\u0000~\u0000"+"\u0014xpq\u0000~\u0000\u0018q\u0000~\u0000\u0017sr\u0000\u001dcom.sun.msv.grammar.ChoiceExp\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xq\u0000"+"~\u0000\u0001ppsr\u0000 com.sun.msv.grammar.AttributeExp\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0002L\u0000\u0003expq\u0000"+"~\u0000\u0002L\u0000\tnameClassq\u0000~\u0000\u0007xq\u0000~\u0000\u0003sr\u0000\u0011java.lang.Boolean\u00cd r\u0080\u00d5\u009c\u00fa\u00ee\u0002\u0000\u0001Z\u0000"+"\u0005valuexp\u0000psq\u0000~\u0000\u000bppsr\u0000\"com.sun.msv.datatype.xsd.QnameType\u0000\u0000\u0000\u0000"+"\u0000\u0000\u0000\u0001\u0002\u0000\u0000xq\u0000~\u0000\u0011q\u0000~\u0000\u0017t\u0000\u0005QNameq\u0000~\u0000\u001bq\u0000~\u0000\u001dsq\u0000~\u0000\u001eq\u0000~\u0000)q\u0000~\u0000\u0017sr\u0000#com."+"sun.msv.grammar.SimpleNameClass\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0002L\u0000\tlocalNameq\u0000~\u0000\u0014L"+"\u0000\fnamespaceURIq\u0000~\u0000\u0014xr\u0000\u001dcom.sun.msv.grammar.NameClass\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001"+"\u0002\u0000\u0000xpt\u0000\u0004typet\u0000)http://www.w3.org/2001/XMLSchema-instancesr\u00000"+"com.sun.msv.grammar.Expression$EpsilonExpression\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000x"+"q\u0000~\u0000\u0003sq\u0000~\u0000$\u0001psq\u0000~\u0000+t\u0000\u0001xt\u0000\u0000sq\u0000~\u0000\u0006pp\u0000sq\u0000~\u0000\u0000ppq\u0000~\u0000\u000esq\u0000~\u0000 ppsq\u0000~"+"\u0000\"q\u0000~\u0000%pq\u0000~\u0000&q\u0000~\u0000-q\u0000~\u00001sq\u0000~\u0000+t\u0000\u0001yq\u0000~\u00005sr\u0000\"com.sun.msv.gramma"+"r.ExpressionPool\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0001L\u0000\bexpTablet\u0000/Lcom/sun/msv/gramma"+"r/ExpressionPool$ClosedHash;xpsr\u0000-com.sun.msv.grammar.Expres"+"sionPool$ClosedHash\u00d7j\u00d0N\u00ef\u00e8\u00ed\u001c\u0003\u0000\u0003I\u0000\u0005countB\u0000\rstreamVersionL\u0000\u0006par"+"entt\u0000$Lcom/sun/msv/grammar/ExpressionPool;xp\u0000\u0000\u0000\u0005\u0001pq\u0000~\u0000\u0005q\u0000~\u0000!"+"q\u0000~\u00008q\u0000~\u0000\nq\u0000~\u00007x")); } return new com.sun.msv.verifier.regexp.REDocumentDeclaration(schemaFragment); } public class Unmarshaller extends generated.impl.runtime.AbstractUnmarshallingEventHandlerImpl {
public Unmarshaller(generated.impl.runtime.UnmarshallingContext context) { super(context, "-------"); }
protected Unmarshaller(generated.impl.runtime.UnmarshallingContext context, int startState) { this(context); state = startState; }
public java.lang.Object owner() { return generated.impl.PointTypeImpl.this; }
public void enterElement(java.lang.String ___uri, java.lang.String ___local, java.lang.String ___qname, org.xml.sax.Attributes __atts) throws org.xml.sax.SAXException { int attIdx; outer: while (true) { switch (state) { case 3 : if (("y" == ___local)&&("" == ___uri)) { context.pushAttributes(__atts, true); state = 4; return ; } break; case 0 : if (("x" == ___local)&&("" == ___uri)) { context.pushAttributes(__atts, true); state = 1; return ; } break; case 6 : revertToParentFromEnterElement(___uri, ___local, ___qname, __atts); return ; } super.enterElement(___uri, ___local, ___qname, __atts); break; } }
public void leaveElement(java.lang.String ___uri, java.lang.String ___local, java.lang.String ___qname) throws org.xml.sax.SAXException { int attIdx; outer: while (true) { switch (state) { case 2 : if (("x" == ___local)&&("" == ___uri)) { context.popAttributes(); state = 3; return ; } break; case 6 : revertToParentFromLeaveElement(___uri, ___local, ___qname); return ; case 5 : if (("y" == ___local)&&("" == ___uri)) { context.popAttributes(); state = 6; return ; } break; } super.leaveElement(___uri, ___local, ___qname); break; } }
public void enterAttribute(java.lang.String ___uri, java.lang.String ___local, java.lang.String ___qname)
}
}
}
2006 JavaOneSM Conference | TK 2006 | 43
JAXB 2.0● JAXB 2.0 generates: ● 62 lines for
● <point><x>1</x><y>2</y></point>
● 2 files● 3KB of code total
@XmlAccessorType(FIELD)@XmlType(name = “”, propOrder = {“x”, “Y”})@XmlRootElement(name = “point”)public class Point {
protected float x;protected flota y;
public float getX() {return x;
}
public void setX(float value) {this.x = value;
}
public float getY() {return y;
}
public void setY(float value) {this.y = value;
}}
2006 JavaOneSM Conference | TK 2006 | 44
EJBTM 3.0● Dramatic simplification of all bean types● POJO based● More defaults● Dependency injection● Interceptors
TS-3616Thu. 9:45
TS-1365Wed. 1:30
2006 JavaOneSM Conference | TK 2006 | 45
JavaTM EE 5 Transactional Web Service
package endpoint;
import javax.jws.WebService;import javax.ejb.Stateless;
@WebService@Statelesspublic class Hello {
public String sayHello(String param) {return “Hello “ + param;
}}
2006 JavaOneSM Conference | Session 1076 | 46
DEMOJava EE 5 transactional web service
2006 JavaOneSM Conference | TK 2006 | 47
JavaTM EE 5 Transactional Web Servicepackage endpoint;
import javax.jws.WebService;
import javax.ejb.Stateless;
import javax.annotation.Resource*;
import java.sql.*;
import javax.sql.DataSource;
@WebService
@Stateless
public class Hello {
@Resource private DataSource ds;
public String sayHello(String param) {
try {
Connection conn = ds.getConnection();
PreparedStatement pst = conn.prepareStatement(
"update Person set count=count+1 where name = ?");
pst.setString(1, param);
pst.executeUpdate();
conn.close();
} catch (SQLException ex) { } // ignore it
return "Hello " + param;
}
}
2006 JavaOneSM Conference | TK 2006 | 48
JavaTM Persistence API● Single persistence API for Java EE and Java SE● Developed by EJB expert group
● Builds on years of experience with existing technologies and products
● Much simpler than EJB CMP● Feedback is overwhelmingly positive● At least three implementations (all open source):
● Oracle – GlassFish/TopLink Essentials● JBoss – Hibernate● BEA – Kodo/OpenJPA TS-3395
Wed. 2:45
2006 JavaOneSM Conference | TK 2006 | 49
JavaTM EE 5 Transactional Web Servicepackage endpoint;
import javax.jws.WebService;import javax.ejb.Stateless;import javax.persistence.EntityManager;import javax.persistence.PersistenceContext;
@WebService@Statelesspublic class Hello {
@PersistenceContext private EntityManager em;public String sayHello(String param) {
Person p = em.find(Person.class, param);if (p == null) {
p = new Person(param);em.persist(p);
}return “Hello “ + param + “: “ +
p.incrementCount();;}
}
2006 JavaOneSM Conference | TK 2006 | 50
JavaTM EE 5 Transactional Web Service
package endpoint;
import javax.persistence.*;
@Entitypublic class Person {
@Id protected String pname;protected int cnt;
public Person() { }
public Person(String name) {pname = name;
}
public int incrementCount() {return ++cnt;
}}
2006 JavaOneSM Conference | TK 2006 | 51
JavaTM EE 5 Transactional Web Service
persistence.xml:
<?xml version=”1.0” encoding=”UTF-8”?><persistence version=”1.0”
xmlns=”http://java.sun.com/xml/ns/persistence”><persistence-unit name=”pu1”/>
</persistence>
2006 JavaOneSM Conference | Session 1076 | 52
DEMOJava EE 5 web service with Java Persistence
2006 JavaOneSM Conference | TK 2006 | 53
Dependency Injection● Example of Inversion of Control● Container “injects” resources...
● DataSource, EJB ref, web service ref, persistence units, UserTransaction, env entries,...
● ... into application ...● Fields, methods; public, private, or protected
● ... in container-managed classes● EJBs, servlets, JSF managed beans, web service
endpoints, handlers, interceptors, app clients● Avoids the need to use JNDI
TS-1969Wed. 4:00
2006 JavaOneSM Conference | TK 2006 | 54
J2EE 1.4 Resource Lookup● public class MyEJB implements SessionBean {
private DataSource myDS;public void ejbCreate() {
try {InitialContext ctx = new InitialContext();
myDS = (DataSource)ctx.lookup(
“employeeDatabase”);} catch (NamingException ex) {
// XXX – what to do?}
}...
● }
● Plus corresponding deployment descriptor entry
2006 JavaOneSM Conference | TK 2006 | 55
Dependency Injection● package com.example;● @Session● public class MyEJB {
@Resourceprivate DataSource myDS;...
● }
● Declares a resource named com.example.MyEJB/myDS● And injects it into the myDS field● No deployment descriptor entry needed!
2006 JavaOneSM Conference | TK 2006 | 56
Dependency Injection● package com.example;● @Session● public class MyEJB {
@Resource(name = “employeeDatabase”)private DataSource myDS;...
● }
● Declares a resource named employeeDatabase● And injects it into the myDS field● Still no deployment descriptor entry needed!
2006 JavaOneSM Conference | TK 2006 | 57
Dependency Injection● package com.example;● @Session● public class MyEJB {
@Resource(mappedName = “OracleDatabase”)private DataSource myDS;...
● }
● Declares a resource that's mapped to the app server's global resource named OracleDatabase
● And still no deployment descriptor entry needed!
2006 JavaOneSM Conference | TK 2006 | 58
JavaServerTM Faces 1.2● The Java EE Standard Web Application Framework
● Dependency injection in managed beans● Easy to use, powerful, extensible Expression Language,
shared with JSP● Large market of JSF components
● Over 200 components from over 20 vendors, such as...● Apache, BusinessObjects, ESRI, Oracle, Sun, etc.● Including AJAX support
● Java BluePrints AJAX Components● http://blueprints.dev.java.net
TS-1161Fri. 12:00
2006 JavaOneSM Conference | TK 2006 | 59
New Web 2.0 Java Pet Store: Built with AJAX-enabled JSF Components
File Upload Google Maps Mashup
Popup Balloon
RatingsAuto-complete
RSS Reader
2006 JavaOneSM Conference | TK 2006 | 60
Application Packaging● Packaging is now much simpler● Many cases don't require deployment descriptors
● EJB jar file● Web application using only JSP, web services● Application client● Enterprise application (ear file)
2006 JavaOneSM Conference | TK 2006 | 61
Web Application Packaging Example● app.war
index.jspimages/logo.gifWEB-INF/classes/MyWebService.class
● That's it!● No META-INF/web.xml● No META-INF/webservices.xml● No JAX-RPC mapping file
2006 JavaOneSM Conference | TK 2006 | 62
Enterprise Application Packaging● Rules and conventions make for simpler packaging● .war files are web applications● .rar files are resource adapters● lib directory contains shared jar files● .jar with Main-Class is an app client● .jar file with @Stateless is an EJB
2006 JavaOneSM Conference | TK 2006 | 63
Enterprise Application Packaging Example● app.ear
lib/shared.jarui/web.warui/client.jarbiz/ejb.jar
● That's it!● No META-INF/application.xml
2006 JavaOneSM Conference | TK 2006 | 64
How Much Easier Is It?● Adventure Builder1
● J2EE 1.4 – 67 classes, 3284 lines of code● Java EE 5 – 43 classes, 2777 lines of code● 36% fewer classes to manage!
● RosterApp2
● J2EE 1.4 – 17 classes, 987 lines of code● Java EE 5 – 7 classes, 716 lines of code● J2EE 1.4 XML files – 9 files, 792 lines● Java EE 5 XML files – 1 file, 5 lines● 58% fewer classes, 89% fewer XML files to manage!
[1] Source: Debu Panda, Oracle[2] Source: Raghu Kodali, Oracle
2006 JavaOneSM Conference | TK 2006 | 65
JavaTM EE 5 New Specs● JSP Standard Tag Library (JSR-52)● StAX (JSR-173)● Web Services Metadata (JSR-181)● Java Persistence API (JSR-220)● JAXB (JSR-222)● JAX-WS (JSR-224)● Common Annotations (JSR-250)● JavaServer Faces (JSR-252)
2006 JavaOneSM Conference | TK 2006 | 66
JavaTM EE 5 Updated Specs● EJB 3.0 (JSR-220)● JSP 2.1 (JSR-245)● Minor updates...
● Implementing Enterprise Web Services (JSR-109)● Servlets● JavaMailTM, JAF● Management, Deployment● JACC● SAAJ● JTA
2006 JavaOneSM Conference | TK 2006 | 67
Project GlassFish
Building a Java EE 5 open source application server
Java.sun.com/javaee/GlassFish
Source: Sun 2/06 – See website for latest stats
Simplifying Java application development with Java EE 5 technologies
Includes JAX-WS 2.0, JAXB 2.0, JSF 1.2, EJB 3.0, and Java Persistence 1.0Supports > 20 frameworks and appsOpen source CDDL license Basis for the Sun Java System Application Server PE 9
Free to download and free to deploy
Over 2200 members & 280,000 downloads
TS-3274Tue. 5:45
blogs.sun.com/theaquarium
2006 JavaOneSM Conference | TK 2006 | 68
Java EE Futures● Still too early to say anything definitive● Everything is subject to approval by the JCP● We need feedback from you!
● What's most important to improve● What's most important to add● What is still not easy enough● What did we get right!
2006 JavaOneSM Conference | TK 2006 | 69
Java EE Futures● Grow upwards
● Composite applications● JBI, SCA
● Portlets● High availability, clustering, etc.
● Grow downwards● Scripting
● JavaScript in JSP pages, servlets● Web/application hosting, WebDAV
● Grow sideways● Improve existing APIs● AJAX● WS-*
2006 JavaOneSM Conference | TK 2006 | 70
JavaTM EE Summary● Java EE 5 is much easier● Download the SDK
● http://java.sun.com/javaee● Get involved in the GlassFish community
● http://glassfish.dev.java.net● Please give us feedback
● [email protected]● http://forum.java.sun.com
2006 JavaOneSM Conference | TK 2006 | 71
Agenda
FuturesJavaTM SE 7+ new language technologies
2006 JavaOneSM Conference | TK 2006 | 72
Dolphin: JavaTM Language Updates ● We're cautious in changing the JavaTM language
● the current language works really well!● but some thoughtful change seems good
● Direct support for XML● under active investigation● allows XML literals inline + simple queries
● “Super-Packages” (JSR-292)● formerly known as “friends”● complements runtime module work (JSR-277)
● Probably some others● a number of candidates being considered
2006 JavaOneSM Conference | TK 2006 | 73
XML in JavaTM, Candidate Syntax●
● String mark = "Mark Reinhold";● XML speaker = <who> { mark } </who>;
XML talk = <session> { speaker } <title> { "XML in Java" } </title> <when> { "Wednesday 1:30pm" } </when> </session>;
TS-3441 We. 1:30
2006 JavaOneSM Conference | TK 2006 | 74
JavaTM Modules Draft Syntax
● super package com.sun.myModule {●
// super-package exports:export com.sun.gilad.myapi.*;export com.sun.gilad.util.Helper;
// super-package members:com.sun.gilad.myapi;com.sun.gilad.util;com.sun.gilad.impl;
● }
TS-3885We. 12:15
2006 JavaOneSM Conference | TK 2006 | 75
Some Other Key Dolphin Candidates...● Desktop improvements:
● More Java2D graphics acceleration● Swing support for beans binding (JSR-295)● Swing application framework support (JSR-296)
● JavaTM Module System (JSR-277)● Better packaging● Including package repository
● BeanShell (JSR-274)● Yet more systemic enhancements● ... and we have many more candidates!
TS-3439 Tu. 2:00
2006 JavaOneSM Conference | TK 2006 | 76
Growing the Java platform● We want to grow the platform in several dimensions
● Ease-of-Development simplifies Java Platform APIs● but there are also a range of language styles
EoD
New Languages
New
Languages
Language
Plat
form
RicherSimpler
Sim
plici
tyCo
mpl
exity
2006 JavaOneSM Conference | TK 2006 | 77
Different Places, Different Languages● JavaTM language is Gold Standard for enterprise coding
● Great for robust, long-lived, maintainable apps● But diversity is good!
● Lightweight apps may not need static checking● Fast-changing presentation tier can use different styles
● Advice:● Use Java language for long lived core business classes● Consider Scripting/Dynamic for fast-changing preso tier
● call into Java classes for business logic● Supports mixed mode development● Different styles for different needs, on shared Java Platform
2006 JavaOneSM Conference | TK 2006 | 78
Dynamic Languages● Dynamic languages run on the JVM today
● Ruby, Python, Groovy, many more● Happiness!
● New bytecode will accelerate dynamic languages● JSR-292 “Supporting Dynamically Typed Languages”● Supports more dynamic method dispatch● Make JVM support easier and faster
● The first JVM bytecode not used by JavaTM language!
TS-3886Th. 9:45
2006 JavaOneSM Conference | TK 2006 | 79
Visual Basic for JavaTM
● Goal: enable VB developers to use JavaTM platform● Semplice project will support VB language
● compile from VB source into Java classfiles● VB source code calls into Java platform APIs.
● A new language for the Java platform!● Will support standard VB.net concepts
● goal is to reuse basic VB skills● not to be an exact clone of all details of language
TS-3576 Th. 9:45
2006 JavaOneSM Conference | Session 1076 | 80
DEMOVB for Java
2006 JavaOneSM Conference | TK 2006 | 81
Web Tier Futures: Even More Ajax● We expect two long-term styles with Ajax● High-level JSF/Ajax components
● using JavaScript behind the scenes● for both whizzy effects and powerful server interaction
● Raw Ajax: hand written client JavaScript● increasingly using toolkits: Dojo,Kabuki,Prototype, ...
● JavaTM Web Tier will support both styles● tools support will be increasingly important● we'll try to work with others towards consensus styles● this area looks like seeing continuing change
2006 JavaOneSM Conference | TK 2006 | 82
JavaScriptTM in WebTier
● Project Phobos adds JavaScriptTM to JavaTM web-tier● complements client-side Ajax JavaScript
● JavaScript enabled pages● an extra language choice for JSP pages● lets you embed server-side JavaScript on pages● use JavaScript on both client and server!
● Lightweight servlets in JavaScript● Invoke JavaScript on incoming POST and GETs
BOF-9450Tu 9:30pm
2006 JavaOneSM Conference | Session 1076 | 83
DEMOJavaScript in WebTier
2006 JavaOneSM Conference | TK 2006 | 84
Conclusion● JavaTM EE 5 is here now
● It is a no-brainer for new projects● Get it now!
● Mustang arrives in October● Many systemic upgrades and great new features
● Lots of work happening around new languages● Use scripting with Mustang
● Help get the word out!● Give this presentation to your colleagues!
2006 JavaOneSM Conference | TK 2006 | 85
Please Reuse our Slides!
● We'll post these slides to the web later this week● weblogs.java.net/blog/kgh
● You are very welcome to reuse them● for trip reports, JUGs, internal briefings, etc.● reuse any or all, as you find useful
● Help get the platform news out!
2006 JavaOneSM Conference | TK 2006 |
JavaTM Platform RoadmapsThe Big Stuff, Today & Tomorrow
Graham Hamilton VP & Fellow, Sun Microsystems
Bill Shannon Distinguished Engineer, Sun Microsystems
2006 JavaOneSM Conference | TK 2006 | 87
The Java Community Process
● All new JavaTM APIs go through ● the JCP
● So this is all tentative, subject to JCP● plans may change● based on expert group discussions● and on community feedback!
Argent HotelWe. 6:30pm