JavaTM Platform Roadmaps The Big Stuff, Today - PowerPoint PPT Presentation

1 / 87
About This Presentation
Title:

JavaTM Platform Roadmaps The Big Stuff, Today

Description:

... Lots of way to use scripting in your apps Sometimes you may decide to use a mixture of Java and scriting in building ... Hotel We. 6:30pm 2006 ... Design Default ... – PowerPoint PPT presentation

Number of Views:173
Avg rating:3.0/5.0
Slides: 88
Provided by: weblogsJa
Category:

less

Transcript and Presenter's Notes

Title: JavaTM Platform Roadmaps The Big Stuff, Today


1
JavaTM Platform RoadmapsThe Big Stuff, Today
Tomorrow
  • Graham Hamilton VP Fellow, Sun
    Microsystems
  • Bill Shannon Distinguished
    Engineer, Sun Microsystems

2
Agenda
  • JavaTM SE 6 - Mustang
  • Qualities features
  • JavaTM EE 5
  • Now and How
  • Futures
  • Dolphin
  • New languages

3
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 Session Alan Brenner, VP Client
Systems Group, Sun Microsystems 200-400pm in
Esplanade 303/305
4
Agenda
  • JavaTM SE 6 - Mustang

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

6
(No Transcript)
7
Agenda
  • JavaTM SE 6 - Mustang
  • Systemic properties
  • New features
  • JavaTM EE 5
  • Futures

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
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
Swing "Gray Rect" (Exposure) Performance
  • Time to repaint exposed region in big Swing app.
    Smaller is better!

11
SpecJBB from 1.3.1 to 6
Server benchmark SPECjbb2000
Source Sun Microsystems, Inc.
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
JConsole
14
Agenda
  • JavaTM SE 6 - Mustang
  • Systemic properties
  • New features
  • JavaTM EE 5
  • Futures

