Presentation is loading. Please wait.

Presentation is loading. Please wait.

2006 JavaOne SM Conference | TK 2006 | Java TM Platform Roadmaps The Big Stuff, Today & Tomorrow Graham Hamilton VP & Fellow, Sun Microsystems Bill Shannon.

Similar presentations


Presentation on theme: "2006 JavaOne SM Conference | TK 2006 | Java TM Platform Roadmaps The Big Stuff, Today & Tomorrow Graham Hamilton VP & Fellow, Sun Microsystems Bill Shannon."— Presentation transcript:

1 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

2 2006 JavaOne SM Conference | TK 2006 | 2 Agenda ● Java TM SE 6 - Mustang Qualities & features ● Java TM EE 5 Now and How ● Futures Dolphin New languages

3 Java TM 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 Session Alan Brenner, VP Client Systems Group, Sun Microsystems 2:00-4:00pm in Esplanade 303/305

4 2006 JavaOne SM Conference | TK 2006 | 4 Agenda Java TM SE 6 - Mustang

5 2006 JavaOne SM Conference | TK 2006 | 5 Java TM SE Schedule ● Java TM SE 5.0 “Tiger” shipped fall 2004 ● Java TM SE 6 “Mustang” ships this October ● Java TM SE 7 “Dolphin” targets second half 2008 ● Plus small bugfix updates every 8-16 weeks ● But no 5.1 or 6.1

6 2006 JavaOne SM 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 Hotel Tu. 8:30 pm BOF-178 W. 10:30pm

7 2006 JavaOne SM Conference | TK 2006 | 7 Agenda ● Java TM SE 6 - Mustang Systemic properties New features ● Java TM EE 5 ● Futures

8 2006 JavaOne SM 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!

9 2006 JavaOne SM 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

10 2006 JavaOne SM Conference | TK 2006 | 10 Swing "Gray Rect" (Exposure) Performance ● Time to repaint exposed region in big Swing app. Smaller is better!

11 2006 JavaOne SM Conference | TK 2006 | 11 SpecJBB from to 6 Server benchmark: SPECjbb2000 Source: Sun Microsystems, Inc.

12 2006 JavaOne SM 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

13 2006 JavaOne SM Conference | TK 2006 | 13 JConsole

14 2006 JavaOne SM Conference | TK 2006 | 14 Agenda ● Java TM SE 6 - Mustang Systemic properties New features ● Java TM EE 5 ● Futures

15 2006 JavaOne SM Conference | TK 2006 | 15 Scripting ● JSR-223 defines framework for scripting engines ● lets people plug-in new languages ● and call into the Java TM platform ● Sun is co-pckaging JavaScript TM 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-1382 Fr. 10:45

16 2006 JavaOne SM 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); ● //... ● }

17 2006 JavaOne SM Conference | TK 2006 | 17 Scripting: JavaScript to Java TM 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")

18 2006 JavaOne SM 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

19 2006 JavaOne SM Conference | Session 1076 | 19 DEMO Desktop Integration

20 2006 JavaOne SM 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! ● 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

21 2006 JavaOne SM 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) ● Java TM EE 5 adds richer server support TS-1194 W e. 11:00

22 2006 JavaOne SM Conference | TK 2006 | 22 Web Services: Java and.NET

23 2006 JavaOne SM 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 Java TM team is working closely with Microsoft ● Will be delivered on top of Mustang and Java EE 5 in 2007 TS-4661 Tu. 2:00

24 2006 JavaOne SM 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 & Feel Split Verifier Web Services Stack JDBC 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 GC JVM DTrace More GC Ergonomics Pluggable Locales improved text rendering XAWT Docs in Chinese JTable upgrades JConsole upgrades Parallelize Concurrent GC improve JNI speed splash screen support more gfx acceleration more desktop integration Unicode Normalizer SwingWorkerServices API XML digital signatures http cookie manager JAXB 2.0 MBeans metadata TS-3439 Tu. 2:00

25 2006 JavaOne SM 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: JavaScript TM and more ● Desktop integration + great Vista support ● Easy-to-use Web Services + XML ●... and much, much more ● Coming in October: Get Ready Now!

26 2006 JavaOne SM Conference | TK 2006 | 26 Java TM EE 5 Overview

27 2006 JavaOne SM Conference | TK 2006 | 27 Java EE 5 is Done!

28 2006 JavaOne SM Conference | TK 2006 | 28 Java TM EE 5 Platform Vendors

29 2006 JavaOne SM Conference | TK 2006 | 29 Java TM EE 5 IDE Vendors

30 2006 JavaOne SM Conference | TK 2006 | 30 Java TM EE 5 Goal Make it easier to develop Java EE applications Especially when first getting started with Java EE

31 2006 JavaOne SM 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!

32 2006 JavaOne SM Conference | TK 2006 | 32 Annotations in Java TM 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

