javaone 2012 technical keynotese+em.pdfjigsaw reification ease of use optimizations generic lang...
TRANSCRIPT
Insert Presenterʼs Name HereInsert Presenterʼs Title Here
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 13
JavaOne 2012Technical KeynoteMark Reinhold (@mreinhold)Chief Architect, Java Platform Group
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Richard BairChief Architect, Java Client Group
Jasper PottsDeveloper Experience Architect
2
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.3
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.4
final SessionFilterCriteria criteria = sessionFilter;final List<Row> allRows = new ArrayList<Row>(rows);allRows.addAll(filtered);
filterTask = new Task<Runnable>() { @Override protected Runnable call() throws Exception { /*...*/ }};
filterTask.setOnSucceeded(new EventHandler<WorkerStateEvent>() { @Override public void handle(WorkerStateEvent event) { final Runnable r = filterTask.getValue(); if (r != null) r.run(); }});
FILTER_EXECUTOR.submit(filterTask);
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.5
// A map of sessions which need to move from being filtered// to being unfilteredfinal Map<Row, List<SessionView>> sessionsToRestore = new HashMap<Row, List<SessionView>>();
// A map of sessions which need to move to being filteredfinal Map<Row, List<SessionView>> sessionsToFilter = new HashMap<Row, List<SessionView>>();
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.6
private boolean shouldKeep(Session s, SessionCriteria criteria) { final String text = criteria.getText(); final Set<Track> tracks = criteria.getTracks(); final Set<SessionType> types = criteria.getSessionTypes();
return (s.getTitle().toLowerCase().contains(text) || s.getSpeakersDisplay().toLowerCase().contains(text) || s.getSummary().toLowerCase().contains(text) || s.getAbbreviation().toLowerCase().contains(text)) && (!(t != null && tracks.contains(t)) && !(st != null && types.contains(st)));}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.7
for (Row row : allRows) { for (SessionView view : row.sessions) { if (isCancelled()) return null; if (view.filtered.get() && shouldKeep(view.session, criteria)) { List<SessionView> views = sessionsToRestore.get(row); if (views == null) { views = new ArrayList<SessionView>(); sessionsToRestore.put(row, views); } views.add(view); } else if (!view.filtered.get() && !shouldKeep(view.session, criteria)) { List<SessionView> views = sessionsToRestore.get(row); if (views == null) { views = new ArrayList<SessionView>(); sessionsToFilter.put(row, views); } views.add(view); } }}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Brian GoetzJava Language Architect
8
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.10
// Event handler for when things go terribly wrongfilterTask.setOnFailed(new EventHandler<WorkerStateEvent>() { @Override public void handle(WorkerStateEvent e) { e.getSource().getException().printStackTrace(); }});
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.10
// Event handler for when things go terribly wrongfilterTask.setOnFailed(new EventHandler<WorkerStateEvent>() { @Override public void handle(WorkerStateEvent e) { e.getSource().getException().printStackTrace(); }});
filterTask.setOnFailed( e -> e.getSource().getException().printStackTrace());
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.11
for (Shape s : shapes) { if (s.getColor() == BLUE) s.setColor(RED);}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.11
for (Shape s : shapes) { if (s.getColor() == BLUE) s.setColor(RED);}
shapes.forEach(s -> { if (s.getColor() == BLUE) s.setColor(RED);});
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.12
interface Collection<T> { default void forEach(Block<T> action) { for (T t : this) action.apply(t); }}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.13
shapes.forEach(s -> { if (s.getColor() == BLUE) s.setColor(RED);});
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.13
shapes.filter(s -> s.getColor() == RED) .forEach(s -> { s.setColor(BLUE); });
shapes.forEach(s -> { if (s.getColor() == BLUE) s.setColor(RED);});
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.14
int sumOfWeight = shapes.parallel() .filter(s -> s.getColor() == BLUE) .map(s -> s.getWeight()) .sum();
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.15
for (Row row : allRows) { for (SessionView view : row.sessions) { if (isCancelled()) return null; if (view.filtered.get() && shouldKeep(view.session, criteria)) { List<SessionView> views = sessionsToRestore.get(row); if (views == null) { views = new ArrayList<SessionView>(); sessionsToRestore.put(row, views); } views.add(view); } else if (!view.filtered.get() && !shouldKeep(view.session, criteria)) { List<SessionView> views = sessionsToRestore.get(row); if (views == null) { views = new ArrayList<SessionView>(); sessionsToFilter.put(row, views); } views.add(view); } }}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.16
List<SessionView> views = sessionsToRestore.get(row);if (views == null) { views = new ArrayList<SessionView>(); sessionsToRestore.put(row, views);}views.add(view);
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.16
List<SessionView> views = sessionsToRestore.get(row);if (views == null) { views = new ArrayList<SessionView>(); sessionsToRestore.put(row, views);}views.add(view);
List<SessionView> views = sessionsToRestore.computeIfAbsent(row, () -> new ArrayList<>());views.add(view);
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.16
List<SessionView> views = sessionsToRestore.get(row);if (views == null) { views = new ArrayList<SessionView>(); sessionsToRestore.put(row, views);}views.add(view);
List<SessionView> views = sessionsToRestore.computeIfAbsent(row, () -> new ArrayList<>());views.add(view);
sessionsToRestore.computeIfAbsent(row, () -> new ArrayList<>()) .add(view);
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.17
for (Row row : allRows) { for (SessionView view : row.sessions) { if (isCancelled()) return null; if (view.filtered.get() && shouldKeep(view.session, criteria)) { List<SessionView> views = sessionsToRestore.get(row); if (views == null) { views = new ArrayList<SessionView>(); sessionsToRestore.put(row, views); } views.add(view); } else if (!view.filtered.get() && !shouldKeep(view.session, criteria)) { List<SessionView> views = sessionsToRestore.get(row); if (views == null) { views = new ArrayList<SessionView>(); sessionsToFilter.put(row, views); } views.add(view); } }}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.18
Factory<ArrayList<SessionView>> fact = () -> new ArrayList<>();for (Row row : allRows) { row.sessions .filter(view -> view.filtered.get() && shouldKeep(view.session, criteria)) .forEach(view -> sessionsToRestore.computeIfAbsent(row, fact) .add(view)); row.sessions .filter(view -> !view.filtered.get() && !shouldKeep(view.session, criteria)) .forEach(view -> sessionsToFilter.computeIfAbsent(row, fact) .add(view));}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.19
http://openjdk.java.net/projects/lambdahttp://jdk8.java.net/lambda
Project Lambda
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.19
http://openjdk.java.net/projects/lambdahttp://jdk8.java.net/lambda
Project Lambda
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.19
http://openjdk.java.net/projects/lambdahttp://jdk8.java.net/lambda
Project Lambda
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.20
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Bob VandetteJava Embedded Architect
21
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.22
Memory Bandwidth Comparison
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Variations in Embedded Architectures
23
armv5
armv6
Atom Z6xx
Atom Z5xx
e600
e500v2
e500mcAtom E6xx armv7
32 vs. 64 bitBig/Little Endian
Single Multi-Core
ARM ABIEABI,HFABI
soft-floathard-float
GPU Software Rendering FPUMemory
TSO,RMO
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Footprint Metrics
24
Static Dynamic
Graphics? Current
43 5232 64
YesNo
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Footprint Metrics
24
Static Dynamic
Graphics? Current Converged (goal)
43 5232 64
1016
1632
YesNo YesNo
base
tls loggingauthjdbc
jtarmi
jaxpnaming
rowset
kerberos management
compiler
xmldsig
prefssctp
instrument
scripting
crypto
compat
management.iiop
cosnaming
corba
desktop
tools.jre
jaxws
jx.annotations
httpserver
tools
tools.jaxws tools.base
devtools
base
tls loggingauthjdbc
jtarmi
jaxpnaming
rowset
kerberos management
compiler
xmldsig
prefssctp
instrument
scripting
crypto
compat
management.iiop
cosnaming
corba
desktop
tools.jre
jaxws
jx.annotations
httpserver
tools
tools.jaxws tools.base
devtools
52MB
base
tls loggingauthjdbc
jtarmi
jaxpnaming
rowset
kerberos management
compiler
xmldsig
prefssctp
instrument
scripting
crypto
compat
management.iiop
cosnaming
corba
desktop
tools.jre
jaxws
jx.annotations
httpserver
tools
tools.jaxws tools.base
devtools
1052MB
base
tls loggingauthjdbc
jtarmi
jaxpnaming
rowset
kerberos management
compiler
xmldsig
prefssctp
instrument
scripting
crypto
compat
management.iiop
cosnaming
corba
desktop
tools.jre
jaxws
jx.annotations
httpserver
tools
tools.jaxws tools.base
devtools
1052MB 17
base
tls loggingauthjdbc
jtarmi
jaxpnaming
rowset
kerberos management
compiler
xmldsig
prefssctp
instrument
scripting
crypto
compat
management.iiop
cosnaming
corba
desktop
tools.jre
jaxws
jx.annotations
httpserver
tools
tools.jaxws tools.base
devtools
1052MB 1724
base
tls loggingauthjdbc
jtarmi
jaxpnaming
rowset
kerberos management
compiler
xmldsig
prefssctp
instrument
scripting
crypto
compat
management.iiop
cosnaming
corba
desktop
tools.jre
jaxws
jx.annotations
httpserver
tools
tools.jaxws tools.base
devtools
base
tls logging
base
tls logging
j1_2012_scheduler
base
tls logging
j1_2012_scheduler
javafx.profile.embedded
base
tls loggingj1_2012_scheduler_model
j1_2012_scheduler
javafx.profile.embedded
base
tls loggingj1_2012_scheduler_model
j1_2012_scheduler
javafx.profile.embedded
base
tls loggingj1_2012_scheduler_model
httpclient
httpcore
j1_2012_scheduler
javafx.profile.embedded
base
tls loggingj1_2012_scheduler_model
commons.logging
httpclient
commons.codec
httpcore
j1_2012_scheduler
javafx.profile.embedded
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27
Java 8
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27
Lambda (JSR 335)
Java 8
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27
Lambda (JSR 335)
Compact ProfilesJava 8
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27
Lambda (JSR 335)
Compact ProfilesJava 8
Nashorn
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27
Lambda (JSR 335)Date/Time API (JSR 310)
Compact ProfilesJava 8
Nashorn
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27
Lambda (JSR 335)Date/Time API (JSR 310)
Type Annotations (JSR 308)
Compact ProfilesJava 8
Nashorn
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27
Lambda (JSR 335)Date/Time API (JSR 310)
Type Annotations (JSR 308)
Compact Profiles
Lambda-Form Representation for Method Handles
Remove the Permanent Generation
Improve Contended LockingGeneralized Target-Type Inference
DocTree API
Parallel Array Sorting
Bulk Data Operations Unicode 6.2Base64 HTTP ClientNSA Suite B
Prepare for Modularization
Unicode CLDR
TLS Server Name IndicationConfigurable Secure-Random Number Generation
Java 8Nashorn
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.28
Java 8
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.28
Java 8
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.28
http://openjdk.java.net/projects/jdk8http://openjdk.java.net/projects/jdk8/spechttp://jdk8.java.net
Java 8
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.29
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.29
Java 9 … and beyond!
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.29
Jigsaw
ReificationEase of use
OpenJFX Self Tuning JVM
Unified Type System
Java 9 … and beyond!
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.29
Jigsaw
ReificationEase of use
Optimizations
Generic Lang Interoperability
Penrose
OpenJFXProject Sumatra – Java for GPUs
More and More Ports
Multi-Tenancy
Self Tuning JVMImproved Native Integration
Resource Management
Unified Type System
Data Structure Optimizations
Java 9 … and beyond!
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.30
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.30
The preceding material is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.31
Graphic Section Divider