15
(No Transcript)
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("JavaSc
    ript")
  • FileReader fin new FileReader("MyApp.confi
    g.js")
  • e.eval(fin)
  • // ...

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")

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
DEMO
  • Desktop Integration

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

21
(No Transcript)
22
Web Services Java and .NET
23
(No Transcript)
24
(No Transcript)
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!

26
JavaTM EE 5 Overview
27
Java EE 5 is Done!
28
JavaTM EE 5 Platform Vendors
29
JavaTM EE 5 IDE Vendors
30
JavaTM EE 5 Goal
  • Make it easier to develop Java EE applications
  • Especially when first getting started with Java EE

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
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

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

34
J2EETM 1.4 Web Service
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
lt?xml version'1.0' encoding'UTF-8'
?gt ltwebservices xmlns'http//java.sun.com/xml/ns/
j2ee' version'1.1'gt ltwebservice-descriptiongt
ltwebservice-description-namegt
HelloServicelt/webservice-description-namegt
ltwsdl-filegt WEB-INF/wsdl/HelloService.wsdllt/w
sdl-filegt ltjaxrpc-mapping-filegt
WEB-INF/HelloService-mapping.xml
lt/jaxrpc-mapping-filegt ltport-component
xmlnswsdl-port_ns'urnHelloService/wsdl'gt
ltport-component-namegtHelloServicelt/port-component-
namegt ltwsdl-portgtwsdl-port_nsHelloServiceSE
IPortlt/wsdl-portgt ltservice-endpoint-interfac
egt endpoint.HelloServiceSEIlt/service-endpoi
nt-interfacegt ltservice-impl-beangt
ltservlet-linkgtWSServlet_HelloServicelt/servlet-link
gt lt/service-impl-beangt
lt/port-componentgt lt/webservice-descriptiongt lt/we
bservicesgt lt?xml version'1.0'
encoding'UTF-8' ?gt ltconfiguration
xmlns'http//java.sun.com/xml/ns/jax-rpc/ri/confi
g'gt ltservice name'HelloService'
targetNamespace'urnHelloService/wsdl'
typeNamespace'urnHelloService/types'
packageName'endpoint'gt ltinterface
name'endpoint.HelloServiceSEI'
servantName'endpoint.HelloServiceImpl'gt
lt/interfacegt lt/servicegt lt/configurationgt
35
JavaTM EE 5 Web Service
package endpoint import javax.jws.WebService _at_
WebService public class Hello public String
sayHello(String param) return Hello
param
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.war Command deploy executed
successfully.
37
DEMO
  • Java EE 5 web service

38
JavaTM EE 5 Web Service Client
package client import endpoint. import
javax.xml.ws.WebServiceRef public class
HelloClient _at_WebServiceRef(HelloService.class)
private static Hello svc public static void
main(String argv) System.out.println(svc.say
Hello(argv0)
39
JavaTM EE 5 Web Service Client
mkdir classes wsimport -d classes \
http//localhost8080/webservicedemo/HelloSe
rvice?wsdl javac -d classes client/HelloClient.j
ava 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
(No Transcript)
41
(No Transcript)
42
JAXB 1.0
  • JAXB 1.0 generated
  • 308 lines for
  • ltpointgtltxgt1lt/xgtltygt2lt/ygtlt/pointgt
  • 38 files
  • 219KB of code total

// // This file was generated by the JavaTM
Architecture for XML Binding(JAXB) Reference
Implementation, v_at__at_BUILD_VERSION_at__at_ // See lta
href"http//java.sun.com/xml/jaxb"gthttp//java.su
n.com/xml/jaxblt/agt // Any modifications to
this file will be lost upon recompilation of the
source schema. // Generated on 2005.04.21
?? 103756 PDT // package generated.impl publ
ic 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.Unmarsha
llingContext context) return new
generated.impl.PointTypeImpl.Unmarshaller(context)
public void serializeBody(generated.i
mpl.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.seria
lizer.Util.createMissingObjectError(this, "X"))
context.startElement("", "x")
context.endNamespaceDecls()
context.endAttributes() try
context.text(javax.xml.bind.DatatypeConverter.pri
ntFloat(((float) _X)), "X") catch
(java.lang.Exception e)
generated.impl.runtime.Util.handlePrintConversionE
xception(this, e, context)
context.endElement() context.startElement
("", "y") context.endNamespaceDecls()
context.endAttributes() try
context.text(javax.xml.bind.DatatypeConvert
er.printFloat(((float) _Y)), "Y")
catch (java.lang.Exception e)
generated.impl.runtime.Util.handlePrintConversionE
xception(this, e, context)
context.endElement() public void
serializeAttributes(generated.impl.runtime.XMLSeri
alizer context) throws org.xml.sax.SAXExce
ption if (!has_Y)
context.reportError(com.sun.xml.bind.serializer.Ut
il.createMissingObjectError(this, "Y"))
if (!has_X)
context.reportError(com.sun.xml.bind.serializer.Ut
il.createMissingObjectError(this, "X"))
public void serializeURIs(generated.i
mpl.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.seria
lizer.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.dese
rialize(( "\u00ac\u00ed\u0000\u0005sr\u0000\u001f
com.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\u
0000\u0002L\u0000\u0004exp1t\u0000
Lcom/sun/msv/gra" "mmar/ExpressionL\u0000\u0004e
xp2q\u0000\u0000\u0002xr\u0000\u001ecom.sun.msv.g
rammar.Expressi" "on\u00f8\u0018\u0082\u00e8N5O\
u0002\u0000\u0002L\u0000\u0013epsilonReducibilityt
\u0000\u0013Ljava/lang/BooleanL\u0000\u000b" "ex
pandedExpq\u0000\u0000\u0002xpppsr\u0000\'com.sun
.msv.grammar.trex.ElementPatt" "ern\u0000\u0000\u
0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u00
01L\u0000\tnameClasst\u0000\u001fLcom/sun/msv/gram
mar/NameClass" "xr\u0000\u001ecom.sun.msv.gramma
r.ElementExp\u0000\u0000\u0000\u0000\u0000\u0000\u
0000\u0001\u0002\u0000\u0002Z\u0000\u001aignoreUnd
ecl" "aredAttributesL\u0000\fcontentModelq\u0000
\u0000\u0002xq\u0000\u0000\u0003pp\u0000sq\u0000
\u0000\u0000ppsr\u0000\u001bcom.s" "un.msv.gramma
r.DataExp\u0000\u0000\u0000\u0000\u0000\u0000\u000
0\u0001\u0002\u0000\u0003L\u0000\u0002dtt\u0000\u0
01fLorg/relaxng/dataty" "pe/DatatypeL\u0000\u000
6exceptq\u0000\u0000\u0002L\u0000\u0004namet\u000
0\u001dLcom/sun/msv/util/String" "Pairxq\u0000\
u0000\u0003ppsr\u0000\"com.sun.msv.datatype.xsd.Fl
oatType\u0000\u0000\u0000\u0000\u0000\u0000\u0000\
u0001\u0002" "\u0000\u0000xr\u0000com.sun.msv.da
tatype.xsd.FloatingNumberType\u00fc\u00e3\u00b6\u0
087\u008c\u00a8\u00e0\u0002\u0000\u0000" "xr\u00
00com.sun.msv.datatype.xsd.BuiltinAtomicType\u000
0\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\
u0000\u0000xr\u0000" "com.sun.msv.datatype.xsd.C
oncreteType\u0000\u0000\u0000\u0000\u0000\u0000\u0
000\u0001\u0002\u0000\u0000xr\u0000\'com.sun" ".m
sv.datatype.xsd.XSDatatypeImpl\u0000\u0000\u0000\u
0000\u0000\u0000\u0000\u0001\u0002\u0000\u0003L\u0
000\fnamespaceUrit\u0000" "\u0012Ljava/lang/Strin
gL\u0000\btypeNameq\u0000\u0000\u0014L\u0000\nwh
iteSpacet\u0000.Lcom/sun/" "msv/datatype/xsd/Whit
eSpaceProcessorxpt\u0000 http//www.w3.org/" "20
01/XMLSchemat\u0000\u0005floatsr\u00005com.sun.msv
.datatype.xsd.WhiteSpac" "eProcessorCollapse\u00
00\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" "ssionNullSetExpression\u
0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u00
02\u0000\u0000xq\u0000\u0000\u0003ppsr\u0000\u001
bcom.sun.msv.ut" "il.StringPair\u00d0t\u001ejB\u0
08f\u008d\u00a0\u0002\u0000\u0002L\u0000\tlocalNam
eq\u0000\u0000\u0014L\u0000\fnamespaceURIq\u0000
\u0000" "\u0014xpq\u0000\u0000\u0018q\u0000\u00
00\u0017sr\u0000\u001dcom.sun.msv.grammar.ChoiceEx
p\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\
u0002\u0000\u0000xq\u0000" "\u0000\u0001ppsr\u00
00 com.sun.msv.grammar.AttributeExp\u0000\u0000\u0
000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u000
2L\u0000\u0003expq\u0000" "\u0000\u0002L\u0000\t
nameClassq\u0000\u0000\u0007xq\u0000\u0000\u0003
sr\u0000\u0011java.lang.Boolean\u00cd
r\u0080\u00d5\u009c\u00fa\u00ee\u0002\u0000\u0001Z
\u0000" "\u0005valuexp\u0000psq\u0000\u0000\u000
bppsr\u0000\"com.sun.msv.datatype.xsd.QnameType\u0
000\u0000\u0000\u0000" "\u0000\u0000\u0000\u0001\
u0002\u0000\u0000xq\u0000\u0000\u0011q\u0000\u00
00\u0017t\u0000\u0005QNameq\u0000\u0000\u001bq\u0
000\u0000\u001dsq\u0000\u0000\u001eq\u0000\u000
0)q\u0000\u0000\u0017sr\u0000com." "sun.msv.gra
mmar.SimpleNameClass\u0000\u0000\u0000\u0000\u0000
\u0000\u0000\u0001\u0002\u0000\u0002L\u0000\tlocal
Nameq\u0000\u0000\u0014L" "\u0000\fnamespaceURIq
\u0000\u0000\u0014xr\u0000\u001dcom.sun.msv.gramm
ar.NameClass\u0000\u0000\u0000\u0000\u0000\u0000\u
0000\u0001" "\u0002\u0000\u0000xpt\u0000\u0004typ
et\u0000)http//www.w3.org/2001/XMLSchema-instance
sr\u00000" "com.sun.msv.grammar.ExpressionEpsilo
nExpression\u0000\u0000\u0000\u0000\u0000\u0000\u0
000\u0001\u0002\u0000\u0000x" "q\u0000\u0000\u00
03sq\u0000\u0000\u0001psq\u0000\u0000t\u0000\u
0001xt\u0000\u0000sq\u0000\u0000\u0006pp\u0000sq\
u0000\u0000\u0000ppq\u0000\u0000\u000esq\u0000\
u0000 ppsq\u0000" "\u0000\"q\u0000\u0000pq\u00
00\u0000q\u0000\u0000-q\u0000\u00001sq\u0000\
u0000t\u0000\u0001yq\u0000\u00005sr\u0000\"com.s
un.msv.gramma" "r.ExpressionPool\u0000\u0000\u000
0\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0001L
\u0000\bexpTablet\u0000/Lcom/sun/msv/gramma" "r/E
xpressionPoolClosedHashxpsr\u0000-com.sun.msv.gr
ammar.Expres" "sionPoolClosedHash\u00d7j\u00d0N\
u00ef\u00e8\u00ed\u001c\u0003\u0000\u0003I\u0000\u
0005countB\u0000\rstreamVersionL\u0000\u0006par"
"entt\u0000Lcom/sun/msv/grammar/ExpressionPoolxp
\u0000\u0000\u0000\u0005\u0001pq\u0000\u0000\u000
5q\u0000\u0000!" "q\u0000\u00008q\u0000\u0000\
nq\u0000\u00007x")) return
new com.sun.msv.verifier.regexp.REDocumentDeclarat
ion(schemaFragment) public class
Unmarshaller extends generated.impl.runtim
e.AbstractUnmarshallingEventHandlerImpl
public Unmarshaller(generated.impl.runtime.U
nmarshallingContext context)
super(context, "-------")
protected Unmarshaller(generated.impl.runtime.Unma
rshallingContext 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.SAXExceptio
n 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 revertToParentFromLeav
eElement(___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
JAXB 2.0
  • JAXB 2.0 generates
  • 62 lines for
  • ltpointgtltxgt1lt/xgtltygt2lt/ygtlt/pointgt
  • 2 files
  • 3KB of code total

_at_XmlAccessorType(FIELD) _at_XmlType(name ,
propOrder x, Y) _at_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
44
(No Transcript)
45
JavaTM EE 5 Transactional Web Service
package endpoint import javax.jws.WebService im
port javax.ejb.Stateless _at_WebService _at_Stateless
public class Hello public String
sayHello(String param) return Hello
param
46
DEMO
  • Java EE 5 transactional web service

47
JavaTM EE 5 Transactional Web Service
package endpoint import javax.jws.WebService im
port javax.ejb.Stateless import
javax.annotation.Resource import
java.sql. import javax.sql.DataSource _at_WebServ
ice _at_Stateless public class Hello _at_Resource
private DataSource ds public String
sayHello(String param) try Connection
conn ds.getConnection()
PreparedStatement pst conn.prepareStatement(
"update Person set countcount1 where
name ?") pst.setString(1, param)
pst.executeUpdate() conn.close()
catch (SQLException ex) // ignore it return
"Hello " param
48
(No Transcript)
49
JavaTM EE 5 Transactional Web Service
package endpoint import javax.jws.WebService im
port javax.ejb.Stateless import
javax.persistence.EntityManager import
javax.persistence.PersistenceContext _at_WebService
_at_Stateless public class Hello _at_PersistenceCont
ext 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
JavaTM EE 5 Transactional Web Service
package endpoint import javax.persistence. _at_E
ntity public class Person _at_Id protected String
pname protected int cnt public Person()
public Person(String name) pname
name public int incrementCount() return
cnt
51
JavaTM EE 5 Transactional Web Service
persistence.xml lt?xml version1.0
encodingUTF-8?gt ltpersistence
version1.0 xmlnshttp//java.sun.com/xml/ns/
persistencegt ltpersistence-unit
namepu1/gt lt/persistencegt
52
DEMO
  • Java EE 5 web service with Java Persistence

53
(No Transcript)
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
Dependency Injection
  • package com.example
  • _at_Session
  • public class MyEJB
  • _at_Resource
  • private DataSource myDS
  • ...
  • Declares a resource named com.example.MyEJB/myDS
  • And injects it into the myDS field
  • No deployment descriptor entry needed!

56
Dependency Injection
  • package com.example
  • _at_Session
  • public class MyEJB
  • _at_Resource(name employeeDatabase)
  • private DataSource myDS
  • ...
  • Declares a resource named employeeDatabase
  • And injects it into the myDS field
  • Still no deployment descriptor entry needed!

57
Dependency Injection
  • package com.example
  • _at_Session
  • public class MyEJB
  • _at_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!

58
(No Transcript)
59
(No Transcript)
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
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
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 _at_Stateless is an EJB

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
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
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)

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

67
(No Transcript)
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
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
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
  • javaee-spec-feedback_at_sun.com
  • http//forum.java.sun.com

71
Agenda
  • Futures
  • JavaTM SE 7
  • new language
  • technologies

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

73
(No Transcript)
74
(No Transcript)
75
(No Transcript)
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

Complexity
Platform
New Languages
New Languages
EoD
Simplicity
Language
Richer
Simpler
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

78
(No Transcript)
79
(No Transcript)
80
DEMO
  • VB for Java

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

82
(No Transcript)
83
DEMO
  • JavaScript in WebTier

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!

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
JavaTM Platform RoadmapsThe Big Stuff, Today
Tomorrow
  • Graham Hamilton VP Fellow, Sun
    Microsystems
  • Bill Shannon Distinguished
    Engineer, Sun Microsystems

87
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com