33 2006 JavaOne SM Conference | TK 2006 | 33 Java TM EE 5 Major Features ● Simplified web services support ● More web service standards support ● Dependency injection ● Greatly simplified EJB TM development ● New Java TM Persistence API ● Easy web applications with JavaServer TM Faces ● And fully compatible with J2EE 1.4

34 2006 JavaOne SM Conference | TK 2006 | 34 J2EE TM 1.4 Web Service HelloService WEB-INF/wsdl/HelloService.wsdl WEB-INF/HelloService-mapping.xml HelloService wsdl-port_ns:HelloServiceSEIPort endpoint.HelloServiceSEI WSServlet_HelloService package endpoint; import java.rmi.*; public class HelloServiceImpl implements HelloServiceSEI { public String sayHello(String param) throws java.rmi.RemoteException { return “Hello “ + param; } package endpoint; import java.rmi.*; public interface HelloServiceSEI extends java.rmi.Remote { public String sayHello(String param) throws java.rmi.RemoteException; }

35 2006 JavaOne SM Conference | TK 2006 | 35 Java TM EE 5 Web Service package endpoint; import public class Hello { public String sayHello(String param) { return “Hello “ + param; }

36 2006 JavaOne SM Conference | TK 2006 | 36 Java TM 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.war Command deploy executed successfully.

37 2006 JavaOne SM Conference | Session 1076 | 37 DEMO Java EE 5 web service

38 2006 JavaOne SM Conference | TK 2006 | 38 Java TM EE 5 Web Service Client package client; import endpoint.*; import javax.xml.ws.WebServiceRef; public class HelloClient private static Hello svc; public static void main(String[] argv) { System.out.println(svc.sayHello(argv[0]); }

39 2006 JavaOne SM Conference | TK 2006 | 39 Java TM EE 5 Web Service Client $ mkdir classes $ wsimport -d classes \ $ javac -d classes client/HelloClient.java $ cd classes $ jar cfm../webserviceclient.jar../manifest.mf * $ cd.. $ asadmin deploy –-retrieve. webserviceclient.jar Command deploy executed successfully. $ appclient -client webserviceclientClient.jar Joe Hello Joe

40 2006 JavaOne SM Conference | TK 2006 | 40 Web Services in Java TM 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-1194 Wed. 11:00

41 2006 JavaOne SM 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-1607 Thu. 11:00

42 2006 JavaOne SM Conference | TK 2006 | 42 JAXB 1.0 ● JAXB 1.0 generated: ● 308 lines for ● 1 2 ● 38 files ● 219KB of code total // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, // See // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: ?? 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\u "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) }

43 2006 JavaOne SM Conference | TK 2006 | 43 JAXB 2.0 ● JAXB 2.0 generates: ● 62 lines for ● 1 2 ● 2 files ● 3KB of = “”, propOrder = {“x”, = “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; }

44 2006 JavaOne SM Conference | TK 2006 | 44 EJB TM 3.0 ● Dramatic simplification of all bean types ● POJO based ● More defaults ● Dependency injection ● Interceptors TS-3616 Thu. 9:45 TS-1365 Wed. 1:30

45 2006 JavaOne SM Conference | TK 2006 | 45 Java TM EE 5 Transactional Web Service package endpoint; import javax.jws.WebService; public class Hello { public String sayHello(String param) { return “Hello “ + param; }

46 2006 JavaOne SM Conference | Session 1076 | 46 DEMO Java EE 5 transactional web service

47 2006 JavaOne SM Conference | TK 2006 | 47 Java TM EE 5 Transactional Web Service package endpoint; import javax.jws.WebService; import javax.ejb.Stateless; import javax.annotation.Resource*; import java.sql.*; public class Hello 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; }

48 2006 JavaOne SM Conference | TK 2006 | 48 Java TM 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

49 2006 JavaOne SM Conference | TK 2006 | 49 Java TM EE 5 Transactional Web Service package endpoint; import javax.jws.WebService; import javax.ejb.Stateless; import javax.persistence.EntityManager; public class Hello 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();; }

50 2006 JavaOne SM Conference | TK 2006 | 50 Java TM EE 5 Transactional Web Service package endpoint; import public class Person protected String pname; protected int cnt; public Person() { } public Person(String name) { pname = name; } public int incrementCount() { return ++cnt; }

51 2006 JavaOne SM Conference | TK 2006 | 51 Java TM EE 5 Transactional Web Service persistence.xml: http://java.sun.com/xml/ns/persistence

52 2006 JavaOne SM Conference | Session 1076 | 52 DEMO Java EE 5 web service with Java Persistence

53 2006 JavaOne SM 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-1969 Wed. 4:00

54 2006 JavaOne SM 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

55 2006 JavaOne SM Conference | TK 2006 | 55 Dependency Injection ● package com.example; ● public class MyEJB private DataSource myDS;... ● } ● Declares a resource named com.example.MyEJB/myDS ● And injects it into the myDS field ● No deployment descriptor entry needed!

56 2006 JavaOne SM Conference | TK 2006 | 56 Dependency Injection ● package com.example; ● public class MyEJB = “employeeDatabase”) private DataSource myDS;... ● } ● Declares a resource named employeeDatabase ● And injects it into the myDS field ● Still no deployment descriptor entry needed!

57 2006 JavaOne SM Conference | TK 2006 | 57 Dependency Injection ● package com.example; ● public class MyEJB = “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!

58 2006 JavaOne SM Conference | TK 2006 | 58 JavaServer TM 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 ● TS-1161 Fri. 12:00

59 2006 JavaOne SM Conference | TK 2006 | 59 New Web 2.0 Java Pet Store: Built with AJAX- enabled JSF Components File Upload Google Maps Mashup Popup Balloon Ratings Auto-complete RSS Reader

60 2006 JavaOne SM 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)

61 2006 JavaOne SM Conference | TK 2006 | 61 Web Application Packaging Example ● app.war index.jsp images/logo.gif WEB-INF/classes/MyWebService.class ● That's it! ● No META-INF/web.xml ● No META-INF/webservices.xml ● No JAX-RPC mapping file

62 2006 JavaOne SM 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 is an EJB

63 2006 JavaOne SM Conference | TK 2006 | 63 Enterprise Application Packaging Example ● app.ear lib/shared.jar ui/web.war ui/client.jar biz/ejb.jar ● That's it! ● No META-INF/application.xml

64 2006 JavaOne SM Conference | TK 2006 | 64 How Much Easier Is It? ● Adventure Builder 1 ● J2EE 1.4 – 67 classes, 3284 lines of code ● Java EE 5 – 43 classes, 2777 lines of code ● 36% fewer classes to manage! ● RosterApp 2 ● 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

65 2006 JavaOne SM Conference | TK 2006 | 65 Java TM 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)

66 2006 JavaOne SM Conference | TK 2006 | 66 Java TM EE 5 Updated Specs ● EJB 3.0 (JSR-220) ● JSP 2.1 (JSR-245) ● Minor updates... ● Implementing Enterprise Web Services (JSR-109) ● Servlets ● JavaMail TM, JAF ● Management, Deployment ● JACC ● SAAJ ● JTA

67 2006 JavaOne SM 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 TS-3274 Tue. 5:45 blogs.sun.com/theaquarium

68 2006 JavaOne SM 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!

69 2006 JavaOne SM 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-*

70 2006 JavaOne SM Conference | TK 2006 | 70 Java TM EE Summary ● Java EE 5 is much easier ● Download the SDK ● ● Get involved in the GlassFish community ● ● Please give us feedback ● ●

71 2006 JavaOne SM Conference | TK 2006 | 71 Agenda Futures Java TM SE 7 + new language technologies

72 2006 JavaOne SM Conference | TK 2006 | 72 Dolphin: Java TM Language Updates ● We're cautious in changing the Java TM 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

73 2006 JavaOne SM Conference | TK 2006 | 73 XML in Java TM, Candidate Syntax ● ● String mark = "Mark Reinhold"; ● XML speaker = { mark } ; XML talk = { speaker } { "XML in Java" } { "Wednesday 1:30pm" } ; TS-3441 We. 1:30

74 2006 JavaOne SM Conference | TK 2006 | 74 Java TM 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-3885 W e. 12:15

75 2006 JavaOne SM 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) ● Java TM 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

76 2006 JavaOne SM 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 Language Platform RicherSimpler Simplicity Complexity

77 2006 JavaOne SM Conference | TK 2006 | 77 Different Places, Different Languages ● Java TM 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

78 2006 JavaOne SM 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 Java TM language! TS-3886 Th. 9:45

79 2006 JavaOne SM Conference | TK 2006 | 79 Visual Basic for Java TM ● Goal: enable VB developers to use Java TM 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

80 2006 JavaOne SM Conference | Session 1076 | 80 DEMO VB for Java

81 2006 JavaOne SM 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,... ● Java TM 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

82 2006 JavaOne SM Conference | TK 2006 | 82 JavaScript TM in WebTier ● Project Phobos adds JavaScript TM to Java TM 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-9450 Tu 9:30pm

83 2006 JavaOne SM Conference | Session 1076 | 83 DEMO JavaScript in WebTier

84 2006 JavaOne SM Conference | TK 2006 | 84 Conclusion ● Java TM 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!

85 2006 JavaOne SM 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!

86 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

87 2006 JavaOne SM Conference | TK 2006 | 87 The Java Community Process ● All new Java TM 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 Hotel We. 6:30pm


Download ppt "2006 JavaOne SM Conference | TK 2006 | Java TM Platform Roadmaps The Big Stuff, Today & Tomorrow Graham Hamilton VP & Fellow, Sun Microsystems Bill Shannon."

Similar presentations


Ads by Google